fix(claude-desktop): 修复健康检查 400 和官方供应商复制报错#3537
Open
Eunknight wants to merge 2 commits into
Open
Conversation
… duplicate Two related fixes for Claude Desktop: 1. Stream health check returned 400 for third-party providers (e.g. MiMo) because the test defaulted to claude-haiku-4-5-20251001, which most third-party providers do not support. Fall back to the first upstream model stored in meta.claudeDesktopModelRoutes, matching the pattern already used for OpenCode/OpenClaw/Hermes. 2. Duplicating the official Claude Desktop provider triggered a backend validation error (missing ANTHROPIC_BASE_URL) because the official provider has no real settings. The duplicate was never useful, so disable the duplicate button for the official provider instead of copying it into a broken state.
Owner
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a92a485ce1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
Claude Desktop 模块的两个关联修复:
1. 健康检查对第三方供应商返回 400
根因:
resolve_test_model()在settings_config.env.ANTHROPIC_MODEL未设置时,默认使用claude-haiku-4-5-20251001。该模型仅官方 Anthropic API 支持,所有第三方供应商(MiMo、DeepSeek、OpenRouter 等)均返回 400。修复:回退读取
meta.claudeDesktopModelRoutes中的第一个上游模型,与 OpenCode、OpenClaw、Hermes 的处理模式一致。2. 复制官方 Claude Desktop 供应商报错
根因:官方供应商的
settingsConfig为空(设计如此——使用 Claude Desktop 内置 1P 模式)。复制时调用addProvider()触发validate_direct_provider()校验,因缺少ANTHROPIC_BASE_URL而失败。修复:禁用官方 Claude Desktop 供应商的复制按钮。官方配置本身无实际凭据和设置,复制没有意义。
改动
src-tauri/src/services/stream_check.rs— 新增extract_desktop_model_from_routes()回退方法src/components/providers/ProviderActions.tsx—onDuplicate改为可选;未传时禁用按钮src/components/providers/ProviderCard.tsx— 官方 Claude Desktop 供应商不传onDuplicate验证
pnpm typecheck通过cargo check通过mimo-v2.5-pro