Skip to content

Allow compaction-specific reasoning effort and service tier #24332

Closed

Description

@Cccceb

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:

Cccceb@64b6b1e

Summary of the change:

  • add optional compact_service_tier and compact_model_reasoning_effort config 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 regular service_tier

Touched areas:

  • codex-rs/config/src/config_toml.rs
  • codex-rs/core/config.schema.json
  • codex-rs/core/src/compact.rs
  • codex-rs/core/src/compact_remote.rs
  • codex-rs/core/src/compact_remote_v2.rs
  • codex-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.

Activity

  1. added
    enhancementNew feature or request
    CLIIssues related to the Codex CLI
    contextIssues related to context management (including compaction)
    configIssues involving config.toml, config keys, config merging, or config updates
    on May 24, 2026
  2. github-actions commented on May 24, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. Cccceb commented on May 24, 2026

    @Cccceb
    Author

    Closing as a duplicate of #22486. I moved the implementation details and fork branch to this comment: #22486 (comment)

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 CLIconfigIssues involving config.toml, config keys, config merging, or config updatescontextIssues related to context management (including compaction)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions