anomalyco / anomalyco/opencode

Requests ending with a model turn are not supported

Open
#45,359 3 comments 0 reactions 1 assignee View on GitHub

@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
  1. Choose Google Gemini API, Use any gemini model (we'll choose gemini 3.7 flash)
  2. Try to normally user the model
  3. 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"}}}
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.