Skip to content

stuck at "100% context left" for local models #5775

Closed

Description

@teub

What version of Codex is running?

0.50.0

What subscription do you have?

local model

Which model were you using?

gpt-oss-20b

What platform is your computer?

Linux 6.14.0-33-generic x86_64 x86_64

What issue are you seeing?

Codex doesn't seem to update how much context is left, and therefore never auto-compacts. The status always indicates "100% context left", no matter how much context I use.

What steps can reproduce the bug?

My config is simple:

[model_providers.lms]
name = "LM Studio"
base_url = "http://localhost:1234/v1"

[profiles.lmstudio]
model_provider = "lms"
api_key = "not-needed"
model = "openai/gpt-oss-20b"
model_context_window = 131072

approval_policy = "on-failure"

and then I run:

codex --profile lmstudio "hi, write a 2 page story"

At the end of the command, there's still "100% context left" in the status.

What is the expected behavior?

After 2 pages of story, I expect the context to drop below 100%

Additional information

I also tried previous versions of Codex and it never seemed to work. Context seems to be properly updated with other CLI tools such as gemini afair

Activity

  1. added
    bugSomething isn't working
    on Oct 26, 2025
  2. github-actions commented on Oct 26, 2025

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. kargarisaac commented on Oct 27, 2025

    @kargarisaac

    I still get this as well. sometimes it does autocompact, but sometimes fails and stops

  4. added
    custom-modelIssues related to custom model providers (including local models)
    on Oct 27, 2025
  5. teub commented on Oct 28, 2025

    @teub
    Author

    @zhao-oai I tried building your PR but the context is still stuck at 100% left with my repro steps!
    It was worth a shot though, thank you for the link.

  6. teub commented on Oct 28, 2025

    @teub
    Author

    Another hint about what the problem could be: if I type /status, I get a token usage of 0

  7. teub commented on Oct 28, 2025

    @teub
    Author

    Could be a duplicate of #2565 or #2293 ?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcustom-modelIssues related to custom model providers (including local models)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions