openai / openai/codex

Add a per-thread context-window profile selector

Open
#40,429 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

app CLI context enhancement session
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
  1. Add a context profile control to the new-thread UI.
  2. Allow the profile to be changed from an existing thread's settings.
  3. Persist the selected profile in thread/session metadata.
  4. Show the effective token window and auto-compaction threshold before confirmation.
  5. Warn that a larger profile may consume subscription usage faster.
  6. Keep existing threads pinned to their selected profile unless the user changes it.
  7. Expose an equivalent CLI option, for example:
    codex --context-profile efficient
    codex --context-profile default
    codex --context-profile extended
    
  8. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.