Skip to content

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

@fdk0

Description

@fdk0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsubagentIssues involving subagents or multi-agent features

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions