mirror of
https://github.com/openai/codex.git
synced 2026-11-04 00:24:43 +00:00
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:
1 parent
03bb3b1236
commit
9ff47868eb
14 files changed
+96
-49
No files matched your search
@@ -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,
|
||||
|
||||
@@ -863,9 +863,6 @@ pub struct Config {
|
||||
/// User-configured maximum number of spawned agent threads per session.
|
||||
pub agent_max_threads: Option<usize>,
|
||||
|
||||
/// Reserved setting for whether the spawn tool supports agent types.
|
||||
pub agent_support_agent_type: Option<bool>,
|
||||
|
||||
/// Reserved default model for spawned subagents.
|
||||
pub agent_default_subagent_model: Option<String>,
|
||||
|
||||
@@ -3606,10 +3603,6 @@ impl Config {
|
||||
.as_ref()
|
||||
.and_then(|agents| agents.max_depth)
|
||||
.unwrap_or(DEFAULT_AGENT_MAX_DEPTH);
|
||||
let agent_support_agent_type = cfg
|
||||
.agents
|
||||
.as_ref()
|
||||
.and_then(|agents| agents.support_agent_type);
|
||||
let agent_default_subagent_model = cfg
|
||||
.agents
|
||||
.as_ref()
|
||||
@@ -3970,7 +3963,6 @@ impl Config {
|
||||
tool_output_token_limit: cfg.tool_output_token_limit,
|
||||
agents_enabled,
|
||||
agent_max_threads,
|
||||
agent_support_agent_type,
|
||||
agent_default_subagent_model,
|
||||
agent_default_subagent_reasoning_effort,
|
||||
agent_max_depth,
|
||||
|
||||
Reference in new issue
Block a user