Upgrade default Claude Opus model to 4.8

Bump the default Opus route/model from claude-opus-4-7 to claude-opus-4-8
across provider presets (claude, claudeDesktop, hermes, openclaw, opencode,
universal), i18n locales (zh/en/ja/zh-TW), pricing seed data, and the
user-manual docs.

- Add claude-opus-4-8 pricing row ($5/$25/$0.50/$6.25); keep the 4-7 row
  for historical usage stats (seeded via INSERT OR IGNORE).
- Claude Desktop proxy: accept bidirectional opus 4-7 <-> 4-8 route alias
  during rollout so previously saved routes keep resolving.
- thinking_optimizer: route opus-4-8 through adaptive thinking and normalize
  dotted model ids (also fixes dotted 4-6/4-7 falling back to legacy).
- usage_stats: normalize Bedrock/Vertex/aggregator opus-4-8 ids to base
  pricing.

Also merge role:"system" messages into the Gemini systemInstruction in the
Anthropic->Gemini transform.
This commit is contained in:
Jason
2026-05-29 12:09:33 +08:00
parent 554e3b4875
commit 0877b9e35d
27 changed files with 386 additions and 221 deletions
+8 -8
View File
@@ -7,7 +7,7 @@
//!
//! ```yaml
//! model:
//! default: "anthropic/claude-opus-4-7"
//! default: "anthropic/claude-opus-4-8"
//! provider: "openrouter"
//! base_url: "https://openrouter.ai/api/v1"
//!
@@ -19,9 +19,9 @@
//! - name: openrouter
//! base_url: https://openrouter.ai/api/v1
//! api_key: sk-or-...
//! model: anthropic/claude-opus-4-7
//! model: anthropic/claude-opus-4-8
//! models:
//! anthropic/claude-opus-4-7:
//! anthropic/claude-opus-4-8:
//! context_length: 200000
//!
//! mcp_servers:
@@ -185,7 +185,7 @@ fn find_yaml_section_range(raw: &str, section_key: &str) -> Option<(usize, usize
///
/// ```yaml
/// model:
/// default: "anthropic/claude-opus-4-7"
/// default: "anthropic/claude-opus-4-8"
/// provider: "openrouter"
/// ```
fn serialize_yaml_section(key: &str, value: &serde_yaml::Value) -> Result<String, AppError> {
@@ -1219,7 +1219,7 @@ agent:
let mut m = serde_yaml::Mapping::new();
m.insert(
serde_yaml::Value::String("default".to_string()),
serde_yaml::Value::String("claude-opus-4-7".to_string()),
serde_yaml::Value::String("claude-opus-4-8".to_string()),
);
m.insert(
serde_yaml::Value::String("provider".to_string()),
@@ -1233,7 +1233,7 @@ agent:
assert!(result.contains("agent:"));
assert!(result.contains("max_turns"));
// And the model section should be updated
assert!(result.contains("claude-opus-4-7"));
assert!(result.contains("claude-opus-4-8"));
assert!(result.contains("anthropic"));
assert!(!result.contains("gpt-4"));
assert!(!result.contains("openai"));
@@ -1517,7 +1517,7 @@ custom_providers:
assert!(get_model_config().unwrap().is_none());
let model = HermesModelConfig {
default: Some("anthropic/claude-opus-4-7".to_string()),
default: Some("anthropic/claude-opus-4-8".to_string()),
provider: Some("openrouter".to_string()),
base_url: Some("https://openrouter.ai/api/v1".to_string()),
context_length: Some(200000),
@@ -1529,7 +1529,7 @@ custom_providers:
let read_model = get_model_config().unwrap().unwrap();
assert_eq!(
read_model.default.as_deref(),
Some("anthropic/claude-opus-4-7")
Some("anthropic/claude-opus-4-8")
);
assert_eq!(read_model.provider.as_deref(), Some("openrouter"));
assert_eq!(read_model.context_length, Some(200000));