Allow the expanded agent model shortlist in prompt-prefix tests (#62070)

## Why

Released CLIs can still advertise five model overrides in `spawn_agent`, causing the prompt-prefix comparison to reject the expanded shortlist.

## What changed

- Accept the exact four-model addition to the `spawn_agent` description when comparing against a release, while preserving checks for all other description changes.
- Refresh the collaboration tool hashes in the bundled statusline skill snapshot.

GitOrigin-RevId: 22cfd81215734d9f3aba84eda2102c25d75fce96
This commit is contained in:
jif
2026-11-17 16:12:36 +00:00
committed by copyberry
parent c6a41e32f6
commit b271854568
2 changed files with 52 additions and 2 deletions
@@ -114,6 +114,7 @@ async fn prompt_prefix_matches_release() -> Result<()> {
if release.is_some() && prefixes[0] != prefixes[1] {
let mut released: Value = serde_json::from_str(&prefixes[0])?;
let current: Value = serde_json::from_str(&prefixes[1])?;
accept_spawn_agent_shortlist_rollout(&mut released, &current);
accept_default_tool_description_rollouts(&mut released, &current);
prefixes[0] = serde_json::to_string_pretty(&released)?;
}
@@ -124,6 +125,55 @@ async fn prompt_prefix_matches_release() -> Result<()> {
Ok(())
}
// Accept the exact default-on shortlist expansion from #18296 while comparing with
// releases that still advertise five models. All other description bytes stay checked.
fn accept_spawn_agent_shortlist_rollout(released: &mut Value, current: &Value) {
const TOOL: &str = "/input/0/tools/2/tools/4";
for prefix in [&*released, current] {
if prefix.pointer("/input/0/role").and_then(Value::as_str) != Some("developer")
|| prefix
.pointer("/input/0/tools/2/name")
.and_then(Value::as_str)
!= Some("collaboration")
|| prefix.pointer(TOOL).and_then(|tool| tool["name"].as_str()) != Some("spawn_agent")
{
return;
}
}
let Some(description) = released
.pointer_mut(TOOL)
.and_then(|tool| tool.get_mut("description"))
else {
return;
};
let Some(old) = description.as_str() else {
return;
};
const OLD_MODELS: &str = r#"Available model overrides (optional; inherited parent model is preferred):
- `gpt-6.1-sol`: Latest workhorse model for coding and everyday work. Reasoning efforts: low (default), medium, high, xhigh, max, ultra. Service tiers: priority.
- `gpt-6-astra`: Frontier intelligence for the most demanding work. Reasoning efforts: low (default), medium, high, xhigh, max, ultra. Service tiers: priority.
- `gpt-6-sol`: Previous generation workhorse model. Reasoning efforts: low, medium (default), high, xhigh, max, ultra. Service tiers: priority.
- `gpt-6-luna`: Fast and affordable model for easier tasks. Reasoning efforts: low, medium (default), high, xhigh, max. Service tiers: priority.
- `gpt-5.6-sol`: Older generation workhorse model. Reasoning efforts: low (default), medium, high, xhigh, max, ultra. Service tiers: priority.
"#;
const EXTRA_MODELS: &str = r#"- `gpt-6.1-terra`: GPT-6.1 Terra Codex model. Reasoning efforts: low (default), medium, high, xhigh, max, ultra. Service tiers: priority.
- `gpt-5.6-terra`: Older balanced model for straightforward work. Reasoning efforts: low, medium (default), high, xhigh, max, ultra. Service tiers: priority.
- `gpt-5.6-luna`: Older fast and efficient model. Reasoning efforts: low, medium (default), high, xhigh, max. Service tiers: priority.
- `gpt-5.5`: Legacy coding model. Reasoning efforts: low, medium (default), high, xhigh. Service tiers: priority.
"#;
if old.matches(OLD_MODELS).count() != 1 {
return;
}
let updated = old.replace(OLD_MODELS, &format!("{OLD_MODELS}{EXTRA_MODELS}"));
if current
.pointer(TOOL)
.and_then(|tool| tool["description"].as_str())
== Some(updated.as_str())
{
*description = Value::String(updated);
}
}
// Accept only the exact default-on changes to the released functions.exec description.
// Once the release includes them, the ordinary byte-for-byte comparison succeeds.
fn accept_default_tool_description_rollouts(released: &mut Value, current: &Value) {
@@ -6,7 +6,7 @@ Scenario: A user requests the bundled statusline skill by name.
## Window 1
-- request 1 (turn) --
00:additional_tools/developer (3; hash=e43eac769da0e93e):
00:additional_tools/developer (3; hash=f2e4edd02b6f9300):
- namespace/functions; hash=81846de5bc4e7474
- custom/exec
- function/wait
@@ -14,7 +14,7 @@ Scenario: A user requests the bundled statusline skill by name.
- function/request_user_input_async
- namespace/clock: Tools for reading and waiting on time.; hash=f402e8c5e9b5e317
- function/sleep
- namespace/collaboration: Tools for spawning and managing sub-agents.; hash=2c8d6295978dbe63
- namespace/collaboration: Tools for spawning and managing sub-agents.; hash=0271b89d55152d99
- function/followup_task
- function/interrupt_agent
- function/list_agents