Skip to content

GPT 5.2 Codex - Compaction happens way too early and context limit is wrong #11086

Closed

Description

@Simplereally

Description

GPT 5.2 Codex via Copilot is compacting at 100k tokens when the model's context is 272k.

Plugins

None

OpenCode version

latest

Steps to reproduce

  1. Use gpt-5.2-codex via github copilot
  2. Context in top right indicates max 100k when it is actually 272k
  3. Reach ~90k+ tokens in session and compaction happens

Screenshot and/or share link

Image

Operating System

Windows 10 latest

Terminal

Windows Terminal

Activity

  1. github-actions commented on Jan 29, 2026

    @github-actions
    Contributor

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

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

  2. Deftera186 commented on Jan 29, 2026

    @Deftera186

    This is probably related to a problem in models.dev that was fixed 2 weeks ago:
    anomalyco/models.dev@b0e5b91

    maybe you still have the old cache for some reason? try to remove your ~/.cache/opencode/models.json and update if it helps

  3. Waishnav commented on Jan 29, 2026

    @Waishnav

    Yup, they have fixed this issue. It is working all fine

  4. dlukt commented on Feb 5, 2026

    @dlukt

    Nope. Deleting ~/.cache/opencode/models.json does not fix it.

    49,590  39% ($0.00)
    v1.1.51
    

    50k tokens and already 39% context used.

    grep github-copilot/gpt-5.2 ~/.cache/opencode/models.json
    

    No results.

    The search for github-copilot in this repo reveals no results either.

    How can you greatly announce your partnership when you don't even do the basics?

  5. dlukt commented on Feb 5, 2026

    @dlukt

    The issue is most likely because you source https://models.dev/api.json
    which incorrectly states the limits for context and output to 128k and 64k

    I'm letting OpenAI/gpt-5.2 now fix this issue and will send a PR

  6. dlukt commented on Feb 5, 2026

    @dlukt
    "provider": {
        "github-copilot": {
          "models": {
            "gpt-5.2": {
              "limit": {
                "context": 400000,
                "input": 272000,
                "output": 128000
              }
            },
            "gpt-5.2-codex": {
              "limit": {
                "context": 400000,
                "input": 272000,
                "output": 128000
              }
            }
          }
        },
        "github-copilot-enterprise": {
          "models": {
            "gpt-5.2": {
              "limit": {
                "context": 400000,
                "input": 272000,
                "output": 128000
              }
            },
            "gpt-5.2-codex": {
              "limit": {
                "context": 400000,
                "input": 272000,
                "output": 128000
              }
            }
          }
        }
      }
    }
    
  7. github-actions commented on Apr 7, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions