Feature request: allow a separate model for context compaction
What variant of Codex are you using?
CLI
What feature would you like to see?
Add a dedicated configuration option to let Codex use a different model for context compaction than the main conversation model.
Today compaction appears to use the same model path / session model that is handling the main thread. That makes compaction expensive and, depending on the selected model, can also reduce reliability or throughput for long-running sessions.
A separate compaction model would make it possible to keep a strong main model for normal work while using a smaller / cheaper / faster model for summarization-only compaction work.
Examples:
- main thread:
gpt-5-codex - compaction:
gpt-5-codex-mini
or
- main thread: high-capability planning / execution model
- compaction: lightweight summarization model
Potential config shapes:
model = "gpt-5-codex"
compaction_model = "gpt-5-codex-mini"
or
[compaction]
model = "gpt-5-codex-mini"
Nice-to-have related controls:
- optional
reasoning_effortoverride for compaction - explicit fallback to main model if the compaction model is unavailable
- visibility in
/statusor logs showing which model handled the most recent compaction
Why this would help:
- reduces cost for long-lived sessions
- can make compaction faster
- lets users tune quality vs cost separately for summarization work
- matches other requests for per-role / per-phase model selection in Codex
Additional information
I searched for an existing issue specifically about using a separate model for compaction and did not find one. The closest related issues I found were:
- #4106 (
Control over auto-compaction parameters) - #5558 (
Separate model selection for Plan vs Execute modes) - #11795 (
Allow configuring subagent model and reasoning_effort in config)
Those are adjacent, but this request is narrower and specifically about the compaction path.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗