Codex: default vs selected variants show different effective context; support per-variant limits #8677

Closed
opened 2026-02-16 18:10:33 -05:00 by yindo · 2 comments
Owner

Originally created by @HyunggyuJang on GitHub (Feb 5, 2026).

Originally assigned to: @thdxr on GitHub.

Summary

Observed behavior suggests default Codex and selected variants can have different effective context limits.

Observation

For openai/gpt-5.3-codex:

  • With default settings (no variant selected), effective context can exceed ~272k.
  • When explicitly selecting variants like high / medium, effective context appears capped around ~272k.

This makes default vs selected variants behave differently in practice.

Reference comment in #7705:
https://github.com/anomalyco/opencode/issues/7705#issuecomment-3857857480

Request

Please consider supporting per-variant limit configuration (or equivalent behavior) so users can express this explicitly.

Example config shape:

{
  "provider": {
    "openai": {
      "models": {
        "gpt-5.3-codex": {
          "limit": { "context": 400000, "output": 128000 },
          "variants": {
            "high": {
              "reasoningEffort": "high",
              "limit": { "context": 272000, "output": 128000 }
            }
          }
        }
      }
    }
  }
}

Even if internals normalize limits differently, allowing variant-level declaration (or rejecting unsupported keys with a clear error) would reduce confusion.

Originally created by @HyunggyuJang on GitHub (Feb 5, 2026). Originally assigned to: @thdxr on GitHub. ### Summary Observed behavior suggests default Codex and selected variants can have different effective context limits. ### Observation For `openai/gpt-5.3-codex`: - With default settings (no variant selected), effective context can exceed ~272k. - When explicitly selecting variants like `high` / `medium`, effective context appears capped around ~272k. This makes default vs selected variants behave differently in practice. Reference comment in #7705: https://github.com/anomalyco/opencode/issues/7705#issuecomment-3857857480 ### Request Please consider supporting **per-variant limit configuration** (or equivalent behavior) so users can express this explicitly. Example config shape: ```jsonc { "provider": { "openai": { "models": { "gpt-5.3-codex": { "limit": { "context": 400000, "output": 128000 }, "variants": { "high": { "reasoningEffort": "high", "limit": { "context": 272000, "output": 128000 } } } } } } } } ``` Even if internals normalize limits differently, allowing variant-level declaration (or rejecting unsupported keys with a clear error) would reduce confusion.
yindo closed this issue 2026-02-16 18:10:33 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 5, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #7705: Default Codex context length not matching Pro plan (directly referenced in this issue)
  • #11086: GPT 5.2 Codex - Compaction happens way too early and context limit is wrong
  • #8140: Feature Request: Configurable context limit and auto-compaction threshold
  • #11286: Model context limits not respected
  • #12169: Subtle bug: model.variants can be unintentionally overwritten when ProviderTransform.variants() returns {}

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 5, 2026): This issue might be a duplicate of existing issues. Please check: - #7705: Default Codex context length not matching Pro plan (directly referenced in this issue) - #11086: GPT 5.2 Codex - Compaction happens way too early and context limit is wrong - #8140: Feature Request: Configurable context limit and auto-compaction threshold - #11286: Model context limits not respected - #12169: Subtle bug: model.variants can be unintentionally overwritten when ProviderTransform.variants() returns {} Feel free to ignore if none of these address your specific case.
Author
Owner

@HyunggyuJang commented on GitHub (Feb 7, 2026):

Closing this as my report appears incorrect.

I traced this to model metadata in pi-mono:
https://github.com/badlogic/pi-mono/blob/f9161c4d4e0d001ebfbd3ba98f0b89adb253260a/packages/ai/src/models.generated.ts#L5099

It looks like ChatGPT subscription-backed Codex models are already constrained (roughly 272k input / 128k output) regardless of selected variant, so the default-vs-variant interpretation here was likely mistaken.

Sorry for the noise.

@HyunggyuJang commented on GitHub (Feb 7, 2026): Closing this as my report appears incorrect. I traced this to model metadata in pi-mono: https://github.com/badlogic/pi-mono/blob/f9161c4d4e0d001ebfbd3ba98f0b89adb253260a/packages/ai/src/models.generated.ts#L5099 It looks like ChatGPT subscription-backed Codex models are already constrained (roughly 272k input / 128k output) regardless of selected variant, so the default-vs-variant interpretation here was likely mistaken. Sorry for the noise.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8677