Skip to content

Add a per-thread context-window profile selector #40429

Description

@dividend3-prog

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIappIssues related to the Codex desktop appcontextIssues related to context management (including compaction)enhancementNew feature or requestsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions