You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: Go - Error 400 - Gemini 4 Argon - Requests ending with a model turn are not supported #64628
Gemini 4 Argon in OpenCode Go subscription for some reason is not usable for me
I searched for similar issues but they were not specific to Model Turn error
I have no idea what does this error mean at all
Plugins
None
OpenCode version
2.3.2
Steps to reproduce
Start a new empty session / Change model in any session to Gemini 4 Argon
Prompt anything
Wait a while
Gemini 4 Argon sends out an 400 error for Model Turn
Thanks for the report. I tried to reproduce this on OpenCode 2.3.2 but couldn't confirm it without a real OpenCode Go account, which I don't have here.
What I checked: I sent OpenCode's Gemini requests to a local mock server that answers like Gemini and recorded the shape of every request. I tried several cases: a plain prompt in a new session, a tool call followed by its continuation, a reasoning-only reply, a reply cut off at the output limit, an empty reply, a stream that stops early (which OpenCode retries), server errors, and a second prompt in the same session. Every request OpenCode sent ended on a user turn. The error you see means Gemini received a request that ends on a model turn, so none of these cases triggered it. I also used the CLI rather than the desktop app.
A maintainer with a Go subscription will need to look at this. A few details would help them:
Does it fail on the very first reply, or only after the model has run some tools (the "wait a while" step)?
Does it also happen with gemini-4-argon-contributor, or with the CLI (opencode run -m opencode-go/gemini-4-argon "hi")?
The server log lines around the error. In other V2 reports the log was at ~/.local/share/opencode/log/opencode.log. Please remove anything private before posting.
Related: #55694 shows the same Gemini error on V2 through OpenRouter, where it happens right after the read tool returns an image. If your prompt makes the model read images, it may be the same cause.
It does some reads and tool calls then stops, never produced any output
The model ID in console is: gemini-4-argon, I see no gemini-4-argon-contributor for OpenCode Go subscription
Logs:
timestamp: 2026-11-18T09:51:36.154Z
level: ERROR
run: b5f7e443
role: server
sessionID: ses_e11ef4596ffeIwetyCDhF64WjZ
message: Failed to drain Session
cause:
AI.Error: Upstream request failed: [400]
Requests ending with a model turn are not supported.
Stack trace:
at Hpe (/$bunfs/root/chunk-anztkf4c.js:3:3000)
at <anonymous> (/$bunfs/root/chunk-anztkf4c.js:3:2692)
at SessionStep.attempt (/$bunfs/root/chunk-4w17r1gc.js:493:4020)
at SessionStep.attempt (definition) (/$bunfs/root/chunk-4w17r1gc.js:478:304)
at SessionRunner.runStep (/$bunfs/root/chunk-4w17r1gc.js:493:2914)
at SessionRunner.runStep (definition) (/$bunfs/root/chunk-4w17r1gc.js:493:3114)
at SessionRunner.drain (/$bunfs/root/chunk-4w17r1gc.js:493:6653)
at SessionRunner.drain (definition) (/$bunfs/root/chunk-4w17r1gc.js:493:438)
at ServerProcess.start (/$bunfs/root/chunk-ajf736hz.js:3:6119)
at ServerProcess.start (definition) (/$bunfs/root/chunk-4w17r1gc.js:595:37325)
[cause]:
AI.Error.InvalidRequest: Upstream request failed: [400]
Requests ending with a model turn are not supported.
Stack trace:
at uu (/$bunfs/root/chunk-anztkf4c.js:3:1230)
at Hpe (/$bunfs/root/chunk-anztkf4c.js:3:3011)
at <anonymous> (/$bunfs/root/chunk-anztkf4c.js:3:2692)
My failed request IDs that shown in the screenshot are:
Thanks for the request IDs, they helped a lot. Both reached Google, and Google rejected them immediately because the conversation OpenCode sent ended on the model's turn. In your session, it happens on the request right after a round of tool calls.
To find out why those tool results were missing, could you send us the session export? From a terminal:
Please email session.json, along with ~/.local/share/opencode/log/opencode.log from around the time of the failure, to [email protected] rather than posting them here, since they contain your conversation and file contents. If you'd rather redact them first, --sanitize removes transcript and file data, but the full export is more useful to us.
We're also adding a fix so Gemini requests can't end on a model turn.
Unfortunately I've undid the messages on that session and started from zero, so the session log is lost but kept those errors too in the log report file for you
I started a new session and reproduced the error and exported that with request id of 01a1ee6d-d478-7827-ab6a-7d4f6d947882
Sent those files to the provided email address
Activity
opencodejr commentedon Nov 18, 2026
Thanks for the report. I tried to reproduce this on OpenCode 2.3.2 but couldn't confirm it without a real OpenCode Go account, which I don't have here.
What I checked: I sent OpenCode's Gemini requests to a local mock server that answers like Gemini and recorded the shape of every request. I tried several cases: a plain prompt in a new session, a tool call followed by its continuation, a reasoning-only reply, a reply cut off at the output limit, an empty reply, a stream that stops early (which OpenCode retries), server errors, and a second prompt in the same session. Every request OpenCode sent ended on a user turn. The error you see means Gemini received a request that ends on a model turn, so none of these cases triggered it. I also used the CLI rather than the desktop app.
A maintainer with a Go subscription will need to look at this. A few details would help them:
gemini-4-argon-contributor, or with the CLI (opencode run -m opencode-go/gemini-4-argon "hi")?~/.local/share/opencode/log/opencode.log. Please remove anything private before posting.Related: #55694 shows the same Gemini error on V2 through OpenRouter, where it happens right after the
readtool returns an image. If your prompt makes the model read images, it may be the same cause.amirsaam commentedon Nov 18, 2026
gemini-4-argon, I see nogemini-4-argon-contributorfor OpenCode Go subscriptionMy failed request IDs that shown in the screenshot are:
1:
01a1ee25-6e5e-7708-afcf-eeb3c81cf6d72:
01a1ee11-a3a6-7e92-838a-20c619f5f5ebMaybe this could help.
opencode-agent commentedon Nov 18, 2026
Thanks for the request IDs, they helped a lot. Both reached Google, and Google rejected them immediately because the conversation OpenCode sent ended on the model's turn. In your session, it happens on the request right after a round of tool calls.
To find out why those tool results were missing, could you send us the session export? From a terminal:
Please email
session.json, along with~/.local/share/opencode/log/opencode.logfrom around the time of the failure, to [email protected] rather than posting them here, since they contain your conversation and file contents. If you'd rather redact them first,--sanitizeremoves transcript and file data, but the full export is more useful to us.We're also adding a fix so Gemini requests can't end on a model turn.
amirsaam commentedon Nov 18, 2026
Unfortunately I've undid the messages on that session and started from zero, so the session log is lost but kept those errors too in the log report file for you
I started a new session and reproduced the error and exported that with request id of
01a1ee6d-d478-7827-ab6a-7d4f6d947882Sent those files to the provided email address
neriousy commentedon Nov 18, 2026
Thanks for sending the files over!
One quick question: did you have a goal running in those sessions (the
/goalcommand) when the error showed up?amirsaam commentedon Nov 18, 2026
@neriousy no i don't have any plugin nor a goal command used anywhere
p.s: no problem, my pleasure.