Description
V2 sends Bedrock Converse requests without inferenceConfig.maxTokens, even when the model config sets limit.output: 128000. The prepared model request only carries generation values set by hooks/context, so the resolved limit never reaches the provider and Bedrock applies a much lower implicit budget.
With adaptive thinking (reasoningConfig: adaptive, effort xhigh), reasoning and text share that budget. Long-thinking turns finish as max_tokens at exactly 4096 output tokens, often reasoning-only with no visible text.
Captured request (via a session.hook("http.request") plugin, sanitized): additionalModelRequestFields.thinking is present, inferenceConfig is absent:
{
"url": "https://bedrock-runtime.us-east-1.amazonaws.com/model/global.anthropic.claude-fable-5/converse-stream",
"modelId": "global.anthropic.claude-fable-5",
"inferenceConfig": null,
"additionalModelRequestFields": { "thinking": { "type": "adaptive", "display": "summarized" }, "output_config": { "effort": "xhigh" } }
}
Auditing ~1,500 sessions across two workspaces: 1,098 assistant turns finished max_tokens at exactly 4,096 output tokens; 552 of them contained reasoning only.
The Bedrock protocol already serializes generation.maxTokens as inferenceConfig.maxTokens; it just never receives a value. I have a fix ready (projects resolved.limit.output into the request with hook/model/route defaults taking precedence) and will open a PR.
Plugins
opencode-bedrock-rotate (bearer token rotation; not related, reproduced with it failing to load)
OpenCode version
0.0.0-beta-18743, also reproduced on 0.0.0-dev-18806
Steps to reproduce
- Configure a Bedrock Claude model with
limit.output: 128000 and an adaptive reasoning variant.
- Log outgoing requests with a plugin hooked on
session.hook("http.request").
- The request has no
inferenceConfig; turns with long reasoning truncate at 4096 output tokens.
Description
V2 sends Bedrock Converse requests without
inferenceConfig.maxTokens, even when the model config setslimit.output: 128000. The prepared model request only carries generation values set by hooks/context, so the resolved limit never reaches the provider and Bedrock applies a much lower implicit budget.With adaptive thinking (
reasoningConfig: adaptive, effortxhigh), reasoning and text share that budget. Long-thinking turns finish asmax_tokensat exactly 4096 output tokens, often reasoning-only with no visible text.Captured request (via a
session.hook("http.request")plugin, sanitized):additionalModelRequestFields.thinkingis present,inferenceConfigis absent:{ "url": "https://bedrock-runtime.us-east-1.amazonaws.com/model/global.anthropic.claude-fable-5/converse-stream", "modelId": "global.anthropic.claude-fable-5", "inferenceConfig": null, "additionalModelRequestFields": { "thinking": { "type": "adaptive", "display": "summarized" }, "output_config": { "effort": "xhigh" } } }Auditing ~1,500 sessions across two workspaces: 1,098 assistant turns finished
max_tokensat exactly 4,096 output tokens; 552 of them contained reasoning only.The Bedrock protocol already serializes
generation.maxTokensasinferenceConfig.maxTokens; it just never receives a value. I have a fix ready (projectsresolved.limit.outputinto the request with hook/model/route defaults taking precedence) and will open a PR.Plugins
opencode-bedrock-rotate (bearer token rotation; not related, reproduced with it failing to load)
OpenCode version
0.0.0-beta-18743, also reproduced on 0.0.0-dev-18806
Steps to reproduce
limit.output: 128000and an adaptive reasoning variant.session.hook("http.request").inferenceConfig; turns with long reasoning truncate at 4096 output tokens.