mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5918] Attaching any tool silently stops streaming on Gemini and Anthropic connections #3273
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3273
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Sep 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5918
Originally assigned to: @kolacheee on GitHub.
When any tool is attached to a generation, the Gemini and Anthropic adapters silently
stop streaming: the whole reply is buffered and arrives at once, on every turn of any
chat with tools enabled — not just turns that actually call a tool. The user watches an
empty bubble for the full generation time.
Where it is. The Gemini adapter takes the non-streaming
generateContentendpointwhenever tools are present (
packages/server/src/services/llm/providers/google.provider.ts:578-581,with a single
onTokenat the end), and the Anthropic adapter hardcodesstream: falsein its tools branch (
anthropic.provider.ts:386). Neither provider's API requires this —both stream tool calls natively — and the OpenAI-compatible adapter already streams with
tools attached. The generation loop itself streams round-one prose live through
onTokenand never passes a
streamflag, so nothing route-side forces the buffering either.Why it matters. Tool use is about to become a normal part of Game Mode (the GM rolling
real dice), and today the price of enabling it on the two most common connection kinds is
losing live streaming everywhere. Time-to-first-token is the whole feel of a streaming
chat; a feature that silently trades it away chat-wide will read as "the app got slower"
with no visible cause.
The smallest honest fix is to implement the streaming path inside each adapter's
tools-aware completion (mirroring the OpenAI adapter's shape: stream when a token
callback is present unless the caller explicitly opted out), leaving untouched the
deliberate exception where Gemini with reasoning enabled stays buffered for the proxy
reason #5904 covers. PR to follow.
@SpicyMarinara commented on GitHub (Sep 8, 2026):
Maintainer follow-up: @SpicyMarinara (Codex) is addressing CI and CodeRabbit findings on the existing @kolacheee PR #5920, then validating it for staging. The live-provider verification requirement is being checked separately; no live API results are claimed yet.