diff --git a/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs b/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs index f0a548eae4..3ae4597a8d 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs @@ -77,7 +77,7 @@ impl ToolHandler for Handler { apply_role_to_config(&mut config, role_name) .await .map_err(FunctionCallError::RespondToModel)?; - if fork_context { + if args.fork_context { restore_forked_spawn_agent_model_config(&mut config, turn.as_ref()); } apply_spawn_agent_runtime_overrides(&mut config, turn.as_ref())?;