Add a per-thread context-window profile selector
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What variant of Codex are you using?
Codex Desktop and Codex CLI with a ChatGPT subscription.
What feature would you like to see?
Please add a per-thread context-window profile selector so each Codex session can choose its own context/usage tradeoff without changing the global configuration.
For example, when creating a thread—and later from that thread's settings—users could select:
- Efficient: smaller active context, earlier compaction, lower usage
- Default: OpenAI's recommended profile
- Extended: larger active context, later compaction, with a clear usage warning
The exact token counts may remain model- and plan-dependent. The important requirement is that the choice is scoped to one thread rather than applied globally.
Why per-thread scope matters
Different tasks have very different context requirements:
- A small coding fix benefits from an efficient profile.
- A long research, debugging, or architecture task may need the extended profile.
- Running several threads at once should not force every thread to use the most expensive context setting.
- Changing a global setting should not silently alter the context behavior of existing threads.
A global-only setting makes users choose between wasting usage on small tasks and losing continuity on long tasks.
Requested behavior
- Add a context profile control to the new-thread UI.
- Allow the profile to be changed from an existing thread's settings.
- Persist the selected profile in thread/session metadata.
- Show the effective token window and auto-compaction threshold before confirmation.
- Warn that a larger profile may consume subscription usage faster.
- Keep existing threads pinned to their selected profile unless the user changes it.
- Expose an equivalent CLI option, for example:
codex --context-profile efficient codex --context-profile default codex --context-profile extended - If a selected profile is unavailable for the current model or plan, explain why and fall back explicitly rather than silently.
Expected result
Users can optimize context and usage per task while preserving predictable behavior across concurrent and existing sessions.
Related issues
- #34619 requests restoration of GPT-5.6 Sol's 372k profile or an opt-in setting. This request is broader and specifically asks for a general, persistent per-thread selector across supported models and profiles.
- #32803 and #32806 discuss context-profile reductions and their impact.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the new-thread UI, existing thread settings, thread/session metadata handling, and CLI argument parsing mentioned in the request. Trace how context limits and auto-compaction are currently selected. Done means profiles can be selected and persisted per thread in both interfaces, with effective limits, usage warnings, and explicit fallback behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100