Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

test: MCP tests fail when the developer's ~/.claude.json has MCP servers (HOME is not sandboxed)

Đang mở Phù hợp với người mới
#1,386 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/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ệ
typescript
Lĩnh vực
cli, testing-qa

Hướng nghiên cứu

Bắt đầu với test/preload.ts và kiểm tra cách cơ chế phát hiện MCP lấy HOME, sau đó xem lại test/mcp/headers.test.ts và test/server/httpapi-mcp.test.ts. Đảm bảo bộ kiểm thử sử dụng một thư mục home biệt lập để cấu hình MCP của nhà phát triển không thể ảnh hưởng đến việc phát hiện. Chạy các bài kiểm thử đó khi có và khi không có ~/.claude.json thực được điền nội dung, sau đó xác minh kết quả được báo cáo là 15/15.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Found while running the full suite for the v0.12.4 release.

test/mcp/headers.test.ts (5 tests) and test/server/httpapi-mcp.test.ts ("serves status endpoint") fail on any machine whose real ~/.claude.json has an entry under mcpServers. MCP discovery reads that file from the real $HOME, so the discovered server is created alongside the test's own servers: it has no requestInit, which breaks the headers assertions, and it changes the status endpoint's result.

test/preload.ts sandboxes the XDG directories but not HOME, so other home-directory config sources may leak the same way.

Reproduced on main (93fe816e20). With HOME pointed at an empty temporary directory, the same three files pass (15/15).

Suggested fix: point HOME (or the discovery's home-directory lookup) at a temporary directory in test/preload.ts, or have MCP discovery honour a test override, so the suite never reads the developer's own editor and assistant configs.

Ngôn ngữ chính
TypeScript
Star
810
Fork
121
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
57

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AltimateAI/altimate-code

Tất cả issue của AltimateAI/altimate-code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.