Repository navigation
Add a configurable reasoning_effort for opencode models - #85
Merged
Merged
Conversation
GLM-5.3 on OpenCode Go reasons like `max` when no effort is sent: one call spent 16k tokens reasoning and the next exhausted the whole 32k max_tokens budget on reasoning alone, ending with no content or tool call. The gateway accepts the standard `reasoning_effort` field (none/low/medium/high/max). `reasoning_effort` resolves like `max_tokens`: [main]/[worker] entry -> top-level -> unset. It is sent on the OpenAI-protocol opencode/opencode-go paths; claude-* and every other provider ignore it with a warning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GLM-5.3 on OpenCode Go reasons like
maxwhen no effort is sent. In a live run onecall spent 16k tokens reasoning and the next spent the entire 32k max_tokens budget on
reasoning (finish_reason=length, no content, no tool call): ~4.6 minutes wasted.
OpenCode's docs don't mention it, but the gateway accepts the standard
reasoning_effortfield (none/low/medium/high/max; unknown values 400).Change
reasoning_effortin agents.toml, resolved likemax_tokens:[main]/[worker]entry → top-level → unset (nothing sent).opencode:/opencode-go:paths (Chat Completions andResponses);
claude-*and all other providers ignore it with a warning.Testing
lint, typecheck,
./scripts/test.shpass (310). New tests cover parsing, resolverthreading, the request payload, and the ignored-provider warning. Live-checked
opencode-go:glm-5.3withhighthroughbuild_model.