mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
feat(agents): upgrade opus and gemini defaults, retier frontlines
This commit is contained in:
@@ -33,15 +33,17 @@ const CLOUD_GPT5_CODEX_WRITE: &[&str] = &[];
|
||||
/// entries are configured. The ordering here controls priority for legacy
|
||||
/// CLI-name lookups.
|
||||
pub const DEFAULT_AGENT_NAMES: &[&str] = &[
|
||||
"code-gpt-5.1-codex-mini",
|
||||
// Frontline for moderate/challenging tasks
|
||||
"code-gpt-5.1-codex-max",
|
||||
"code-gpt-5.1",
|
||||
"claude-sonnet-4.5",
|
||||
"claude-opus-4.1",
|
||||
"claude-haiku-4.5",
|
||||
"claude-opus-4.5",
|
||||
"gemini-3-pro",
|
||||
"gemini-2.5-pro",
|
||||
// Straightforward / cost-aware
|
||||
"code-gpt-5.1-codex-mini",
|
||||
"claude-sonnet-4.5",
|
||||
"gemini-2.5-flash",
|
||||
// Mixed/general and alternates
|
||||
"code-gpt-5.1",
|
||||
"claude-haiku-4.5",
|
||||
"qwen-3-coder",
|
||||
"cloud-gpt-5.1-codex-max",
|
||||
];
|
||||
@@ -90,7 +92,7 @@ const AGENT_MODEL_SPECS: &[AgentModelSpec] = &[
|
||||
read_only_args: CODE_GPT5_CODEX_READ_ONLY,
|
||||
write_args: CODE_GPT5_CODEX_WRITE,
|
||||
model_args: &["--model", "gpt-5.1-codex-mini"],
|
||||
description: "Your primary coding agent (along with claude-sonnet-4.5). Cheap (1/4 cost), fast and very capable. Excels at implementation, refactors, multi-file edits and code review.",
|
||||
description: "Straightforward coding tasks: cheapest and quick; great for implementation, refactors, multi-file edits, and code reviews.",
|
||||
enabled_by_default: true,
|
||||
aliases: &["code-gpt-5-codex-mini", "codex-mini", "coder-mini"],
|
||||
gating_env: None,
|
||||
@@ -102,7 +104,7 @@ const AGENT_MODEL_SPECS: &[AgentModelSpec] = &[
|
||||
read_only_args: CODE_GPT5_CODEX_READ_ONLY,
|
||||
write_args: CODE_GPT5_CODEX_WRITE,
|
||||
model_args: &["--model", "gpt-5.1-codex-max"],
|
||||
description: "Flagship coding agent. Use when you want maximum reasoning depth and fidelity; falls back to this when older code-gpt-5.1-codex is requested.",
|
||||
description: "Frontline coding agent for moderate to challenging work; maximum reasoning depth with tuned fast mode (higher cost). Falls back for legacy codex requests.",
|
||||
enabled_by_default: true,
|
||||
aliases: &["code-gpt-5.1-codex", "code-gpt-5-codex", "coder", "code", "codex"],
|
||||
gating_env: None,
|
||||
@@ -114,7 +116,7 @@ const AGENT_MODEL_SPECS: &[AgentModelSpec] = &[
|
||||
read_only_args: CODE_GPT5_READ_ONLY,
|
||||
write_args: CODE_GPT5_WRITE,
|
||||
model_args: &["--model", "gpt-5.1"],
|
||||
description: "Use for UI/UX or mixed tasks where explanation, design judgment, or multi-domain reasoning is equally important as code.",
|
||||
description: "Mixed tasks that blend code with design/product reasoning; balances speed and breadth.",
|
||||
enabled_by_default: true,
|
||||
aliases: &["code-gpt-5", "coder-gpt-5"],
|
||||
gating_env: None,
|
||||
@@ -126,21 +128,21 @@ const AGENT_MODEL_SPECS: &[AgentModelSpec] = &[
|
||||
read_only_args: CLAUDE_SONNET_READ_ONLY,
|
||||
write_args: CLAUDE_SONNET_WRITE,
|
||||
model_args: &["--model", "sonnet"],
|
||||
description: "Front line for coding tasks (along with code-gpt-5.1-codex-mini). Excels at implementation, tool use, debugging, and testing.",
|
||||
description: "Straightforward coding/support tasks; strong at implementation, tool use, debugging, and testing.",
|
||||
enabled_by_default: true,
|
||||
aliases: &["claude", "claude-sonnet"],
|
||||
gating_env: None,
|
||||
},
|
||||
AgentModelSpec {
|
||||
slug: "claude-opus-4.1",
|
||||
slug: "claude-opus-4.5",
|
||||
family: "claude",
|
||||
cli: "claude",
|
||||
read_only_args: CLAUDE_OPUS_READ_ONLY,
|
||||
write_args: CLAUDE_OPUS_WRITE,
|
||||
model_args: &["--model", "opus"],
|
||||
description: "Backup for complex coding tasks (along with code-gpt-5.1-codex-max). Slower and more expensive, but slightly more capable if claude-sonnet-4.5 did not succeed.",
|
||||
model_args: &["--model", "opus-4.5"],
|
||||
description: "Frontline Claude for challenging or high-stakes tasks; faster and more capable than Opus 4.1 with stronger agent/tool use.",
|
||||
enabled_by_default: true,
|
||||
aliases: &["claude-opus"],
|
||||
aliases: &["claude-opus", "claude-opus-4.1"],
|
||||
gating_env: None,
|
||||
},
|
||||
AgentModelSpec {
|
||||
@@ -161,22 +163,10 @@ const AGENT_MODEL_SPECS: &[AgentModelSpec] = &[
|
||||
cli: "gemini",
|
||||
read_only_args: GEMINI_PRO_READ_ONLY,
|
||||
write_args: GEMINI_PRO_WRITE,
|
||||
model_args: &["--model", "gemini-3-pro-preview"],
|
||||
description: "Gemini 3 Pro via the Gemini app CLI. Use for newest Gemini capabilities; mapped from the preview model name under the hood.",
|
||||
model_args: &["--model", "gemini-3-pro"],
|
||||
description: "Frontline Gemini for moderate/challenging work; broad multimodal + coding strength with improved rollout.",
|
||||
enabled_by_default: true,
|
||||
aliases: &["gemini-3-pro-preview", "gemini-3", "gemini3", "gemini"],
|
||||
gating_env: None,
|
||||
},
|
||||
AgentModelSpec {
|
||||
slug: "gemini-2.5-pro",
|
||||
family: "gemini",
|
||||
cli: "gemini",
|
||||
read_only_args: GEMINI_PRO_READ_ONLY,
|
||||
write_args: GEMINI_PRO_WRITE,
|
||||
model_args: &["--model", "gemini-2.5-pro"],
|
||||
description: "Use when you require huge context or multimodal grounding (repo-scale inputs, or search grounding); good for alternative architecture opinions.",
|
||||
enabled_by_default: true,
|
||||
aliases: &[],
|
||||
aliases: &["gemini-3-pro-preview", "gemini-3", "gemini3", "gemini", "gemini-2.5-pro"],
|
||||
gating_env: None,
|
||||
},
|
||||
AgentModelSpec {
|
||||
@@ -186,7 +176,7 @@ const AGENT_MODEL_SPECS: &[AgentModelSpec] = &[
|
||||
read_only_args: GEMINI_FLASH_READ_ONLY,
|
||||
write_args: GEMINI_FLASH_WRITE,
|
||||
model_args: &["--model", "gemini-2.5-flash"],
|
||||
description: "Use for fast, high-volume scaffolding, creating minimal repros/tests, or budget-sensitive operations.",
|
||||
description: "Straightforward / budget tasks: very fast for scaffolding, minimal repros/tests, or high-volume edits.",
|
||||
enabled_by_default: true,
|
||||
aliases: &["gemini-flash"],
|
||||
gating_env: None,
|
||||
|
||||
@@ -2051,7 +2051,7 @@ fn upgrade_legacy_model_slugs(cfg: &mut ConfigToml) {
|
||||
target: "code.config",
|
||||
old,
|
||||
new,
|
||||
"upgrading legacy gpt-5 model slug to gpt-5.1",
|
||||
"upgrading legacy model slug to newer default",
|
||||
);
|
||||
*field = Some(new);
|
||||
}
|
||||
@@ -2072,6 +2072,16 @@ fn upgrade_legacy_model_slug(slug: &str) -> Option<String> {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Upgrade Anthropic Opus 4.1 to 4.5
|
||||
if slug.eq_ignore_ascii_case("claude-opus-4.1") {
|
||||
return Some("claude-opus-4.5".to_string());
|
||||
}
|
||||
|
||||
// Upgrade Gemini 2.5 Pro to Gemini 3 Pro (or preview alias)
|
||||
if slug.eq_ignore_ascii_case("gemini-2.5-pro") || slug.eq_ignore_ascii_case("gemini-3-pro-preview") {
|
||||
return Some("gemini-3-pro".to_string());
|
||||
}
|
||||
|
||||
if let Some(rest) = slug.strip_prefix("test-gpt-5-codex") {
|
||||
return Some(format!("test-gpt-5.1-codex{rest}"));
|
||||
}
|
||||
@@ -3900,7 +3910,6 @@ model_verbosity = "high"
|
||||
assert!(enabled_names.contains("code-gpt-5.1-codex-max"));
|
||||
assert!(enabled_names.contains("claude-sonnet-4.5"));
|
||||
assert!(enabled_names.contains("gemini-3-pro"));
|
||||
assert!(enabled_names.contains("gemini-2.5-pro"));
|
||||
assert!(enabled_names.contains("qwen-3-coder"));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -3,13 +3,13 @@ use code_core::agent_defaults::agent_model_spec;
|
||||
#[test]
|
||||
fn gemini_specs_use_long_model_flag() {
|
||||
let latest = agent_model_spec("gemini-3-pro").expect("spec present");
|
||||
assert_eq!(latest.model_args, ["--model", "gemini-3-pro-preview"]);
|
||||
// Legacy shorthand should resolve to the newest Gemini 3 Pro.
|
||||
assert_eq!(latest.model_args, ["--model", "gemini-3-pro"]);
|
||||
// Legacy shorthand and older slugs should resolve to the newest Gemini 3 Pro.
|
||||
let alias = agent_model_spec("gemini").expect("alias present");
|
||||
assert_eq!(alias.slug, "gemini-3-pro");
|
||||
|
||||
let pro = agent_model_spec("gemini-2.5-pro").expect("spec present");
|
||||
assert_eq!(pro.model_args, ["--model", "gemini-2.5-pro"]);
|
||||
let legacy = agent_model_spec("gemini-2.5-pro").expect("spec present via alias");
|
||||
assert_eq!(legacy.slug, "gemini-3-pro");
|
||||
|
||||
let flash = agent_model_spec("gemini-2.5-flash").expect("spec present");
|
||||
assert_eq!(flash.model_args, ["--model", "gemini-2.5-flash"]);
|
||||
|
||||
@@ -26640,7 +26640,7 @@ Have we met every part of this goal and is there no further work to do?"#
|
||||
write_requested: Some(false),
|
||||
models: Some(vec![
|
||||
"claude-sonnet-4.5".to_string(),
|
||||
"gemini-2.5-pro".to_string(),
|
||||
"gemini-3-pro".to_string(),
|
||||
]),
|
||||
}];
|
||||
chat.auto_state.pending_agent_timing = Some(AutoTurnAgentsTiming::Blocking);
|
||||
@@ -26654,7 +26654,7 @@ Have we met every part of this goal and is there no further work to do?"#
|
||||
assert!(message.contains("Run diagnostics"));
|
||||
assert!(message.contains("Please run agent.create"));
|
||||
assert!(message.contains("write: false"));
|
||||
assert!(message.contains("Models: [claude-sonnet-4.5, gemini-2.5-pro]"));
|
||||
assert!(message.contains("Models: [claude-sonnet-4.5, gemini-3-pro]"));
|
||||
assert!(message.contains("Draft alternative fix"));
|
||||
assert!(message.contains("Focus on parser module"));
|
||||
assert!(message.contains("agent.wait"));
|
||||
|
||||
@@ -2205,7 +2205,7 @@ fn agents_toggle_claude_opus_persists_via_slash_command() {
|
||||
let overlay_initial = normalize_output(render_chat_widget_to_vt100(&mut harness, 100, 28));
|
||||
assert!(overlay_initial.contains("Agents"), "Agents overlay did not open");
|
||||
|
||||
harness.show_agent_editor("claude-opus-4.1");
|
||||
harness.show_agent_editor("claude-opus-4.5");
|
||||
|
||||
let editor_frame = normalize_output(render_chat_widget_to_vt100(&mut harness, 100, 28));
|
||||
let editor_lower = editor_frame.to_lowercase();
|
||||
@@ -2224,7 +2224,7 @@ fn agents_toggle_claude_opus_persists_via_slash_command() {
|
||||
|
||||
let overview_after_save = normalize_output(render_chat_widget_to_vt100(&mut harness, 100, 28));
|
||||
let overview_lower = overview_after_save.to_lowercase();
|
||||
assert!(overview_lower.contains("claude-opus-4.1"));
|
||||
assert!(overview_lower.contains("claude-opus-4.5"));
|
||||
assert!(overview_lower.contains("disabled"));
|
||||
|
||||
harness.send_key(make_key(KeyCode::Esc, KeyModifiers::NONE));
|
||||
@@ -2234,7 +2234,7 @@ fn agents_toggle_claude_opus_persists_via_slash_command() {
|
||||
harness.send_key(make_key(KeyCode::Down, KeyModifiers::NONE));
|
||||
let overlay_reopen = normalize_output(render_chat_widget_to_vt100(&mut harness, 100, 28));
|
||||
let reopen_lower = overlay_reopen.to_lowercase();
|
||||
assert!(reopen_lower.contains("claude-opus-4.1"));
|
||||
assert!(reopen_lower.contains("claude-opus-4.5"));
|
||||
assert!(reopen_lower.contains("disabled"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user