fix(core): preserve effective effort for fork-context children

This commit is contained in:
Friel
2026-03-30 04:22:19 +00:00
parent 24ef81815f
commit e2fbe5c83b

View File

@@ -225,7 +225,11 @@ fn build_agent_shared_config(turn: &TurnContext) -> Result<Config, FunctionCallE
let mut config = (*base_config).clone();
config.model = Some(turn.model_info.slug.clone());
config.model_provider = turn.provider.clone();
config.model_reasoning_effort = turn.reasoning_effort;
// Forked children must preserve the spawning turn's effective model settings, including a
// model catalog default effort, so their config snapshot matches the actual request shape.
config.model_reasoning_effort = turn
.reasoning_effort
.or(turn.model_info.default_reasoning_level);
config.model_reasoning_summary = Some(turn.reasoning_summary);
config.developer_instructions = turn.developer_instructions.clone();
config.compact_prompt = turn.compact_prompt.clone();