Support explicit context-length selection for models with multiple context tiers

Open 💬 2 comments Opened Mar 6, 2026 by Inventure71

What variant of Codex are you using?

CLI

What feature would you like to see?

Idea: make context length a first-class picker choice in the CLI, similar to reasoning effort, so users can explicitly select the context tier for models that support more than one.

Additional information

I already implemented this in my fork at https://github.com/Inventure71/codex/tree/ContextSelector
What I implemented:

  • Added generic model metadata support for context presets via supported_context_window_presets, including label, context_window, auto_compact_token_limit, and description.
  • Extended the CLI picker flow from model -> reasoning to model -> reasoning -> context length, with the context step only shown when presets exist.
  • Persisted the full selection through the existing config path:
  • model
  • model_reasoning_effort
  • model_context_window
  • model_auto_compact_token_limit
  • Updated live session propagation so selecting a context preset affects the running session immediately, not only after restart.
  • Updated status/context display so the selected context tier is reflected right away instead of showing stale prior-turn context values.
  • Removed the temporary hardcoded bundled gpt-5.4 catalog entry and replaced it with a client-side fallback that exposes 264k and 1M context presets only for gpt-5.4 when the server does not yet advertise context presets.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗