Expose spawn agent types only when roles are configured (#33572)

## Why

The `agent_type` argument is only useful when agent roles are configured. Avoid
advertising an inapplicable override in the model-visible `spawn_agent` schema.

## What changed

- Include `agent_type` in the V1 and V2 spawn tools only when configured roles
  are available.
- Clarify that `agent_type` is an explicit override and document its interaction
  with context forking.
- Remove the unused `agents.support_agent_type` configuration field.

## Testing

- Add coverage for hiding `agent_type` without roles and exposing it when a role
  is configured.

GitOrigin-RevId: 32e0f123b15f317e9cdb71774029375bc073d9ad
This commit is contained in:
jif
2026-07-16 10:28:36 +00:00
committed by copyberry
parent 03bb3b1236
commit 9ff47868eb
14 changed files with 96 additions and 49 deletions
-1
View File
@@ -180,7 +180,6 @@ fn save_config_resolved_fields(
agents.enabled = Some(config.agents_enabled);
agents.max_concurrent_threads_per_session = config.agent_max_threads;
agents.max_depth = Some(config.agent_max_depth);
agents.support_agent_type = config.agent_support_agent_type;
agents.default_subagent_model = config.agent_default_subagent_model.clone();
agents.default_subagent_reasoning_effort =
config.agent_default_subagent_reasoning_effort.clone();