Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions src-tauri/src/agent/providers/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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,
Expand Down Expand Up @@ -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",
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -562,6 +571,33 @@ 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(
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub enum Commands {
save_transcript: Option<String>,

/// 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<String>,

/// Provider to use for the query
Expand Down
Loading