Skip to content

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

Closed

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

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    on Mar 7, 2026
  2. github-actions commented on Mar 7, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. added
    agentIssues related to the core agent loop
    and removed
    CLIIssues related to the Codex CLI
    on Mar 7, 2026
  4. added
    subagentIssues involving subagents or multi-agent features
    and removed
    agentIssues related to the core agent loop
    on Apr 11, 2026
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

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions