mirror of
https://github.com/openai/codex.git
synced 2026-09-11 20:36:49 +00:00
fix(core): preserve role precedence for model fallback
This commit is contained in:
@@ -69,13 +69,8 @@ impl ToolHandler for Handler {
|
||||
.into(),
|
||||
)
|
||||
.await;
|
||||
let mut config =
|
||||
let config =
|
||||
build_agent_spawn_config(&session.get_base_instructions().await, turn.as_ref())?;
|
||||
apply_role_to_config(&mut config, role_name)
|
||||
.await
|
||||
.map_err(FunctionCallError::RespondToModel)?;
|
||||
apply_spawn_agent_runtime_overrides(&mut config, turn.as_ref())?;
|
||||
apply_spawn_agent_overrides(&mut config, child_depth);
|
||||
|
||||
let mut candidates_to_try = collect_spawn_agent_model_candidates(
|
||||
args.model_fallback_list.as_ref(),
|
||||
@@ -100,6 +95,11 @@ impl ToolHandler for Handler {
|
||||
candidate.reasoning_effort,
|
||||
)
|
||||
.await?;
|
||||
apply_role_to_config(&mut candidate_config, role_name)
|
||||
.await
|
||||
.map_err(FunctionCallError::RespondToModel)?;
|
||||
apply_spawn_agent_runtime_overrides(&mut candidate_config, turn.as_ref())?;
|
||||
apply_spawn_agent_overrides(&mut candidate_config, child_depth);
|
||||
let attempt_result = session
|
||||
.services
|
||||
.agent_control
|
||||
|
||||
@@ -72,13 +72,8 @@ impl ToolHandler for Handler {
|
||||
.into(),
|
||||
)
|
||||
.await;
|
||||
let mut config =
|
||||
let config =
|
||||
build_agent_spawn_config(&session.get_base_instructions().await, turn.as_ref())?;
|
||||
apply_role_to_config(&mut config, role_name)
|
||||
.await
|
||||
.map_err(FunctionCallError::RespondToModel)?;
|
||||
apply_spawn_agent_runtime_overrides(&mut config, turn.as_ref())?;
|
||||
apply_spawn_agent_overrides(&mut config, child_depth);
|
||||
|
||||
let spawn_source = thread_spawn_source(
|
||||
session.conversation_id,
|
||||
@@ -130,6 +125,11 @@ impl ToolHandler for Handler {
|
||||
candidate.reasoning_effort,
|
||||
)
|
||||
.await?;
|
||||
apply_role_to_config(&mut candidate_config, role_name)
|
||||
.await
|
||||
.map_err(FunctionCallError::RespondToModel)?;
|
||||
apply_spawn_agent_runtime_overrides(&mut candidate_config, turn.as_ref())?;
|
||||
apply_spawn_agent_overrides(&mut candidate_config, child_depth);
|
||||
let attempt_result = session
|
||||
.services
|
||||
.agent_control
|
||||
|
||||
Reference in New Issue
Block a user