Skip to content

fix(claude-desktop): 修复健康检查 400 和官方供应商复制报错#3537

Open
Eunknight wants to merge 2 commits into
farion1231:mainfrom
Eunknight:fix/claude-desktop-stream-check-and-official-duplicate
Open

fix(claude-desktop): 修复健康检查 400 和官方供应商复制报错#3537
Eunknight wants to merge 2 commits into
farion1231:mainfrom
Eunknight:fix/claude-desktop-stream-check-and-official-duplicate

Conversation

@Eunknight
Copy link
Copy Markdown
Contributor

@Eunknight Eunknight commented Jun 1, 2026

概述

Claude Desktop 模块的两个关联修复:

1. 健康检查对第三方供应商返回 400

image

根因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 供应商报错

image

根因:官方供应商的 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.tsxonDuplicate 改为可选;未传时禁用按钮
  • src/components/providers/ProviderCard.tsx — 官方 Claude Desktop 供应商不传 onDuplicate

验证

  • pnpm typecheck 通过
  • cargo check 通过
  • MiMo Token Plan 健康检查返回 200,使用 mimo-v2.5-pro
  • 官方 Claude Desktop 供应商复制按钮禁用

… 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.
@Eunknight Eunknight changed the title fix(claude-desktop): stream check model fallback and disable official duplicate fix(claude-desktop): 修复健康检查 400 和官方供应商复制报错 Jun 1, 2026
@farion1231
Copy link
Copy Markdown
Owner

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src-tauri/src/services/stream_check.rs
Comment thread src/components/providers/ProviderActions.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants