Repository navigation
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
- Restore GPT-5.6 Sol’s 372k Codex context window, or provide an opt-in setting #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.
- Effective context window shrank down to 250k in win app #32803 and 🚨 [SEVERE REGRESSION] GPT-5.6 Sol context cut again: 353K → 258K despite advertised 1.05M #32806 discuss context-profile reductions and their impact.
Activity
github-actions commentedon Aug 24, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
diogovalada commentedon Sep 7, 2026
Please extend the per-thread context profile to spawned agent threads. The spawn operation should optionally accept a context profile/window and auto-compaction threshold. I suppose defaulting to inheritance from the parent or selected custom-agent profile is the path of least surprise? The sub-agent UI/status should show the effective choice, just as it shows the model and reasoning effort.
Kroschinsky commentedon Sep 14, 2026
This is exactly the kind of control I would like to see in the session/thread UI.
A simple selector next to Model / Reasoning would make the intended workflow very clear, for example:
The key point is that context size is a workload decision, not really a global user preference. I may have several Codex sessions running at once, and only one of them needs the expensive/large context window. Changing
config.tomlglobally is therefore the wrong granularity.Ideally this could be selected when creating a thread and also increased later from the thread settings without restarting/forking the session. Showing the effective model-supported size (and any usage/cost warning) would be enough to keep the UX safe.
Fallet666 commentedon Oct 13, 2026
I work primarily in the Codex desktop UI and need to choose the context budget per chat based on task complexity: a smaller/earlier-compaction profile for routine, bounded changes, and a larger profile for complex debugging or research. Editing global
config.tomlor launching separate CLI profiles does not fit this workflow.A profile picker alongside Model/Reasoning in the composer or thread settings—showing the effective model-supported context window and compaction threshold, and available both when creating a chat and later in an existing chat—would make this practical.
Fandy-ust commentedon Oct 18, 2026
Adding concrete implementation experience from a per-chat context controller I maintain, which now shares one core across Mac and Windows. The use case here matches ours: choose context and compaction behavior for one chat without changing every other chat's settings.
The most useful upstream contract would be a per-thread usable context window and compaction threshold, exposed consistently through the Desktop UI and app-server. Some details from our implementation:
Explicit request: freely resize the context of an existing chat
The control should support custom numeric values, not only preset profiles, and let the user increase or decrease the context window repeatedly throughout the same chat, within the model/plan's supported range.
This is a request for in-place, per-chat adjustment at any time, with explicit bounds and state feedback.
Our optional 920K mode is an experimental local catalog/configuration override. Its 920K visible ceiling, 904K maximum compaction threshold and minimum 16K reserve are our application's choices, not proof that every model, plan or server route officially supports that capacity. The upstream feature should use authoritative model/plan capabilities rather than hardcode 920K globally.
Shared JS/Swift budget fixtures and the successful dual-platform validation run make the controller behavior inspectable. These checks cover our implementation and synthetic scenarios; they do not establish universal server-side long-context support or real Windows Desktop/Computer Use acceptance.
A native profile picker backed by a stable per-thread app-server operation would make these settings much easier to maintain across Codex updates. Flexible window selection and the accounting bug in #53913 should be handled independently: increasing a budget does not correct an inflated compaction counter.
ropepop commentedon Nov 17, 2026
I'd like the live-update requirement to be explicit: context size should be adjustable within an existing chat, with custom numeric values as well as any presets, and changes should apply automatically without restarting Codex, forking, or creating a new chat.
In addition to the controls already discussed here, please cover edits to the relevant configuration:
A useful acceptance check would be changing the setting both while a chat is idle and during a multi-step run, then confirming the next eligible request uses the new limit.
Related subagent requests: #49195 for defaults and #45164 for per-role overrides. Those controls should remain independently scoped.