Skip to content

fix(desktop): dedupe Windows MCP project paths - #1167

Closed
toBerlinWay wants to merge 1 commit into
NanmiCoder:mainfrom
toBerlinWay:fix/windows-mcp-project-paths
Closed

fix(desktop): dedupe Windows MCP project paths#1167
toBerlinWay wants to merge 1 commit into
NanmiCoder:mainfrom
toBerlinWay:fix/windows-mcp-project-paths

Conversation

@toBerlinWay

@toBerlinWay toBerlinWay commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

TL;DR

修复 Windows 下同一个项目因为路径写法不同(C:\...C:/...),在 MCP 面板重复出现的问题。现在这两种路径会被认作同一个项目,不会再出现两个条目一起启用或禁用的情况。

改动点

  1. 统一 Windows 路径判断:比较项目时,C:\...C:/... 会按同一路径处理。
  2. 保留原始路径:只在内部比较时统一分隔符,界面显示和接口调用仍使用原路径。
  3. 避免误合并:不同项目里的同名 MCP 仍然分开;Linux 和 macOS 路径不受影响。

测试

  • 补了 4 组回归测试,覆盖路径重复、不同路径写法下的状态更新、不同项目里的同名 MCP,以及 POSIX 文件名中的反斜杠。
  • 相关测试 23/23 通过,TypeScript 检查和构建通过。
  • 本地全量桌面测试中,本次改动涉及的测试通过;另外 12 个失败来自已有的 Windows 软链接和主题测试。
  • 同一提交的 GitHub PR Quality run 30685257865 全部通过。
  • 转为 Ready 后的重跑中,桌面检查通过,改动行覆盖率为 100%(17/17);共享覆盖率任务没有发现根目录测试文件(0/254),因此该轮总检查失败。

Fixes #1165

Feature Quality Contract

  • Changed surface: desktop
  • Changed files:
    • desktop/src/stores/mcpStore.ts
    • desktop/src/__tests__/mcpStoreKnownProjects.test.ts
  • Tests added or updated:
    • Windows separator variants, mixed-separator updates, same-named servers in different projects, and POSIX filenames containing backslashes.
  • Coverage evidence:
    • Changed lines: 100% (17/17).
    • Targeted LCOV: artifacts/coverage/issue-1165-targeted/lcov.info.
    • Full local report: artifacts/coverage/2026-08-01T05-01-42-495Z/coverage-report.md.
  • E2E / live-model evidence:
    • Not run. This is desktop store logic covered with mocked MCP responses.
  • Known risk / rollback:
    • Drive-letter case and trailing separators are outside this fix. Revert f334817f to restore the previous behavior.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

PR quality triage

Changed areas: area:desktop

CLI core policy: No CLI-core policy block detected.

Missing-test policy: No missing-test policy block detected.

Coverage baseline policy: No coverage-baseline policy block detected.

CLI core files:

  • none

Coverage policy files:

  • none

Required check plan:

  • See PR Quality / scope-plan; it is the single source of truth for selected jobs.

Test coverage signals:

  • No obvious missing-test signal from changed paths.

Risk notes:

  • Desktop state/API layer changed: verify store persistence, WebSocket behavior, and startup errors.

Hard merge gates come from the deterministic GitHub Actions contract lanes above.

@toBerlinWay
toBerlinWay marked this pull request as ready for review August 1, 2026 09:29
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 1, 2026
@NanmiCoder

Copy link
Copy Markdown
Owner

感谢你的贡献哈!这个问题我已经修复过了,下个版本会发布。下次可以看一下 issue,如果 issue 状态在“进行中”的话,证明我正在修。

image

Copy link
Copy Markdown
Contributor Author

感谢提醒,下次会先确认 Issue 状态再动手,这两个 PR 我先关掉了。

@toBerlinWay toBerlinWay closed this Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:desktop size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 最新版本,定义重启MCP后是能出现了,但是又有新的BUG

2 participants