Support leaf models in multi-agent v2 (#36892)

## What changed

- Allow multi-agent v2 parents to spawn any visible model that has not explicitly disabled multi-agent support.
- Expose collaboration tools to child agents only when their selected model supports multi-agent v2, keeping legacy models as leaf workers.
- Preserve a worker's selected model when reloading it into residency.
- Propagate multi-agent capability metadata to Amazon Bedrock model entries so delegation is gated consistently.

## Testing

- Cover model selection, leaf-worker tool visibility, Bedrock capability handling, and model preservation after reload.

GitOrigin-RevId: 1457adb1a09806d1f0621311d5a42a6815b9dd4e
This commit is contained in:
jif
2026-08-04 12:36:14 +00:00
committed by copyberry
parent 1669c2403f
commit 6d4d9442c7
11 changed files with 131 additions and 61 deletions
+4
View File
@@ -268,6 +268,7 @@ impl AgentControl {
include_history: false,
})
.await?;
let stored_model = stored_thread.model.clone();
let stored_source = stored_thread.source.clone();
let stored_parent_thread_id = stored_thread.parent_thread_id;
let history = load_agent_model_context(&state, thread_id, stored_thread.history_mode)
@@ -320,6 +321,9 @@ impl AgentControl {
CodexErr::InvalidRequest(format!("permission_profile is invalid: {err}"))
})?;
}
if let Some(model) = stored_model {
config.model = Some(model);
}
let residency_slot = self
.reserve_v2_residency_slot(&state, &config, Some(thread_id))
.await?;