From 5e24de396174aa03ac478c7eab60d9fa63896793 Mon Sep 17 00:00:00 2001 From: Lacy Morrow Date: Mon, 27 Jul 2026 09:21:51 -0400 Subject: [PATCH 1/2] feat(LAC-3106): add Claude Opus 5 and set it as default Anthropic model Claude Opus 5 (`claude-opus-5`) was released 2026-07-24 as the new flagship Opus-tier model (Opus-4.8 pricing, adaptive thinking, 1M context). Verified against live Anthropic model docs per the weekly model-update check. - Add CLAUDE_OPUS_5 constant to model_ids - Include it in OPUS_4_5_PLUS_MODELS so it uses the 2025-11-24 computer-use beta (computer_20251124 + text_editor_20250728) - List it first and mark it the sole recommended (default) Anthropic model; demote Opus 4.8 to non-recommended - Update the empty-definitions fallback constant to Opus 5 - Add tests: default-model selection and tool-type remapping - Refresh stale CLI --model help example (claude-opus-4-7 -> claude-opus-5) Frontend needs no change: model selectors are populated dynamically via get_provider_models (zero hardcoded IDs). Verified with cargo test on the agent::providers::types module (13/13 pass). Co-Authored-By: Claude Opus 4.8 (1M context) --- src-tauri/src/agent/providers/types.rs | 37 ++++++++++++++++++++++++-- src-tauri/src/cli/mod.rs | 2 +- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/agent/providers/types.rs b/src-tauri/src/agent/providers/types.rs index 01f705e8..240d33a6 100644 --- a/src-tauri/src/agent/providers/types.rs +++ b/src-tauri/src/agent/providers/types.rs @@ -5,6 +5,7 @@ pub mod model_ids { // Anthropic Claude Models — Current Generation pub const CLAUDE_FABLE_5: &str = "claude-fable-5"; + pub const CLAUDE_OPUS_5: &str = "claude-opus-5"; pub const CLAUDE_OPUS_4_8: &str = "claude-opus-4-8"; pub const CLAUDE_OPUS_4_7: &str = "claude-opus-4-7"; pub const CLAUDE_SONNET_5: &str = "claude-sonnet-5"; @@ -24,6 +25,7 @@ pub mod model_ids { /// These also support high-resolution screenshots up to 2,576px. pub const OPUS_4_5_PLUS_MODELS: &[&str] = &[ CLAUDE_FABLE_5, + CLAUDE_OPUS_5, CLAUDE_OPUS_4_8, CLAUDE_OPUS_4_5, CLAUDE_OPUS_4_6, @@ -189,6 +191,13 @@ impl Provider { Provider::Anthropic => { &[ // Current generation + ModelDefinition { + id: model_ids::CLAUDE_OPUS_5, + name: "Claude Opus 5", + category: ModelCategory::ComputerUse, + supports_computer_use: true, + is_recommended: true, + }, ModelDefinition { id: model_ids::CLAUDE_FABLE_5, name: "Claude Fable 5", @@ -201,7 +210,7 @@ impl Provider { name: "Claude Opus 4.8", category: ModelCategory::ComputerUse, supports_computer_use: true, - is_recommended: true, + is_recommended: false, }, ModelDefinition { id: model_ids::CLAUDE_OPUS_4_7, @@ -369,7 +378,7 @@ impl Provider { .unwrap_or_else(|| { // Fallback constants if no definitions exist (shouldn't happen) match self { - Provider::Anthropic => model_ids::CLAUDE_OPUS_4_6, + Provider::Anthropic => model_ids::CLAUDE_OPUS_5, Provider::OpenAI => model_ids::OPENAI_CUA, Provider::Rig => model_ids::OPENAI_CUA, Provider::Gemini => model_ids::GEMINI_2_5_COMPUTER_USE_PREVIEW, @@ -562,6 +571,30 @@ mod tests { assert_eq!(editor, "text_editor_20250728"); } + #[test] + fn test_resolve_tool_type_opus_5_remaps() { + let computer = Provider::Anthropic.resolve_tool_type( + "computer", + "computer_20250124", + model_ids::CLAUDE_OPUS_5, + ); + assert_eq!(computer, "computer_20251124"); + + let editor = Provider::Anthropic.resolve_tool_type( + "str_replace_based_edit_tool", + "text_editor_20250429", + model_ids::CLAUDE_OPUS_5, + ); + assert_eq!(editor, "text_editor_20250728"); + } + + #[test] + fn test_opus_5_is_default_anthropic_model() { + // Claude Opus 5 is the current-generation flagship and must be the + // recommended/default Anthropic model (see LAC-3106). + assert_eq!(Provider::Anthropic.default_model(), model_ids::CLAUDE_OPUS_5); + } + #[test] fn test_resolve_tool_type_fable_5_remaps() { let computer = Provider::Anthropic.resolve_tool_type( diff --git a/src-tauri/src/cli/mod.rs b/src-tauri/src/cli/mod.rs index a0b34d42..01490ba3 100644 --- a/src-tauri/src/cli/mod.rs +++ b/src-tauri/src/cli/mod.rs @@ -92,7 +92,7 @@ pub enum Commands { save_transcript: Option, /// Model to use for the query - #[arg(long, help = "AI model to use (e.g., claude-opus-4-7)")] + #[arg(long, help = "AI model to use (e.g., claude-opus-5)")] model: Option, /// Provider to use for the query From 39293f3a97f9507df5190abe4beba91c459632f6 Mon Sep 17 00:00:00 2001 From: Lacy Morrow Date: Mon, 27 Jul 2026 09:24:15 -0400 Subject: [PATCH 2/2] style(LAC-3106): cargo fmt on Opus 5 default-model test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrap the assert_eq! in test_opus_5_is_default_anthropic_model to satisfy rustfmt line width — preempts the CI Rust (fmt) gate. Co-Authored-By: Claude Opus 4.8 (1M context) --- src-tauri/src/agent/providers/types.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/agent/providers/types.rs b/src-tauri/src/agent/providers/types.rs index 240d33a6..6977146f 100644 --- a/src-tauri/src/agent/providers/types.rs +++ b/src-tauri/src/agent/providers/types.rs @@ -592,7 +592,10 @@ mod tests { fn test_opus_5_is_default_anthropic_model() { // Claude Opus 5 is the current-generation flagship and must be the // recommended/default Anthropic model (see LAC-3106). - assert_eq!(Provider::Anthropic.default_model(), model_ids::CLAUDE_OPUS_5); + assert_eq!( + Provider::Anthropic.default_model(), + model_ids::CLAUDE_OPUS_5 + ); } #[test]