Skip to content

OAuth/Codex GPT-5.5 behaves like ~400k context while GPT-5.4 shows 1M #24561

Closed as not planned

Description

@SoyJohnXD

Description

When using OpenAI OAuth / Codex with openai/gpt-5.5, the effective context appears to behave closer to ~400k than 1M, and the UI/compaction behavior becomes inconsistent.

This looks related to closed issue #24171, but I am still reproducing the same mismatch in current OpenCode behavior.

Concrete observations:

  • With GPT-5.5 via OAuth/Codex, the UI/context behavior suggests an effective window around ~400k
  • Example: about 91k tokens showed as 23% usage, which implies a denominator around ~395k, not ~1.05M
  • In previous longer sessions, auto-compaction triggered around ~250k–260k total tokens (roughly "~300k" from user perspective), far earlier than expected for a 1M-class model
  • By contrast, GPT-5.4 appears to show the expected 1M-ish context behavior/UI

I also checked OpenCode’s local cached model metadata and both GPT-5.4 and GPT-5.5 report the same limits:

openai/gpt-5.4 -> context: 1,050,000 / input: 922,000 / output: 128,000
openai/gpt-5.5 -> context: 1,050,000 / input: 922,000 / output: 128,000

opencode/gpt-5.4 -> context: 1,050,000 / input: 922,000 / output: 128,000
opencode/gpt-5.5 -> context: 1,050,000 / input: 922,000 / output: 128,000

So this does not look like a simple stale local cache problem.

I also checked current OpenCode source behavior locally:

  • UI percentage is calculated from totalTokens / model.limit.context
  • proactive overflow / compaction uses model.limit.input - reserved

Given the metadata above, GPT-5.5 should not compact anywhere near ~250k. That makes this look like a runtime/provider-side mismatch between the metadata OpenCode thinks GPT-5.5 has and the effective Codex OAuth backend limit actually enforced.

Related issues:

Plugins

No third-party plugins required for reproduction. This was reproduced with OpenCode using OpenAI OAuth / Codex authentication.

OpenCode version

1.14.27

Steps to reproduce

  1. Authenticate OpenAI using OAuth / Codex (not API key)
  2. Start an OpenCode session with openai/gpt-5.5
  3. Let the conversation grow naturally
  4. Observe the context percentage shown in the UI and when auto-compaction happens
  5. Compare the same flow with openai/gpt-5.4

Screenshot and/or share link

No share link. Diagnosed from local observation, session behavior, cached model metadata, and source inspection.

Operating System

Linux

Terminal

OpenCode TUI on Linux using bash

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 27, 2026
  2. github-actions commented on Apr 27, 2026

    @github-actions
    Contributor

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

    If this is still occurring after #24171 was closed, it may be worth clarifying what changed (if anything) and whether the fix from that issue was released or not. You may also want to reference #24249 which describes related compaction failures after a recent upgrade.

  3. SoyJohnXD commented on Apr 27, 2026

    @SoyJohnXD
    Author

    Thanks — this does look very closely related to #24171.

    The reason I opened a new issue instead of only referencing #24171 is that I am still reproducing the behavior on OpenCode 1.14.27 with OpenAI OAuth / Codex.

    What seems worth clarifying is:

    My main reason for reporting again is that the issue does not look purely historical from my side:

    • ~91k showed as 23% usage, implying an effective window around ~395k
    • prior long sessions compacted around ~250k–260k
    • local model metadata still reports 1,050,000 context for both gpt-5.4 and gpt-5.5

    So if this is expected for Codex OAuth, the current UI / metadata / compaction signals still seem misleading. If it is not expected, then the underlying mismatch may still be present.

    Happy to move/close this if maintainers confirm it is fully covered by #24171, but I wanted to document that I can still reproduce it on the current version.

    Image
  4. void0x14 commented on Apr 27, 2026

    @void0x14

    Description

    When using OpenAI OAuth / Codex with openai/gpt-5.5, the effective context appears to behave closer to ~400k than 1M, and the UI/compaction behavior becomes inconsistent.

    This looks related to closed issue #24171, but I am still reproducing the same mismatch in current OpenCode behavior.

    Concrete observations:

    • With GPT-5.5 via OAuth/Codex, the UI/context behavior suggests an effective window around ~400k
    • Example: about 91k tokens showed as 23% usage, which implies a denominator around ~395k, not ~1.05M
    • In previous longer sessions, auto-compaction triggered around ~250k–260k total tokens (roughly "~300k" from user perspective), far earlier than expected for a 1M-class model
    • By contrast, GPT-5.4 appears to show the expected 1M-ish context behavior/UI

    I also checked OpenCode’s local cached model metadata and both GPT-5.4 and GPT-5.5 report the same limits:

    openai/gpt-5.4 -> context: 1,050,000 / input: 922,000 / output: 128,000
    openai/gpt-5.5 -> context: 1,050,000 / input: 922,000 / output: 128,000
    
    opencode/gpt-5.4 -> context: 1,050,000 / input: 922,000 / output: 128,000
    opencode/gpt-5.5 -> context: 1,050,000 / input: 922,000 / output: 128,000
    

    So this does not look like a simple stale local cache problem.

    I also checked current OpenCode source behavior locally:

    • UI percentage is calculated from totalTokens / model.limit.context
    • proactive overflow / compaction uses model.limit.input - reserved

    Given the metadata above, GPT-5.5 should not compact anywhere near ~250k. That makes this look like a runtime/provider-side mismatch between the metadata OpenCode thinks GPT-5.5 has and the effective Codex OAuth backend limit actually enforced.

    Related issues:

    Plugins

    No third-party plugins required for reproduction. This was reproduced with OpenCode using OpenAI OAuth / Codex authentication.

    OpenCode version

    1.14.27

    Steps to reproduce

    1. Authenticate OpenAI using OAuth / Codex (not API key)
    2. Start an OpenCode session with openai/gpt-5.5
    3. Let the conversation grow naturally
    4. Observe the context percentage shown in the UI and when auto-compaction happens
    5. Compare the same flow with openai/gpt-5.4

    Screenshot and/or share link

    No share link. Diagnosed from local observation, session behavior, cached model metadata, and source inspection.

    Operating System

    Linux

    Terminal

    OpenCode TUI on Linux using bash

    I'm experiencing the same issue, but I'm using OpenCode via 9Router with OAuth. When I reached around 240K tokens, it started throwing the error: "Error: Your input exceeds the context window of this model. Please adjust your input and try again." It didn’t resolve until I set it to compact. However, the context window is set to 1M in the config file, so it shouldn’t be doing this. It hadn’t been doing this for days, but it started today.

    Image Image Image
  5. rekram1-node commented on Apr 27, 2026

    @rekram1-node
    Collaborator

    When using gpt-5.5 through oauth it has a context window of 400k NOT 1M like api does (FOR NOW AT LEAST).

    Context at 400k means the input limit is 272k, so opencode will compact a bit before then in some cases to ensure that there is enough space to compact

  6. SAIL-Fang commented on Apr 27, 2026

    @SAIL-Fang

    I was able to use the 1M context window a few days ago, what happened?

    Image
  7. SAIL-Fang commented on Apr 27, 2026

    @SAIL-Fang

    Well it looks like there was a problem before, now it's fixed

    Image https://openai.com/index/introducing-gpt-5-5/
  8. void0x14 commented on Apr 27, 2026

    @void0x14

    When using gpt-5.5 through oauth it has a context window of 400k NOT 1M like api does (FOR NOW AT LEAST).

    Context at 400k means the input limit is 272k, so opencode will compact a bit before then in some cases to ensure that there is enough space to compact

    Yes, I realized this terrible situation later. Also, the GPT 5.5 used up my data allowance like water. It consumes far too much power for its performance and is truly a terrible model. Therefore, I reverted to the GPT 5.4 High and I have no problems for now.

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions