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 authored and copyberry committed 2026-07-16 10:28:36 +00:00
1 parent 03bb3b1236
commit 9ff47868eb
14 files changed
+96 -49

No files matched your search

-8
View File
@@ -7351,7 +7351,6 @@ async fn load_config_rejects_missing_agent_role_config_file() -> std::io::Result
enabled: None,
max_concurrent_threads_per_session: None,
max_depth: None,
support_agent_type: None,
default_subagent_model: None,
default_subagent_reasoning_effort: None,
job_max_runtime_seconds: None,
@@ -8279,7 +8278,6 @@ async fn load_config_resolves_agent_controls() -> std::io::Result<()> {
agents: Some(AgentsToml {
enabled: Some(false),
max_depth: Some(2),
support_agent_type: Some(true),
default_subagent_model: Some("gpt-5.6-terra".to_string()),
default_subagent_reasoning_effort: Some(ReasoningEffort::High),
interrupt_message: Some(false),
@@ -8299,7 +8297,6 @@ async fn load_config_resolves_agent_controls() -> std::io::Result<()> {
(
config.agents_enabled,
config.agent_max_depth,
config.agent_support_agent_type,
config.agent_default_subagent_model.as_deref(),
config.agent_default_subagent_reasoning_effort,
config.agent_interrupt_message_enabled,
@@ -8307,7 +8304,6 @@ async fn load_config_resolves_agent_controls() -> std::io::Result<()> {
(
false,
2,
Some(true),
Some("gpt-5.6-terra"),
Some(ReasoningEffort::High),
false,
@@ -8346,7 +8342,6 @@ async fn load_config_normalizes_agent_role_nickname_candidates() -> std::io::Res
enabled: None,
max_concurrent_threads_per_session: None,
max_depth: None,
support_agent_type: None,
default_subagent_model: None,
default_subagent_reasoning_effort: None,
job_max_runtime_seconds: None,
@@ -8393,7 +8388,6 @@ async fn load_config_rejects_empty_agent_role_nickname_candidates() -> std::io::
enabled: None,
max_concurrent_threads_per_session: None,
max_depth: None,
support_agent_type: None,
default_subagent_model: None,
default_subagent_reasoning_effort: None,
job_max_runtime_seconds: None,
@@ -8434,7 +8428,6 @@ async fn load_config_rejects_duplicate_agent_role_nickname_candidates() -> std::
enabled: None,
max_concurrent_threads_per_session: None,
max_depth: None,
support_agent_type: None,
default_subagent_model: None,
default_subagent_reasoning_effort: None,
job_max_runtime_seconds: None,
@@ -8475,7 +8468,6 @@ async fn load_config_rejects_unsafe_agent_role_nickname_candidates() -> std::io:
enabled: None,
max_concurrent_threads_per_session: None,
max_depth: None,
support_agent_type: None,
default_subagent_model: None,
default_subagent_reasoning_effort: None,
job_max_runtime_seconds: None,