TUI: saveResult.queue.test.ts hard-codes POSIX paths, so coverage:tui fails on Windows (not covered by #2748)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 90/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Tệp kiểm thử clients/tui/tests/saveResult.queue.test.ts hard-code các đường dẫn POSIX; hãy chỉnh sửa nó để import resolve từ node:path và sử dụng nó trong bốn assertions. Chạy npx vitest run __tests__/saveResult.queue.test.ts trong clients/tui và npm run check. Hoàn thành khi cả hai test pass trên Windows trong khi hành vi POSIX không đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Which version line?
v2 — current (@modelcontextprotocol/inspector@latest)
Which client?
TUI
Inspector version
2.12.0 (v2/main at 72126af)
Node version
v24.14.0
Operating system (and browser, for the web client)
Windows 11 Home 10.0.26200 (PowerShell and Git Bash); npm 11.9.0 (CI pins 11.20.0)
Transport
Not applicable / never connected
MCP server under inspection
Not applicable. This is a unit-test failure; no server is involved.
Steps to reproduce
- On Windows 11 with Node 24:
git clone --branch v2/main https://github.com/modelcontextprotocol/inspector.git, thencd inspector && npm ci cd clients/tuinpx vitest run __tests__/saveResult.queue.test.ts(ornpm run coverage:tuifrom the repo root)
Expected behavior
Both tests in saveResultToFile queueing (#2571) pass on every platform, because coverage:tui is a stage of npm run local:gate.
Actual behavior
2 of 2 tests fail. saveResultToFile resolves its target with node:path resolve(cwd, path), so with cwd = "/d" the mocked writeFile receives D:\d\a.json, but the test asserts the literal "/d/a.json":
starts each write only after the previous one has settled:AssertionError: expected [ 'D:\d\a.json' ] to deeply equal [ '/d/a.json' ]a failed save does not hold up the ones queued after it:AssertionError: expected [] to have a length of 1 but got +0. This one is a consequence, not a second bug: the first test throws before it settles its mocked write, the module-scopesaveQueueinsrc/utils/saveResult.tsstays blocked behind it, andwritesis empty in the second test.
Full npm run coverage:tui on Windows: 1 failed file, 2 failed tests of 639. #2748 lists test:scripts, coverage:web and coverage:mcpdo as the Windows failures; this stage is not in it, and the gate chain aborts before reaching it.
Logs, errors, or screenshots
AssertionError: expected [ 'D:\d\a.json' ] to deeply equal [ '/d/a.json' ]
AssertionError: expected [] to have a length of 1 but got +0
Already prototyped a fix?
Prompt (reconstructed: the change was made interactively with Claude Code on my clone, not from one stored prompt; this prompt reproduces it):
In clients/tui/tests/saveResult.queue.test.ts the expected paths are POSIX literals ("/d/a.json", "/d/b.json", "/d/x.json", "/d/y.json") but saveResultToFile in clients/tui/src/utils/saveResult.ts builds its target with node:path resolve(cwd, path), so on Windows the mocked writeFile receives "D:\d\a.json" and both tests fail. Change only the test: import { resolve } from "node:path", add const inD = (name: string) => resolve("/d", name), and use inD("a.json") etc. in the four assertions. Do not change the source, do not skip on win32, do not mock node:path. Then run
npx vitest run __tests__/saveResult.queue.test.tsandnpm run checkin clients/tui, andnpm run coverage:tuifrom the root.
Verified: before, npm run coverage:tui on Windows 11 / Node 24.14 gave 2 failed of 639. After: 48 files, 640 tests pass; coverage S 97.51 / B 94.75 / F 97.68 / L 97.83; npm run check in clients/tui exits 0. On POSIX resolve("/d", "a.json") is "/d/a.json", so the assertions are unchanged there (I could not run Linux locally). The change is 12 insertions and 4 deletions in the one test file. For reference only, it is on my fork (I am not opening a PR, per CONTRIBUTING): https://github.com/modelcontextprotocol/inspector/compare/v2/main...Sonica-B:inspector:v2/fix/tui-save-queue-test-windows-paths
AI disclosure (MCP AI_POLICY.md): this report and the fix were produced primarily with Claude Code running on my machine: the Windows test runs, the root-cause analysis, the 16-line test change, and the drafting of this issue.
Before you submit
- I searched existing issues and this is not a duplicate.
- This is not a security vulnerability report (those go through the private advisory process).
- Ngôn ngữ chính
- TypeScript
- Star
- 11.2k
- Fork
- 1.6k
- Merge trung bình
- 4 giờ 55 phút
- Pull request đã merge (30 ngày)
- 151
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 modelcontextprotocol/inspector
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/inspector#2859 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
modelcontextprotocol/inspector#2846 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
modelcontextprotocol/inspector#2845 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
modelcontextprotocol/inspector#2844 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CLI: OAuth denials and other non-usage failures exit 1 with code "error", the same as a usage errorĐang mởbug v2
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
modelcontextprotocol/inspector#2842 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/inspector
Issue tương tự
-
Parallel reticle_verify opens per-flow leases without the source lease's ignoreHTTPSErrorsCó thể đã có người làm @as992949791 đã nhận hôm nay. Đang mởgood first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
reticlehq/reticle#2033 · 1 bình luận ·
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 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:quality p3-medium ready-for-agent type:docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
fderuiter/deruiter.dev#3589 · 1 bình luận ·
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 75/100
manfredsteyer/angular-oauth2-oidc#1514 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
marmelab/react-admin#11431 ·
Maintainer thường phản hồi trong vòng 1 ngày