You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve runtime model provider when applying subagent roles #27712
CLIIssues related to the Codex CLIbugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updatessubagentIssues involving subagents or multi-agent features
When applying a subagent role with agent_type, the role's model / model_reasoning_effort settings are reflected in the child thread snapshot.
However, the runtime-configured model_provider instance was not preserved during role application. As a result, the child request could be routed using the post-reload provider configuration instead of the active provider.
Cause
The config reload preserves model_provider_id, but loses the runtime model_provider instance when the role does not explicitly specify model_provider.
Expected Behavior
If a role does not override model_provider, the current runtime provider should be preserved.
Change Made
I updated the role-application path to preserve the current provider instance and added tests covering:
provider preservation across reload
wire-level propagation of role model / reasoning.effort into the child request body
Verification
just fmt
just test -p codex-core apply_role_preserves_current_model_provider_without_override subagent_role_model_and_reasoning_reach_child_request_body responses_api_parent_and_subagent_requests_include_identity_headers spawn_agent_role_overrides_requested_model_and_reasoning_settings
Thanks for flagging. This appears related to #27624, but I do not think it is an exact duplicate.
#27624 reports that model_reasoning_effort is ignored in Codex App and subagents are spawned with medium.
This issue is narrower: during role application, the config reload preserves model_provider_id but does not preserve the runtime model_provider instance. The linked fork diff includes a fix for preserving the provider instance and wire-level test coverage that verifies the subagent child /v1/responses request body contains the role's model and reasoning.effort.
So this may be related or complementary to #27624, but the proposed change targets a specific provider-preservation issue in the role application path.
CLIIssues related to the Codex CLIbugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updatessubagentIssues involving subagents or multi-agent features
Activity
github-actions commentedon Jun 12, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
keishimizu26629 commentedon Jun 12, 2026
Thanks for flagging. This appears related to #27624, but I do not think it is an exact duplicate.
#27624 reports that
model_reasoning_effortis ignored in Codex App and subagents are spawned withmedium.This issue is narrower: during role application, the config reload preserves
model_provider_idbut does not preserve the runtimemodel_providerinstance. The linked fork diff includes a fix for preserving the provider instance and wire-level test coverage that verifies the subagent child/v1/responsesrequest body contains the role'smodelandreasoning.effort.So this may be related or complementary to #27624, but the proposed change targets a specific provider-preservation issue in the role application path.