anomalyco / anomalyco/opencode
Requests ending with a model turn are not supported
Open
@rekram1-node is already working on this.
Since Aug 26, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Provider: Google Gemini API (AI Studio)
Model: Gemini 3.7 Flash
issue: Requests ending with a model turn are not supported
happens when the model is usually overloaded, and opencode's internal retry mechanism doesn't handle this edge case.
When does it happen? after the model finishes thinking.
Since when was this happening? Ver. 1.18.21 or above
Plugins
No
OpenCode version
1.18.23
Steps to reproduce
- Choose Google Gemini API, Use any gemini model (we'll choose gemini 3.7 flash)
- Try to normally user the model
- You'll observe after a few turns, the exact issue: Bad Request: {"detail":{"error":{"code":400,"message":"Requests ending with a model turn are not supported.","status":"INVALID_ARGUMENT"}}}
- You'lll again have to input prompt to be able to continue
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.