incorrect context window % left in /status in oss mode

Open 💬 2 comments Opened Feb 6, 2026 by dkhokhlov

What version of Codex CLI is running?

codex-cli 0.98.0

What subscription do you have?

Team

Which model were you using?

gpt-oss:20b

What platform is your computer?

Ubuntu 22

What terminal emulator and version are you using (if applicable)?

_No response_

What issue are you seeing?

Incorrect ctx window "XX% left" in /status: "Context window: 89% left (14.9K used / 38K) ".

╭─────────────────────────────────────────────────────────────────────────────────╮
│  >_ OpenAI Codex (v0.98.0)                                                      │
│                                                                                 │
│ Visit https://chatgpt.com/codex/settings/usage for up-to-date                   │
│ information on rate limits and credits                                          │
│                                                                                 │
│  Model:                gpt-oss:20b (reasoning high, summaries off)              │
│  Model provider:       gpt-oss - http://x.x.x.x:11434/v1                        │
│  Directory:            /lib                                                     │
│  Approval:             never                                                    │
│  Sandbox:              danger-full-access                                       │
│  Agents.md:            ../AGENTS.md                                             │
│  Account:             xxxxxxx@xxxxxx (Team)                                     │
│  Collaboration mode:   Default                                                  │
│  Session:              019c3193-7aaf-70d0-a0b7-f13340366d63                     │
│                                                                                 │
│  Context window:       89% left (14.9K used / 38K)                              │
╰─────────────────────────────────────────────────────────────────────────────────╯

What steps can reproduce the bug?

  • ollama
  • version is 0.15.4
  • on macOS, M1 32GB
  • export OLLAMA_CONTEXT_LENGTH=40000
> ollama ps
NAME           ID              SIZE     PROCESSOR    CONTEXT    UNTIL
gpt-oss:20b    17052f91a42e    14 GB    100% GPU     40000      Forever
  • codex --oss
  • on Ubuntu
  • codex config:
model = "openai/gpt-oss-20b"
model_temperature = 0.0
model_context_window = 40000
model_reasoning_effort = "high"
model_verbosity = "medium"
model_reasoning_summary = "none"
model_supports_reasoning_summaries = false
model_provider = "ollama"
oss_provider = "ollama"
  • try to use context
  • /status

What is the expected behavior?

Correct percentage of context used.

Additional information

I suspect this also affects auto-compact.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗