From cfa4602187daf954f86df7d795a9afc1b0804194 Mon Sep 17 00:00:00 2001 From: Marenz Date: Fri, 20 Feb 2026 20:54:35 +0100 Subject: [PATCH 1/2] Route MiniMax through OpenAI-compatible endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MiniMax was configured as ApiType::Anthropic, but build_anthropic_request hardcodes api.anthropic.com. Requests were sent to Anthropic with a MiniMax key, producing 401 invalid x-api-key. Switch to ApiType::OpenAiCompletions with base_url api.minimax.io — their OpenAI-compatible endpoint works correctly. --- src/config.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index 8b3cb7d9..3485e5ea 100644 --- a/src/config.rs +++ b/src/config.rs @@ -186,7 +186,7 @@ const ANTHROPIC_PROVIDER_BASE_URL: &str = "https://api.anthropic.com"; const OPENAI_PROVIDER_BASE_URL: &str = "https://api.openai.com"; const OPENROUTER_PROVIDER_BASE_URL: &str = "https://openrouter.ai/api"; const OPENCODE_ZEN_PROVIDER_BASE_URL: &str = "https://opencode.ai/zen"; -const MINIMAX_PROVIDER_BASE_URL: &str = "https://api.minimax.io/anthropic"; +const MINIMAX_PROVIDER_BASE_URL: &str = "https://api.minimax.io"; const MOONSHOT_PROVIDER_BASE_URL: &str = "https://api.moonshot.ai"; const ZHIPU_PROVIDER_BASE_URL: &str = "https://api.z.ai/api/paas/v4"; @@ -1887,7 +1887,7 @@ impl Config { llm.providers .entry("minimax".to_string()) .or_insert_with(|| ProviderConfig { - api_type: ApiType::Anthropic, + api_type: ApiType::OpenAiCompletions, base_url: MINIMAX_PROVIDER_BASE_URL.to_string(), api_key: minimax_key, name: None, @@ -2223,7 +2223,7 @@ impl Config { llm.providers .entry("minimax".to_string()) .or_insert_with(|| ProviderConfig { - api_type: ApiType::Anthropic, + api_type: ApiType::OpenAiCompletions, base_url: MINIMAX_PROVIDER_BASE_URL.to_string(), api_key: minimax_key, name: None, From fcfe2904550b2743867302c4d5ec8070dd833e1a Mon Sep 17 00:00:00 2001 From: Marenz Date: Fri, 20 Feb 2026 20:55:00 +0100 Subject: [PATCH 2/2] Log empty Anthropic responses at warn level The debug log for empty assistant_content was invisible at default log level. Upgrade to warn so we can see stop_reason and raw content when the API returns an empty content array. --- src/llm/model.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llm/model.rs b/src/llm/model.rs index 887bb4f0..1c339fe5 100644 --- a/src/llm/model.rs +++ b/src/llm/model.rs @@ -1167,7 +1167,7 @@ fn parse_anthropic_response( } let choice = OneOrMany::many(assistant_content).map_err(|_| { - tracing::debug!( + tracing::warn!( stop_reason = body["stop_reason"].as_str().unwrap_or("unknown"), content_blocks = content_blocks.len(), raw_content = %body["content"],