Skip to content

[codex] Add /context window breakdown#16963

Draft
starr-openai wants to merge 7 commits intomainfrom
pr-16620-devbox-20260406
Draft

[codex] Add /context window breakdown#16963
starr-openai wants to merge 7 commits intomainfrom
pr-16620-devbox-20260406

Conversation

@starr-openai
Copy link
Copy Markdown
Contributor

Summary

  • add a new /context TUI command that requests a semantic context-window breakdown from the app-server
  • expose that breakdown through a new thread/context/read app-server API and protocol schema
  • render the returned context map in the TUI, including loading state and verbose support
  • fix thread-local replay so async /context results return to the originating thread instead of the currently active one
  • add focused coverage for the thread replay path and developer-content classification path

Why

Codex already tracks token usage, but it did not provide a way to inspect what was actually occupying the current model-visible context. This change adds a user-facing inspection path and closes a correctness gap in the async TUI result handling.

Validation

  • cargo test -p codex-core developer_message_content_items_are_classified_individually
  • cargo test -p codex-tui context_window_breakdown_for_inactive_thread_replays_into_origin_thread
  • just fix -p codex-core
  • just fix -p codex-tui
  • just fmt

starr-openai and others added 7 commits April 6, 2026 14:39
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant