Allow compaction-specific reasoning effort and service tier
Proposal
Allow compaction requests to use a separate reasoning effort and service tier from normal turns.
Suggested config shape:
model_reasoning_effort = "high"
service_tier = "default"
compact_model_reasoning_effort = "low"
compact_service_tier = "fast"
This lets normal interactive turns keep their usual quality/cost profile, while auto/manual compaction can opt into a faster and lower-reasoning request path.
Motivation
Long-running sessions can become unusable when compaction itself is slow or times out. In local testing, using fast mode for compact substantially reduced compact stalls, but setting global service_tier = "fast" changes the behavior of every normal turn too.
The current config surface appears to make compact inherit the session-level model_reasoning_effort and service_tier. That is convenient as a default, but it prevents users from making compaction cheaper/faster without also changing day-to-day model behavior.
Prepared implementation
I prepared a branch here:
https://github.com/Cccceb/codex/tree/compact-specific-reasoning-service-tier
Commit:
https://github.com/Cccceb/codex/commit/64b6b1e00ad40558c9e4d78c4a6d17b4d01f3b7a
Summary of the change:
- add optional
compact_service_tierandcompact_model_reasoning_effortconfig fields - use those compact-specific settings for local compact, legacy remote compact, and remote compaction v2
- keep existing behavior unchanged when the compact-specific fields are unset
- normalize
compact_service_tier = "fast"through the same fast-mode service-tier normalization path as regularservice_tier
Touched areas:
codex-rs/config/src/config_toml.rscodex-rs/core/config.schema.jsoncodex-rs/core/src/compact.rscodex-rs/core/src/compact_remote.rscodex-rs/core/src/compact_remote_v2.rscodex-rs/core/src/config/mod.rs- config and remote compact tests
Testing
Ran locally:
cargo fmt --check
env CARGO_HOME=/private/tmp/codex-cargo-home cargo test -p codex-core config_toml_compact_
env CARGO_HOME=/private/tmp/codex-cargo-home cargo test -p codex-core remote_manual_compact_uses_compact_specific_service_tier_and_reasoning_effort
All passed.
I attempted to open this as a PR, but this repository currently restricts pull request creation to collaborators, so I am filing the proposal and implementation details here instead.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗