Description
OpenCode supports GPT-5.6 models with reasoning.effort: "max", but the current fix appears to work only for model metadata loaded from models.dev.
When the same model is defined manually in opencode.json, OpenCode exposes a max variant but does not bind it to reasoningEffort: "max". Selecting max then sends medium instead.
Environment
Configuration
Steps To Reproduce
- Configure a GPT-5.6 model manually in
opencode.json.
- Add
max to reasoning_options.
- Add an empty
max entry under variants.
- Select the
max reasoning variant.
- Inspect the outgoing request or the upstream provider request log.
Expected Behavior
The outgoing OpenAI Responses request should contain:
{
"reasoning": {
"effort": "max"
}
}
Actual Behavior
The max variant appears in the local configuration, but an empty variant does not generate the corresponding reasoning option. The request is sent with medium instead. high and xhigh work correctly.
An explicit variant configuration does work as a workaround:
"max": {
"reasoningEffort": "max"
}
Suspected Cause
PR #36543 adds reasoning_options handling for models loaded from models.dev: fromModelsDevModel() copies the field and reasoningVariants() derives variants from it.
However, the local opencode.json provider model path rebuilds parsedModel without copying model.reasoning_options. It then falls back to ProviderTransform.variants(parsedModel), whose GPT-5.6 fallback does not include max.
The relevant path appears to be packages/opencode/src/provider/provider.ts around lines 1417-1505. The local variants merge preserves max: {}, but does not attach { reasoningEffort: "max" }.
Related Issues And PR
Description
OpenCode supports GPT-5.6 models with
reasoning.effort: "max", but the current fix appears to work only for model metadata loaded frommodels.dev.When the same model is defined manually in
opencode.json, OpenCode exposes amaxvariant but does not bind it toreasoningEffort: "max". Selectingmaxthen sendsmediuminstead.Environment
@ai-sdk/openai/v1endpointgpt-5.6-lunaConfiguration
{ "provider": { "openai-b1": { "id": "openai-b1", "npm": "@ai-sdk/openai", "options": { "baseURL": "https://example.invalid/v1", "apiKey": "REDACTED" }, "models": { "gpt-5.6-luna": { "id": "gpt-5.6-luna", "reasoning": true, "reasoning_options": [ { "type": "effort", "values": ["none", "low", "medium", "high", "xhigh", "max"] } ], "variants": { "low": {}, "medium": {}, "high": {}, "xhigh": {}, "max": {} } } } } } }Steps To Reproduce
opencode.json.maxtoreasoning_options.maxentry undervariants.maxreasoning variant.Expected Behavior
The outgoing OpenAI Responses request should contain:
{ "reasoning": { "effort": "max" } }Actual Behavior
The
maxvariant appears in the local configuration, but an empty variant does not generate the corresponding reasoning option. The request is sent withmediuminstead.highandxhighwork correctly.An explicit variant configuration does work as a workaround:
Suspected Cause
PR #36543 adds
reasoning_optionshandling for models loaded frommodels.dev:fromModelsDevModel()copies the field andreasoningVariants()derives variants from it.However, the local
opencode.jsonprovider model path rebuildsparsedModelwithout copyingmodel.reasoning_options. It then falls back toProviderTransform.variants(parsedModel), whose GPT-5.6 fallback does not includemax.The relevant path appears to be
packages/opencode/src/provider/provider.tsaround lines 1417-1505. The localvariantsmerge preservesmax: {}, but does not attach{ reasoningEffort: "max" }.Related Issues And PR
maxreasoning effort variantmaxfor GPT-5.6