[Feature] lithe-mcp 新旧协议回归测试随 #1799 删除后无替代:mcp-protocol.json 无读取方且工具数仍写 17
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust, typescript
Hướng nghiên cứu
Read the protocol contract at rust/contracts/ide-api/v1.md, the existing fixture at rust/fixtures/ide-api/mcp-protocol.json, and rust/crates/ide-host/src/bin/lithe-mcp.rs to understand the current list_tools behavior. Add an integration test in rust/crates/ide-host that launches lithe-mcp over stdio for each fixture mode and checks the protocol metadata and exposed tools. Update the fixture and contract validation command; done means the test covers all three modes and passes on Windows and macOS.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem to solve / 要解决的问题
Core(Lithe-IDEA/Lithe-core-rust)的 rust/fixtures/ide-api/mcp-protocol.json 已经没有读取方。契约声称的 MCP 协议验证也已经不存在。
- 以前读取它的是
scripts/ide-mcp/test-ide-mcp.mjs,#1549 起用它在独立的 stdio 会话里分别验证 legacy(2025-11-25)和 modern(2026-07-28)客户端的tools/list都带ttlMs: 0、cacheScope: "private",是 #1544 / #1545 的回归测试。这个脚本在 #1799(0faecba49)随旧客户端一起删除,之后没有补上替代测试。 - 判定依据:在 Core main
5e69a21和本仓库 maine813e609e全仓库搜索mcp-protocol、providerTools、modernProtocolVersion、test-ide-mcp(含.github/workflows),只命中文档和功能矩阵:- Core
rust/contracts/ide-api/v1.md第 91 行写着 “legacy and modern clients are verified in separate stdio sessions usingrust/fixtures/ide-api/mcp-protocol.json”,第 210 行的验证命令仍是node --test scripts/ide-mcp/test-ide-mcp.mjs。 - Core
rust/contracts/rust-core-api.md第 461 行、本仓库docs/viva-migration.md第 457 行只是提到它。 - 本仓库
shared/platform-feature-matrix/features/ide-mcp-connection.json第 63 行把已删除的脚本列为证据。
- Core
rust/crates/ide-host现有测试(catalog.rs、lib.rs、failure_log.rs的单元测试)覆盖工具目录收窄、参数校验和 broker 调度,没有一个测试启动lithe-mcp完成 MCP 握手。src/bin/lithe-mcp.rs里list_tools的with_ttl_ms(0)和with_cache_scope(CacheScope::Private)没有任何测试保护。- fixture 内容也已过时:
toolCount: 17是 Core #23(78c065d)删掉lithe_environment_inspect/configure和 4 个lithe_maven_*工具之前的数量;现在catalog::tools()和host-tool-exposure.json中 macOS、Windows 两端都是 11 个工具。
保留现状的代价:
- 升级 rmcp(现在固定
=3.5.0)或修改list_tools时,2026-07-28 客户端整体拒连的问题(#1544 / #1545)可能再次出现,而 CI 发现不了。 - 契约和功能矩阵写的验证方式实际不存在。
toolCount: 17会误导维护者。- Agent 设计 #2407 第二阶段要新增
lithe_sessions_search/lithe_sessions_read,届时没有可以同步更新的协议测试。
Proposed solution / 建议方案
- 在
rust/crates/ide-host加集成测试(与二进制一样要求mcpfeature)。用测试临时目录生成连接描述,通过 stdio 启动lithe-mcp,按 fixture 的三种modes(legacy、modern、modern-after-initialize)各开一个会话完成握手,断言:tools/list带ttlMs: 0和cacheScope: "private";- 工具数等于
catalog::tools()在该连接的toolExposure下给出的数量; providerTools列出的工具都在目录里。
测试不需要真实 IDE。
- 修正 fixture:
toolCount改为 11,或者删掉这个字段,改由测试从目录算出,避免以后再次过时。 - 把
v1.md第 91、210 行的验证说明改成新的cargo test命令,ide-mcp-connection.json的证据换成新测试的路径。
风险:测试要等待子进程启动,必须按 write-stable-tests 使用有界等待和超时,并在测试结束时回收进程;Windows 上也要运行。
Target platform / 目标平台
Cross-platform / 跨平台
Area / 模块
AI
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
Alternatives considered / 已考虑的替代方案
删除 mcp-protocol.json,同时删掉契约里关于新旧客户端验证的说明。不推荐:#1544 / #1545 是真实发生过的兼容问题,删掉之后这条回归就完全没有保护。
Additional context / 补充信息
- 相关:#1544、#1545(缺
ttlMs/cacheScope导致拒连)、#1549(引入 fixture 和脚本)、#1799(删除脚本)、Core #23(删除 6 个工具)、#2407(Agent 设计,第二阶段新增 MCP 会话工具)。 - 本单只处理 MCP 协议测试和这个 fixture,不包括功能矩阵中其他指向 #1799 已删除文件的证据。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
- Ngôn ngữ chính
- TypeScript
- Star
- 1.8k
- Fork
- 151
- Merge trung bình
- 3 giờ 48 phút
- Pull request đã merge (30 ngày)
- 571
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của 1lck/Lithe-IDEA
-
review: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
1lck/Lithe-IDEA#2432 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
review: medium
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
1lck/Lithe-IDEA#2431 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refactor review: high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
1lck/Lithe-IDEA#2376 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ui enhancement P2 platform:cross-platform refactor review: high
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
1lck/Lithe-IDEA#2365 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
review: medium
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
1lck/Lithe-IDEA#2434 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của 1lck/Lithe-IDEA
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
posit-dev/positron-sas-extension#196 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug composer
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
inmanta/web-console#8037 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: AlFajer Palestine FHDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: v5 dist/types/components.d.ts imports @stencil/core/runtime instead of ./stencil-public-runtimeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày