Skip to content

fix(mcp): retry only unfinished batch imports - #10201

Merged
funkpopo merged 1 commit into
farion1231:mainfrom
zhiwuyazhe-fjr:codex/10198-mcp-retry-failed-imports
Dec 3, 2026
Merged

funkpopo merged 1 commit into
farion1231:mainfrom
zhiwuyazhe-fjr:codex/10198-mcp-retry-failed-imports

Conversation

@zhiwuyazhe-fjr

Copy link
Copy Markdown
Contributor

Human Note / 本人说明

我从很久很久之前就在使用 CC Switch,很想为 CC Switch 做贡献。

Summary / 概述

批量导入部分成功时,从待处理列表移除写入成功的服务器,保留失败项和原先跳过的项。用户更改「写入到」后可以重试剩余项。提交期间锁定会替换整批草稿的模板、粘贴框和清空按钮。

Related Issue / 关联 Issue

Fixes #10198

验证

使用 stdio 的 docs 和 SSE 的 events,先同时写入 Claude 与 Pi。Pi 拒绝 SSE 后取消勾选 Pi,再重试。真实表单的写入顺序从 docs → events → docs → events 变为 docs → events → events。新增组件用例也核对了原先主动跳过的条目仍可选。

将修复前后的表单参数分别回放到 McpService::upsert_server,每次使用独立的内存 SQLite 和临时 Pi 目录。修复前,重试后 docs.apps.pi 和 Pi 的 mcpServers.docs.enabled 都是 false。修复后两者都是 true,events 成功写入 Claude。

pnpm exec vitest run tests/components/McpFormModal.test.tsx

该组件文件的 17 个用例在 Windows 上通过。

本地检查

  • pnpm typecheck、pnpm format:check、pnpm build:renderer
  • 全量前端测试 4,783 项首轮通过。后台自动同步提示的集成用例单独重跑通过。

@github-actions github-actions Bot added frontend Frontend (React/TypeScript) mcp Related to MCP server management labels Dec 1, 2026

@farion1231 farion1231 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM,感谢您的贡献!

@funkpopo funkpopo closed this Dec 1, 2026
@funkpopo funkpopo reopened this Dec 1, 2026
@funkpopo

funkpopo commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

LGTM,感谢修复!

已在完成端到端 MCP 批量导入实测:第一轮勾选 Pi 提交时,docs 成功入库并自动从待导入队列移除,events 因 Pi 不支持 SSE 被拦截失败且抽屉保持开启;取消不兼容应用再次提交后,第二轮仅发送 events 单条请求并成功关闭抽屉。建议先于 #10176 合入。

@funkpopo
funkpopo merged commit f7e1274 into farion1231:main Dec 3, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Frontend (React/TypeScript) mcp Related to MCP server management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][MCP] 批量导入部分失败后更改目标并重试,会关闭已成功服务器的 Pi 配置

4 participants