[codex] prefer inherited spawn agent model (#18701)

This updates the spawn-agent tool contract so subagents are presented as
inheriting the parent model by default. The visible model list is now
framed as optional overrides, the model parameter tells callers to leave
it unset and the delegation guidance no longer nudges models toward
picking a smaller/mini override.

Fixes reports that 5.4 would occasionally pick 5.2 or lower as
sub-agents.
This commit is contained in:
Thibault Sottiaux
2026-04-20 15:34:08 -07:00
committed by GitHub
parent cebe57b723
commit 54bd07d28c
4 changed files with 57 additions and 12 deletions

View File

@@ -170,6 +170,23 @@ async fn spawn_agent_description_lists_visible_models_and_reasoning_efforts() ->
description.contains("- Visible Model (`visible-model`): Fast and capable"),
"expected visible model summary in spawn_agent description: {description:?}"
);
assert!(
description
.contains("Available model overrides (optional; inherited parent model is preferred):"),
"expected model choices to be framed as overrides in spawn_agent description: {description:?}"
);
assert!(
description.contains(
"Spawned agents inherit your current model by default. Omit `model` to use that preferred default; set `model` only when an explicit override is needed."
),
"expected inherited-model guidance in spawn_agent description: {description:?}"
);
assert!(
description.contains(
"Do not set the `model` field unless the user explicitly asks for a different model or there is a clear task-specific reason."
),
"expected model override usage guidance in spawn_agent description: {description:?}"
);
assert!(
description.contains("Default reasoning effort: medium."),
"expected default reasoning effort in spawn_agent description: {description:?}"
@@ -200,6 +217,10 @@ async fn spawn_agent_description_lists_visible_models_and_reasoning_efforts() ->
),
"expected agent-role clarification in spawn_agent description: {description:?}"
);
assert!(
!description.contains("A mini model can solve many tasks faster than the main model."),
"spawn_agent description should not encourage choosing a smaller model by default: {description:?}"
);
Ok(())
}