Context window usage unexpectedly increases without compact operation

Resolved 💬 2 comments Opened Dec 16, 2025 by BobbyWang0120 Closed Dec 16, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.73.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.2 high

What platform is your computer?

macos

What issue are you seeing?

While using Codex, I expect the context window usage indicator to decrease gradually as the conversation consumes tokens. However, I've observed that at some points the indicator suddenly jumps back to a higher percentage. For instance, at the end of one turn it showed around 70% remaining, but after the next turn it jumped back to over 90% remaining. I did not see any /compact operation or other compaction taking place during these interactions. Is this behaviour expected? Is there an underlying mechanism managing the context window usage, or is this a bug in the calculation or display of the usage?

What steps can reproduce the bug?

  1. Start a new conversation in Codex.
  2. Send a few prompts and observe the context window usage indicator decreasing as tokens are consumed.
  3. At some point, the indicator may show around 70% remaining.
  4. Without performing any /compact or summarization operation, send another message.
  5. After that turn, notice that the context window usage indicator jumps back to a higher percentage (e.g., from ~70% to >90%).
  6. This pattern is randomly happening.

What is the expected behavior?

The context window usage indicator should accurately reflect the remaining available context. It should decrease steadily as tokens are consumed and should not jump back to a larger percentage unless a compaction or summarization operation is explicitly performed.

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 8 months ago

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

  • #6085
  • #7131
  • #7141
  • #7232

Powered by Codex Action

etraut-openai contributor · 8 months ago

This is expected. With newer models, we support auto compaction when the context window is nearly full. This allows these models to work autonomously for long periods of time without manual compaction.