Sub-agent role top-level reasoning settings are overridden by inherited parent profile

Resolved 💬 1 comment Opened Mar 7, 2026 by fdk0 Closed Mar 16, 2026

What variant of Codex are you using?

CLI version 0.111.0

What happened?

Sub-agent roles can ignore explicit top-level reasoning settings when the parent session has an active profile.

If a role TOML sets:

  • model_reasoning_effort
  • model_reasoning_summary
  • model_verbosity

but does not explicitly set profile or model_provider, the spawned child may still inherit the parent active_profile, and the inherited profile values can override the role’s top-level settings.

Steps to reproduce

Parent config:

profile = "parent"

[profiles.parent]
model_reasoning_effort = "high"

Role TOML:

model_reasoning_effort = "low"

Then spawn a sub-agent using that role.

Expected behavior

The child should use:

model_reasoning_effort = "low"

from the role TOML.

Actual behavior

The child can resolve to the parent profile’s reasoning effort instead, e.g. high.

Likely cause

apply_role_to_config() preserves the parent profile unless the role explicitly sets profile or model_provider:

  • codex-rs/core/src/agent/role.rs:73-90
  • codex-rs/core/src/agent/role.rs:114-121

Then config loading gives profile values precedence over top-level config values:

  • codex-rs/core/src/config/mod.rs:2419-2430

So inherited config_profile.* wins over role top-level cfg.*.

Workaround

Set an explicit profile in the role TOML, for example:

profile = "my-role-profile"

Additional notes

This likely also affects:

  • model_reasoning_summary
  • model_verbosity

Verified on upstream main at:

5ceff6588ef67aaac34f9461411b90f65e42b4f9

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗