Skip to content

Model-ID version gate excludes dotless IDs, so gpt-6-astra is treated as older than gpt-5.5 #48247

Closed as not planned

Description

@marcusrbrown

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", but OPENAI_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 (gpt5ChatReasoningEfforts returns [] 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

  1. Pick a model ID with no dotted minor — gpt-6-astra or gpt-5-pro.
  2. Evaluate the conditions at transform.ts:1331 and :1340 against it.
  3. isGpt55OrNewer is false for GPT-6, so the Azure early-return at :1333 sets reasoningEffort: "medium" where the comment says it should not.
  4. The :1340 block is skipped, so textVerbosity: "low" never applies.
  5. 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

  1. github-actions commented on Sep 9, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • This issue does not use one of the required issue templates (Bug Report, Feature Request, or Question). Please re-submit or edit the issue using the appropriate template — in this case, the Bug Report template.

    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.

  2. added
    needs:complianceThis means the issue will auto-close after 2 hours.
    and removed
    needs:complianceThis means the issue will auto-close after 2 hours.
    on Sep 9, 2026
  3. github-actions commented on Sep 9, 2026

    @github-actions
    Contributor

    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.

  4. added a commit that references this issue on Sep 10, 2026
    bdfda6e
  5. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions