Skip to content

[codex] simplify token budget context#29295

Merged
pakrym-oai merged 1 commit into
mainfrom
pakrym/simplify-token-budget-context
Jun 21, 2026
Merged

[codex] simplify token budget context#29295
pakrym-oai merged 1 commit into
mainfrom
pakrym/simplify-token-budget-context

Conversation

@pakrym-oai

Copy link
Copy Markdown
Contributor

Why

The token-budget feature currently adds remaining-token messages whenever usage crosses the 25%, 50%, and 75% thresholds. Those periodic inserts create prompt churn without requiring action, while the near-compaction reminder and explicit get_context_remaining tool already cover actionable and on-demand budget information.

The context-window lineage block is also easier to scan as plain labeled text than as a <token_budget>-wrapped fragment.

What changed

  • Stop recording automatic remaining-token messages at percentage thresholds.
  • Render context-window lineage in First, Current, Previous order with colon-separated labels.
  • Omit the Previous line for the first context window.
  • Remove <token_budget> wrappers from newly rendered lineage, near-compaction reminders, and get_context_remaining output.
  • Keep recognizing legacy wrapped fragments so existing rollouts remain compatible.
  • Remove the post-sampling token snapshot that was only needed by the periodic threshold path.

Testing

  • just test -p codex-core token_budget (11 tests passed)

@pakrym-oai
pakrym-oai marked this pull request as ready for review June 21, 2026 04:43
@pakrym-oai
pakrym-oai requested a review from a team as a code owner June 21, 2026 04:43
@pakrym-oai
pakrym-oai merged commit aaf737f into main Jun 21, 2026
28 of 30 checks passed
@pakrym-oai
pakrym-oai deleted the pakrym/simplify-token-budget-context branch June 21, 2026 04:50
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant