Repository navigation
Description
Description
packages/opencode/src/provider/transform.ts:1331 reads a model's version with a regex that requires a dotted minor:
const [, gptMajorVersion, gptMinorVersion] = input.model.api.id.match(/gpt-(\d+)\.(\d+)/) ?? []
const isGpt55OrNewer = Number(gptMajorVersion) > 5 || (Number(gptMajorVersion) === 5 && Number(gptMinorVersion) >= 5)gpt-6-astra has no dotted minor, so the match fails and Number(undefined) > 5 evaluates NaN > 5. A GPT-6 model reports isGpt55OrNewer === false. gpt-5-pro fails the same regex.
The only consumer of that flag is the Azure early-return at :1333-1338, and the comment above it says "Any gpt version above 5.4 in combination with azure does not support reasoningEffort". So on Azure + useCompletionUrls, GPT-6 currently gets reasoningEffort: "medium" set precisely where the code intends to skip it.
Separately at :1340, "gpt-6-astra".includes("gpt-5") is false, so that block is skipped and textVerbosity: "low" never applies.
gpt-6-astra regexMatch=false isGpt55OrNewer=false entersBlock1340=false
gpt-5.6-luna regexMatch=true isGpt55OrNewer=true entersBlock1340=true
gpt-5-pro regexMatch=false isGpt55OrNewer=false entersBlock1340=true
Suggested fix
Correcting the regex alone is safe and fixes the Azure path. Version-gating :1340 naively is not — the block contains four interlocking substring tests, and today gpt-6-pro / gpt-6-chat / gpt-6-codex are excluded only as a side effect of the outer includes("gpt-5") being false. Generalize just the outer test and they all fall in while includes("gpt-5-pro") and includes("gpt-5-chat") stay false:
gpt-6-pro→reasoningEffort: "medium", butOPENAI_GPT5_PRO_EFFORTS = ["high"]at:577— an out-of-range effort rather than a lost optimization.gpt-6-chat→ reasoning params on a model the file deliberately treats as non-reasoning (gpt5ChatReasoningEffortsreturns[]at:619).
All four tests need to move together, or none.
Note also that fixing the regex does not by itself restore textVerbosity for Astra: :1359 gates on includes("gpt-5."), and "gpt-6-astra" does not contain that either. And includes("gpt-5.") currently means "has an explicit minor" — generalizing it so a minor-less GPT-6 id qualifies is a deliberate behavior change worth arguing separately.
Rather than adding a second parser, this file already has anchored helpers at :594-609 used by variants():
const GPT5_FAMILY_RE = /(?:^|\/)gpt-5(?:[.-]|$)/
const GPT5_VERSION_RE = /(?:^|\/)gpt-5[.-](\d+)(?:[.-]|$)/
const GPT5_PRO_RE = /(?:^|\/)gpt-5[.-]?pro(?:[.-]|$)/options() is the odd one out, hand-rolling substring tests and an unanchored inline regex. Generalizing those helpers to be family-agnostic and reusing them in options() seems like the right shape. The (?:^|\/) anchors matter — a bare /gpt-(\d+)/ reads gpt-50 as major 50.
Any test matrix should include gpt-6-pro, gpt-6-chat, gpt-6-codex, and gpt-50, since those are exactly the ids a partial fix breaks.
Plugins
@cortexkit/[email protected], @cortexkit/[email protected], [email protected], @cortexkit/[email protected], @cortexkit/[email protected], [email protected], @fro.bot/[email protected]
OpenCode version
1.18.29, confirmed present at v1.18.30
Steps to reproduce
- Pick a model ID with no dotted minor —
gpt-6-astraorgpt-5-pro. - Evaluate the conditions at
transform.ts:1331and:1340against it. isGpt55OrNewerisfalsefor GPT-6, so the Azure early-return at:1333setsreasoningEffort: "medium"where the comment says it should not.- The
:1340block is skipped, sotextVerbosity: "low"never applies. - Repeat with
gpt-5.6-luna— both pass.
Screenshot and/or share link
n/a
Operating System
macOS 15.7.9 (arm64)
Terminal
Ghostty
Activity
github-actions commentedon Sep 9, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Sep 9, 2026
Thanks for updating the issue! The bug report is clear, well-structured, and includes all the necessary detail — code references, a reproduction trace, version info, and a suggested fix. Everything looks good now.
fix(provider): parse dotless gpt major versions in transform gate
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊