[PR #5920] [MERGED] fix(providers): stream Gemini and Anthropic turns that carry tools #6990

Closed
opened 2026-10-23 04:15:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5920
Author: @kolacheee
Created: 9/7/2026
Status: ✅ Merged
Merged: 9/8/2026
Merged by: @kolacheee

Base: staging ← Head: fix/provider-tools-streaming


📝 Commits (6)

  • a4046e2 fix(providers): stream Gemini and Anthropic rounds that carry tools
  • a77e93e Merge remote-tracking branch 'origin/staging' into fix/provider-tools-streaming
  • e2f58a1 Merge remote-tracking branch 'origin/staging' into codex/review-pr-5920-sep8
  • c615348 fix(providers): release interrupted tool streams and report aborts
  • 6b8d40e Merge remote-tracking branch 'origin/staging' into codex/review-pr-5920-sep8
  • 836db41 Merge remote-tracking branch 'origin/staging' into codex/review-pr-5920-sep8

📊 Changes

5 files changed (+1006 additions, -43 deletions)

View changed files

📝 CHANGELOG.md (+3 -0)
📝 e2e/core-flows.e2e.ts (+5 -0)
📝 packages/server/src/services/llm/providers/anthropic.provider.ts (+187 -24)
📝 packages/server/src/services/llm/providers/google.provider.ts (+178 -19)
📝 scripts/regressions/provider-compat.regression.ts (+633 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Warning

Merge gate: two live smoke tests are owed and not yet run. One real Gemini turn and one real Anthropic turn, on real keys, with tools attached. The CHANGELOG entry in this PR already makes the user-facing streaming claim, so it must not merge until those two runs happen. Details under Validation.

Linked issue

Closes #5918

There is no linked issue yet. One should be opened before this PR is submitted — this is a provider-adapter bug with no existing report.

Two references, neither of which this PR closes:

  • It is the enabling work for the tool-called dice half of the Game Master write-back arc (#5798). Attaching a dice tool to Game Mode turns is only affordable once tools stop costing those two connections their streaming; without this fix, arming a tool on a Gemini or Anthropic chat converts every turn of that chat to whole-generation buffering.
  • The Gemini thinking carve-out this PR deliberately preserves is scoped by #5904. That rule predates tools entirely and this PR does not touch it.

Why this change

Both adapters abandoned streaming the moment a tool was attached. On a Gemini or Anthropic connection with any tool enabled, the reply bubble stayed empty for the entire generation and then filled all at once. The tool loop never asked for that — it passes a token sink and no streaming flag at all — so this was the adapters not listening, not the APIs refusing.

The regression users feel is time to first token, not chunk granularity: the token sink fans out through the same chunker either way, so the whole reply eventually arrives identically. What was lost was every second between "send" and "the first word appears", on turns that are already the slowest ones.

What changed

Each provider's chatComplete now carries a streaming branch beside its existing whole-response branch, mirroring the pattern the OpenAI adapter already ships. chat() is untouched on purpose: swapping its serializer would change the wire shape of every ordinary streaming turn on these connections, including the Anthropic string-content shape that prompt caching keys its prefixes on. The textual fallback parser, the local-endpoint prompt injection and the two subscription providers are equally untouched.

Gemini. A ?alt=sse streaming URL, built the same way the existing streaming path builds its own. Tool calls are collected through the adapter's existing part converter with an index that runs across frames, so two calls that arrive without ids cannot collide on a synthesized one. The empty-response throw, ported as-is, would have ended a round that is nothing but a tool call and legitimately carries no prose, so the streamed branch clears that guard on tool calls as well — worth stating precisely, because it is easy to misread as a user-facing bug being fixed: it never was one. The existing buffered branch already counted tool calls as output, so nothing shipped ever threw there; this is a porting hazard the new branch had to avoid, and the regression covers it as a property of the new path.

Gemini with thinking still buffers. That rule exists because some proxies strip thought parts out of SSE streams and return them whole in a non-streaming response. It predates tools, it is deliberate, and it survives this PR untouched, pinned by an assertion. If a live Gemini connection runs with thinking or a reasoning effort set, this change does nothing for it — the honest framing is that it removes the penalty for everyone else.

Anthropic. stream: useStream replaces the hardcoded false, and the fetch's buffering flag follows it, because the buffered fetch mode drains the whole body before the provider can read a byte — a streamed request that still asked for buffering would parse the same frames and hand them over all at once anyway. Tool input is accumulated from the partial-JSON deltas keyed by content-block index: parallel tool calls are legal (the Engine never disables them), so the single current-block slot the non-tool path uses would merge two calls into one. The empty-text guard is the existing one with a tool-calls term added, because it leans on a stop reason arriving and a tool-only round need not send one.

One pre-existing bug carried forward, not created. The tools path never returned provider metadata, so there were no stored Gemini parts to replay and a multi-round Gemini 3 turn lost its thought signatures. Both branches now return the reconstructed parts, which the tool loop replays onto the assistant message; a tool-call part keeps its own signature rather than having it moved onto the text part. This was not free, and the earlier design notes that called it a five-line freebie were wrong: adding the replay meant the call-id-to-name map had to move above the replay branch, which returns early. Without that move, a tool result falls back to the literal name tool_result, and Gemini pairs a result to its call by name — so the model would read a reply attributed to a function nobody called. The move and a regression case that runs a genuine second round are both in this PR.

The conservative gate, and every caller's behavior

Streaming is gated on !!options.onToken && options.stream !== false rather than the base formula (options.stream ?? !!options.onToken). The difference matters for exactly one caller shape: a caller that sets a streaming flag but supplies no token sink of its own keeps its buffered path.

Every chatComplete consumer was swept; only two pass tools at all:

Caller Tools Streaming intent Effect of this PR
Main tool loop, generate.routes.ts yes token sink, no flag the target — streams when the chat streams
Forced final round, same file no token sink unchanged (bails out with no tools)
Per-agent tool loop, agent-executor.ts yes flag, no sink of its own unchanged unless agent progress reporting is on, which injects a sink — and then the round streams. Named rather than hidden: content handed back is the same accumulated text either way, and progress reporting gains a real time-to-first-token, which is what it exists for
Other agent-executor calls no either unchanged
Turn-game bot runner yes neither unchanged
Professor Mari's workspace agent no (Mari uses the textual protocol) sometimes a sink unchanged
The remaining ~30 call sites no — unchanged

Providers that cannot do native tool calls are structurally untouched: the two subscription providers hardcode tools away and keep the base streaming path, and the local sidecar delegates to an internal OpenAI provider. The OpenAI family already streamed with tools attached and is not edited.

What this PR does not claim: that tool calls are now cheaper than a bracket tag. They are not, on any provider — a tool round is an extra full round-trip and extra input tokens, always. What it removes is a penalty on top of that, which was an adapter gap rather than physics. The win is correctness in one beat, not efficiency.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

The live smokes are the merge gate. Everything else is secondary.

  • Live smoke, Gemini: on a real Gemini connection with tools attached, run one turn and confirm two things — text arrives progressively rather than all at once, and a tool call the model makes is parsed correctly and answered. Use a connection with thinking off; with thinking on, the turn is expected to stay buffered and proves nothing about this change.
  • Live smoke, Anthropic: the same on a real Anthropic key with tools attached — progressive text, and a correctly parsed tool call.
  • Manually verify a multi-round Gemini turn (the model calls a tool, reads the result, then answers) and confirm it completes rather than erroring — this is the path the thought-signature replay and the call-name map affect.
  • Manually verify in the browser that an ordinary turn with no tools attached is unchanged on both connections.
  • Manually verify that an agent run with tools enabled still completes normally on these connections, with and without progress reporting — that is the one caller whose behavior this PR deliberately moves.
  • Run pnpm check and confirm it exits clean.
  • Run node ./scripts/run-regressions.mjs --filter provider-compat and confirm it passes.

What the offline regression proves. provider-compat.regression.ts drives both adapters against stub servers: streamed tool-call parsing per provider, a round that is nothing but a tool call, prose arriving before a tool call, tools attached but never used still streaming, the Gemini thinking carve-out staying buffered, the no-sink gate staying buffered, partial tool-argument JSON split mid-key across frames and across network chunks, interleaved parallel tool blocks staying bound to their own indexes, a genuine second round asserting the tool result is named for the function that produced it, two id-less calls taking distinct synthesized ids, an Anthropic tool call with no stop reason behind it, and a stub that withholds the tail of its stream until the first token lands, so a buffered read fails the assertion instead of passing quietly. Fourteen surgical reverts of the changed code were each confirmed to fail it.

What it cannot prove. A stub proves this parser against our own fixture — not Google's and Anthropic's actual emission. The two riskiest unknowns are precisely the ones a stub is structurally unable to answer: whether Gemini ever splits a single tool call across frames, and whether ?alt=sse plus tools survives a proxy path. Hence the live smokes.

Two unrelated suite failures, so they are not a surprise. A full run of the regression suite comes back 207 of 209. Both failures reproduce identically with this PR's four files reverted to the parent commit: one gallery lane passes its own assertions and then dies removing a Windows temp directory at teardown, and the launcher format guard dies in a heap probe. Neither touches providers.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

What this PR actually does, for the reviewer to confirm against the boxes:

  • One CHANGELOG entry under Fixed. It carries the user-facing claim that text now arrives as the model writes it, and it names the Gemini-with-thinking exception. That line is the reason the live smokes gate the merge — it ships to users as release notes.
  • No docs/ prose changes, so nothing to mirror on docs-i18n.
  • No version bump; no release metadata touched.

UI evidence (if applicable)

The visible difference is timing, not layout, so a screenshot cannot show it. If the live smokes are recorded, one short clip per provider of a tools-attached turn filling in progressively is the evidence worth attaching — a before/after pair is better still, since the "before" is a bubble that sits empty for the whole generation.

Known limitations

  • A stream cut mid tool-argument leaves Anthropic reporting empty arguments. The argument parser folds truncated JSON the same way it folds invalid JSON, so a call whose arguments were half-written comes back as {} rather than as an error. The old buffered path failed its response parse instead, and the OpenAI streaming path keeps the truncated string. Narrow (it needs a server that closes cleanly mid-fragment) and not fixed here; a warning when a non-empty accumulation fails to parse would be the smallest honest improvement.
  • The Gemini lane does not pin its own buffering flag. Progressive delivery on Gemini was proven by hand with a tail-withholding stub, and the code is correct today because the fetch defaults to unbuffered — but a future change setting that flag on Gemini would keep the lane green while silently killing Gemini streaming. The Anthropic side has the tail-gated stub; porting it to the Gemini server is a few lines and is worth doing.
  • A Gemini part carrying both text and a tool call would lose its text on the streamed branch, where the buffered branch in the same method counts both. Gemini does not emit that shape today.
  • An Anthropic tool block with an empty name comes back with an empty name, where the OpenAI adapter would discard the call. Nit-level, pre-existing shape.
  • Reconstructed parts collapse ordering — thought text into one part, prose into one, calls appended last. This matches the existing non-tool reconstruction and only matters if a model interleaves text, then a call, then more text.

Summary by CodeRabbit

  • Bug Fixes

    • Anthropic and Gemini tool-using responses now stream text as it is generated.
    • Parallel and interleaved tool calls are matched to the correct tools more reliably.
    • Tool-only responses are handled correctly.
    • Interrupted or failed streaming responses now release connections properly.
    • Gemini thinking-enabled responses retain their existing non-streaming behavior.
    • Fixed a theme color transition issue affecting visual consistency.
  • Documentation

    • Documented live text and tool-call streaming for supported tool-using replies.

Maintainer staging integration

Updated against current staging; fixed both CodeRabbit findings in c61534831. Both adapters release their upstream stream on provider errors and rejected token callbacks and return abort for an interrupted tool turn. Six real local-HTTP cases cover those outcomes in both adapters; the cleanup case failed before the patch and the complete suite passes after it.

pnpm check, provider compatibility, prompt and context-fit regressions pass locally. The old mobile-WebKit failure was the swipe theme assertion comparing retained Oklab transition serialization with the settled theme color. The fixture now disables only the input transition for its static color comparison, preserving all color/size/navigation assertions; the focused WebKit test passed three consecutive runs. No provider UI was changed for that fixture repair.

The explicitly requested live Gemini and Anthropic smoke tests remain unverified; no paid-provider result is claimed here. The maintainer has been asked whether those have already been run or which test connections may be used. All human validation boxes remain unchecked.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5920 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 9/7/2026 **Status:** ✅ Merged **Merged:** 9/8/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/provider-tools-streaming` --- ### 📝 Commits (6) - [`a4046e2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a4046e25c3b1741c07e112ea7828ea7b1590e423) fix(providers): stream Gemini and Anthropic rounds that carry tools - [`a77e93e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a77e93e2d1cd4dd99f51552a916907fd3a9800d1) Merge remote-tracking branch 'origin/staging' into fix/provider-tools-streaming - [`e2f58a1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e2f58a1d5fe411d165b260fc1105d654d7a07ca7) Merge remote-tracking branch 'origin/staging' into codex/review-pr-5920-sep8 - [`c615348`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c61534831c3050a61fa6f9fc99e7ae0cc53731ce) fix(providers): release interrupted tool streams and report aborts - [`6b8d40e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6b8d40e8cbec31b36aeaed3293a3bf313753445d) Merge remote-tracking branch 'origin/staging' into codex/review-pr-5920-sep8 - [`836db41`](https://github.com/Pasta-Devs/Marinara-Engine/commit/836db41f3a43ded641ce583b6ec390dc24b91ae4) Merge remote-tracking branch 'origin/staging' into codex/review-pr-5920-sep8 ### 📊 Changes **5 files changed** (+1006 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -0) 📝 `e2e/core-flows.e2e.ts` (+5 -0) 📝 `packages/server/src/services/llm/providers/anthropic.provider.ts` (+187 -24) 📝 `packages/server/src/services/llm/providers/google.provider.ts` (+178 -19) 📝 `scripts/regressions/provider-compat.regression.ts` (+633 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. > [!WARNING] > **Merge gate: two live smoke tests are owed and not yet run.** One real Gemini turn and one real Anthropic turn, on real keys, with tools attached. The CHANGELOG entry in this PR already makes the user-facing streaming claim, so it must not merge until those two runs happen. Details under Validation. ## Linked issue Closes #5918 There is no linked issue yet. **One should be opened before this PR is submitted** — this is a provider-adapter bug with no existing report. Two references, neither of which this PR closes: - It is the enabling work for the tool-called dice half of the Game Master write-back arc (#5798). Attaching a dice tool to Game Mode turns is only affordable once tools stop costing those two connections their streaming; without this fix, arming a tool on a Gemini or Anthropic chat converts every turn of that chat to whole-generation buffering. - The Gemini thinking carve-out this PR deliberately preserves is scoped by #5904. That rule predates tools entirely and this PR does not touch it. ## Why this change Both adapters abandoned streaming the moment a tool was attached. On a Gemini or Anthropic connection with any tool enabled, the reply bubble stayed empty for the entire generation and then filled all at once. The tool loop never asked for that — it passes a token sink and no streaming flag at all — so this was the adapters not listening, not the APIs refusing. The regression users feel is time to first token, not chunk granularity: the token sink fans out through the same chunker either way, so the whole reply eventually arrives identically. What was lost was every second between "send" and "the first word appears", on turns that are already the slowest ones. ## What changed Each provider's `chatComplete` now carries a streaming branch beside its existing whole-response branch, mirroring the pattern the OpenAI adapter already ships. **`chat()` is untouched on purpose**: swapping its serializer would change the wire shape of every ordinary streaming turn on these connections, including the Anthropic string-content shape that prompt caching keys its prefixes on. The textual fallback parser, the local-endpoint prompt injection and the two subscription providers are equally untouched. **Gemini.** A `?alt=sse` streaming URL, built the same way the existing streaming path builds its own. Tool calls are collected through the adapter's existing part converter with an index that runs across frames, so two calls that arrive without ids cannot collide on a synthesized one. The empty-response throw, ported as-is, would have ended a round that is nothing but a tool call and legitimately carries no prose, so the streamed branch clears that guard on tool calls as well — worth stating precisely, because it is easy to misread as a user-facing bug being fixed: **it never was one.** The existing buffered branch already counted tool calls as output, so nothing shipped ever threw there; this is a porting hazard the new branch had to avoid, and the regression covers it as a property of the new path. **Gemini with thinking still buffers.** That rule exists because some proxies strip thought parts out of SSE streams and return them whole in a non-streaming response. It predates tools, it is deliberate, and it survives this PR untouched, pinned by an assertion. If a live Gemini connection runs with thinking or a reasoning effort set, **this change does nothing for it** — the honest framing is that it removes the penalty for everyone else. **Anthropic.** `stream: useStream` replaces the hardcoded `false`, and the fetch's buffering flag follows it, because the buffered fetch mode drains the whole body before the provider can read a byte — a streamed request that still asked for buffering would parse the same frames and hand them over all at once anyway. Tool input is accumulated from the partial-JSON deltas keyed by **content-block index**: parallel tool calls are legal (the Engine never disables them), so the single current-block slot the non-tool path uses would merge two calls into one. The empty-text guard is the existing one with a tool-calls term added, because it leans on a stop reason arriving and a tool-only round need not send one. **One pre-existing bug carried forward, not created.** The tools path never returned provider metadata, so there were no stored Gemini parts to replay and a multi-round Gemini 3 turn lost its thought signatures. Both branches now return the reconstructed parts, which the tool loop replays onto the assistant message; a tool-call part keeps its own signature rather than having it moved onto the text part. **This was not free, and the earlier design notes that called it a five-line freebie were wrong**: adding the replay meant the call-id-to-name map had to move above the replay branch, which returns early. Without that move, a tool result falls back to the literal name `tool_result`, and Gemini pairs a result to its call by name — so the model would read a reply attributed to a function nobody called. The move and a regression case that runs a genuine second round are both in this PR. ### The conservative gate, and every caller's behavior Streaming is gated on `!!options.onToken && options.stream !== false` rather than the base formula (`options.stream ?? !!options.onToken`). The difference matters for exactly one caller shape: a caller that sets a streaming flag but supplies no token sink of its own keeps its buffered path. Every `chatComplete` consumer was swept; only two pass tools at all: | Caller | Tools | Streaming intent | Effect of this PR | |---|---|---|---| | Main tool loop, `generate.routes.ts` | yes | token sink, no flag | **the target** — streams when the chat streams | | Forced final round, same file | no | token sink | unchanged (bails out with no tools) | | Per-agent tool loop, `agent-executor.ts` | yes | flag, no sink of its own | unchanged **unless** agent progress reporting is on, which injects a sink — and then the round streams. Named rather than hidden: content handed back is the same accumulated text either way, and progress reporting gains a real time-to-first-token, which is what it exists for | | Other agent-executor calls | no | either | unchanged | | Turn-game bot runner | yes | neither | unchanged | | Professor Mari's workspace agent | no (Mari uses the textual protocol) | sometimes a sink | unchanged | | The remaining ~30 call sites | no | — | unchanged | Providers that cannot do native tool calls are structurally untouched: the two subscription providers hardcode tools away and keep the base streaming path, and the local sidecar delegates to an internal OpenAI provider. The OpenAI family already streamed with tools attached and is not edited. **What this PR does not claim:** that tool calls are now cheaper than a bracket tag. They are not, on any provider — a tool round is an extra full round-trip and extra input tokens, always. What it removes is a penalty on top of that, which was an adapter gap rather than physics. The win is correctness in one beat, not efficiency. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes **The live smokes are the merge gate. Everything else is secondary.** - [ ] **Live smoke, Gemini:** on a real Gemini connection with tools attached, run one turn and confirm two things — text arrives progressively rather than all at once, and a tool call the model makes is parsed correctly and answered. Use a connection with thinking **off**; with thinking on, the turn is expected to stay buffered and proves nothing about this change. - [ ] **Live smoke, Anthropic:** the same on a real Anthropic key with tools attached — progressive text, and a correctly parsed tool call. - [ ] Manually verify a multi-round Gemini turn (the model calls a tool, reads the result, then answers) and confirm it completes rather than erroring — this is the path the thought-signature replay and the call-name map affect. - [ ] Manually verify in the browser that an ordinary turn with **no** tools attached is unchanged on both connections. - [ ] Manually verify that an agent run with tools enabled still completes normally on these connections, with and without progress reporting — that is the one caller whose behavior this PR deliberately moves. - [ ] Run `pnpm check` and confirm it exits clean. - [ ] Run `node ./scripts/run-regressions.mjs --filter provider-compat` and confirm it passes. **What the offline regression proves.** `provider-compat.regression.ts` drives both adapters against stub servers: streamed tool-call parsing per provider, a round that is nothing but a tool call, prose arriving before a tool call, tools attached but never used still streaming, the Gemini thinking carve-out staying buffered, the no-sink gate staying buffered, partial tool-argument JSON split mid-key across frames *and* across network chunks, interleaved parallel tool blocks staying bound to their own indexes, a genuine second round asserting the tool result is named for the function that produced it, two id-less calls taking distinct synthesized ids, an Anthropic tool call with no stop reason behind it, and a stub that withholds the tail of its stream until the first token lands, so a buffered read fails the assertion instead of passing quietly. Fourteen surgical reverts of the changed code were each confirmed to fail it. **What it cannot prove.** A stub proves *this parser against our own fixture* — not Google's and Anthropic's actual emission. The two riskiest unknowns are precisely the ones a stub is structurally unable to answer: whether Gemini ever splits a single tool call across frames, and whether `?alt=sse` plus tools survives a proxy path. Hence the live smokes. **Two unrelated suite failures, so they are not a surprise.** A full run of the regression suite comes back 207 of 209. Both failures reproduce identically with this PR's four files reverted to the parent commit: one gallery lane passes its own assertions and then dies removing a Windows temp directory at teardown, and the launcher format guard dies in a heap probe. Neither touches providers. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) What this PR actually does, for the reviewer to confirm against the boxes: - One CHANGELOG entry under Fixed. It carries the user-facing claim that text now arrives as the model writes it, and it names the Gemini-with-thinking exception. **That line is the reason the live smokes gate the merge** — it ships to users as release notes. - No `docs/` prose changes, so nothing to mirror on `docs-i18n`. - No version bump; no release metadata touched. ## UI evidence (if applicable) The visible difference is timing, not layout, so a screenshot cannot show it. If the live smokes are recorded, one short clip per provider of a tools-attached turn filling in progressively is the evidence worth attaching — a before/after pair is better still, since the "before" is a bubble that sits empty for the whole generation. ## Known limitations - **A stream cut mid tool-argument leaves Anthropic reporting empty arguments.** The argument parser folds truncated JSON the same way it folds invalid JSON, so a call whose arguments were half-written comes back as `{}` rather than as an error. The old buffered path failed its response parse instead, and the OpenAI streaming path keeps the truncated string. Narrow (it needs a server that closes cleanly mid-fragment) and not fixed here; a warning when a non-empty accumulation fails to parse would be the smallest honest improvement. - **The Gemini lane does not pin its own buffering flag.** Progressive delivery on Gemini was proven by hand with a tail-withholding stub, and the code is correct today because the fetch defaults to unbuffered — but a future change setting that flag on Gemini would keep the lane green while silently killing Gemini streaming. The Anthropic side has the tail-gated stub; porting it to the Gemini server is a few lines and is worth doing. - **A Gemini part carrying both text and a tool call would lose its text** on the streamed branch, where the buffered branch in the same method counts both. Gemini does not emit that shape today. - **An Anthropic tool block with an empty name** comes back with an empty name, where the OpenAI adapter would discard the call. Nit-level, pre-existing shape. - **Reconstructed parts collapse ordering** — thought text into one part, prose into one, calls appended last. This matches the existing non-tool reconstruction and only matters if a model interleaves text, then a call, then more text. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Anthropic and Gemini tool-using responses now stream text as it is generated. - Parallel and interleaved tool calls are matched to the correct tools more reliably. - Tool-only responses are handled correctly. - Interrupted or failed streaming responses now release connections properly. - Gemini thinking-enabled responses retain their existing non-streaming behavior. - Fixed a theme color transition issue affecting visual consistency. - **Documentation** - Documented live text and tool-call streaming for supported tool-using replies. <!-- end of auto-generated comment: release notes by coderabbit.ai --> ## Maintainer staging integration Updated against current `staging`; fixed both CodeRabbit findings in c61534831. Both adapters release their upstream stream on provider errors and rejected token callbacks and return `abort` for an interrupted tool turn. Six real local-HTTP cases cover those outcomes in both adapters; the cleanup case failed before the patch and the complete suite passes after it. `pnpm check`, provider compatibility, prompt and context-fit regressions pass locally. The old mobile-WebKit failure was the swipe theme assertion comparing retained Oklab transition serialization with the settled theme color. The fixture now disables only the input transition for its static color comparison, preserving all color/size/navigation assertions; the focused WebKit test passed three consecutive runs. No provider UI was changed for that fixture repair. The explicitly requested live Gemini and Anthropic smoke tests remain unverified; no paid-provider result is claimed here. The maintainer has been asked whether those have already been run or which test connections may be used. All human validation boxes remain unchecked. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:15:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6990
No description provided.