diff --git a/crates/agent/src/profiles/anthropic.rs b/crates/agent/src/profiles/anthropic.rs index 34eec3c17..872c78e0d 100644 --- a/crates/agent/src/profiles/anthropic.rs +++ b/crates/agent/src/profiles/anthropic.rs @@ -138,17 +138,29 @@ in the project. Keep changes minimal and focused on the task."; } fn capabilities(&self) -> ProfileCapabilities { + let context_window_size = if self.model().contains("opus-4-6") { + 1_000_000 + } else { + 200_000 + }; ProfileCapabilities { supports_reasoning: true, supports_streaming: true, supports_parallel_tool_calls: true, - context_window_size: 200_000, + context_window_size, } } fn provider_options(&self) -> Option { let model = self.model(); - if model.contains("opus-4-6") || model.contains("sonnet-4-6") { + if model.contains("opus-4-6") { + Some(serde_json::json!({ + "anthropic": { + "thinking": {"type": "adaptive"}, + "beta_headers": ["context-1m-2025-08-07"] + } + })) + } else if model.contains("sonnet-4-6") { Some(serde_json::json!({ "anthropic": { "thinking": {"type": "adaptive"} @@ -185,6 +197,12 @@ mod tests { assert_eq!(profile.context_window_size(), 200_000); } + #[test] + fn anthropic_opus_4_6_has_1m_context_window() { + let profile = AnthropicProfile::new("claude-opus-4-6"); + assert_eq!(profile.context_window_size(), 1_000_000); + } + #[test] fn anthropic_system_prompt_contains_env_context() { let profile = AnthropicProfile::new("claude-sonnet-4-20250514"); @@ -284,6 +302,10 @@ mod tests { Some("adaptive"), "thinking type should be adaptive" ); + let beta_headers = options["anthropic"]["beta_headers"] + .as_array() + .expect("beta_headers should be an array"); + assert_eq!(beta_headers[0].as_str(), Some("context-1m-2025-08-07")); } #[test] diff --git a/crates/attractor/src/cli/run.rs b/crates/attractor/src/cli/run.rs index 87fde628c..29a790169 100644 --- a/crates/attractor/src/cli/run.rs +++ b/crates/attractor/src/cli/run.rs @@ -120,7 +120,7 @@ pub async fn run_command(args: RunArgs, styles: &'static Styles) -> anyhow::Resu .unwrap_or_else(|| match provider.as_deref() { Some("openai") => "gpt-5.2".to_string(), Some("gemini") => "gemini-3.1-pro-preview".to_string(), - _ => "claude-sonnet-4-5".to_string(), + _ => "claude-opus-4-6".to_string(), }); // 6. Build engine diff --git a/crates/attractor/src/cli/serve.rs b/crates/attractor/src/cli/serve.rs index 0adb509d9..b54be9c00 100644 --- a/crates/attractor/src/cli/serve.rs +++ b/crates/attractor/src/cli/serve.rs @@ -44,7 +44,7 @@ pub async fn serve_command(args: ServeArgs, styles: &'static Styles) -> anyhow:: let model = args.model.unwrap_or_else(|| match provider.as_deref() { Some("openai") => "gpt-5.2".to_string(), Some("gemini") => "gemini-3.1-pro-preview".to_string(), - _ => "claude-sonnet-4-5".to_string(), + _ => "claude-opus-4-6".to_string(), }); // Build registry factory diff --git a/crates/llm/src/catalog.json b/crates/llm/src/catalog.json index a438a3605..7c8b3cc9f 100644 --- a/crates/llm/src/catalog.json +++ b/crates/llm/src/catalog.json @@ -3,7 +3,7 @@ "id": "claude-opus-4-6", "provider": "anthropic", "display_name": "Claude Opus 4.6", - "context_window": 200000, + "context_window": 1000000, "max_output": 128000, "supports_tools": true, "supports_vision": true,