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
Copilot Opus 5.5: thinking uses the whole 32k output cap, turn ends silently with finish=length and no answer #54269
With github-copilot/claude-opus-5.5, a complex prompt makes the model think for ~6 minutes and then the turn ends with no text, no tool call and no error. The session just goes idle.
Cause: the output cap leaves no room for an answer after the thinking.
maxOutputTokens() caps every request at OUTPUT_TOKEN_MAX = 32_000 (packages/opencode/src/provider/transform.ts), although the model reports limit.output = 128000.
Copilot Opus 5.5 variants use adaptive thinking (thinking: { type: "adaptive" }, effort) with no thinking budget (packages/opencode/src/plugin/github-copilot/models.ts). So thinking can use the whole 32k.
When it does, the provider returns finish: "length" with 0 output tokens.
The prompt loop treats any finish other than tool-calls/unknown as done (packages/opencode/src/session/prompt.ts, "exiting loop"). length with an empty answer is not reported to the user and not retried.
Evidence (two consecutive turns in one session, read from opencode.db):
variant
duration
finish
reasoning tokens
output tokens
error
high
362 s
length
32000
0
none
medium
364 s
length
32000
0
none
Each message contains only step-start, a reasoning part (~36-39k chars) and step-finish. Reasoning is exactly the cap in both turns, and lowering the effort to medium did not prevent it.
Expected
Leave room for the answer: send a larger max_tokens when the model supports it (128k here), or give adaptive thinking a budget below the cap.
If a turn still ends with finish: "length" and no text or tool call, show an error (or retry) instead of ending the turn silently.
Plugins
None relevant
OpenCode version
1.18.35
Steps to reproduce
Select github-copilot/claude-opus-5.5, variant high or medium.
Give a large open-ended task (e.g. "create a procedural 3D city project with vehicles and drones").
Wait: the spinner shows thinking for ~6 minutes, then the session goes idle with no reply and no error.
Inspect the assistant message: finish: "length", tokens.reasoning: 32000, tokens.output: 0.
Thanks for the detailed report and the session data. It makes the cause easy to follow.
This is on OpenCode 1.18.35, which is v1. v1 only gets fixes for critical bugs (data loss, security problems, or crashes and breakage with no workaround), so this is unlikely to be fixed there. Some things you could try on v1:
Raise the cap with the OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX environment variable (e.g. 64000 or 128000) so the model has room to answer after it finishes thinking.
Try a lower-effort variant than medium.
We'd encourage upgrading to v2 (@opencode/cli, the opencode command). There the general output cap is 256k instead of 32k, and Copilot models get adaptive thinking or a thinking budget based on the limits the model reports. v2 can still end a turn silently when it stops at the output limit (finish: "length") without any text or tool call. That is tracked here:
Closing this as not planned. It was reported on v1 (1.18.35), which only gets fixes for critical bugs, and we haven't heard that it's critical or that it also happens on v2. Thanks again for the detailed analysis.
On v1, setting OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX higher than 32000 should leave room for an answer after the thinking. On v2, the silent finish: "length" turn with no output is tracked in #50949, and PR #51741 is open for it. If you hit this on v2, please add your details there or open a new issue with the v2 version.
Activity
opencode-agent commentedon Oct 10, 2026
Thanks for the detailed report and the session data. It makes the cause easy to follow.
This is on OpenCode 1.18.35, which is v1. v1 only gets fixes for critical bugs (data loss, security problems, or crashes and breakage with no workaround), so this is unlikely to be fixed there. Some things you could try on v1:
OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAXenvironment variable (e.g.64000or128000) so the model has room to answer after it finishes thinking.medium.We'd encourage upgrading to v2 (
@opencode/cli, theopencodecommand). There the general output cap is 256k instead of 32k, and Copilot models get adaptive thinking or a thinking budget based on the limits the model reports. v2 can still end a turn silently when it stops at the output limit (finish: "length") without any text or tool call. That is tracked here:finish: "length"with no usable output is treated as a success with no error. A comment there covers the case where only reasoning comes back. PR fix(core): fail length finishes that return no content #51741 is open to address it.If you think this is critical, or you can reproduce it on v2, please reply here with the v2 version and we'll take another look.
rekram1-node commentedon Oct 10, 2026
Recommend updating to v2, we will backport changes to v1 for this but this is NOT an issue on v2:
https://opencode.ai/v2/docs
opencode-agent commentedon Oct 11, 2026
Closing this as not planned. It was reported on v1 (1.18.35), which only gets fixes for critical bugs, and we haven't heard that it's critical or that it also happens on v2. Thanks again for the detailed analysis.
On v1, setting
OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAXhigher than 32000 should leave room for an answer after the thinking. On v2, the silentfinish: "length"turn with no output is tracked in #50949, and PR #51741 is open for it. If you hit this on v2, please add your details there or open a new issue with the v2 version.