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

filesystem: list_directory_with_sizes reports an entry it could not stat as 0 B

Đang mở
#5,190 1 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/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
backend

Hướng nghiên cứu

Start with list_directory_with_sizes in src/filesystem/server.ts and the pinned behavior in src/filesystem/__tests__/server-tools.test.ts; the prior PR #4911 is identified as a prototype. Check how failed stat calls are handled and how the combined size is calculated. Done when an entry that cannot be stat'd is reported as unknown or as a failure and is excluded from the total, with tests covering the behavior.

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

Mô tả

bug server-filesystem v2
Problem

The list_directory_with_sizes handler in src/filesystem/server.ts catches a failed stat on an entry and substitutes a size of 0 and an mtime of the epoch. An unreadable entry, a dangling symlink, or a file removed between readdir and stat is therefore listed as 0 B and counted in the combined size, which makes it look like an empty file. src/filesystem/__tests__/server-tools.test.ts pins this behavior.

Expected

An entry that could not be stat'd is shown as unknown (or the failure is reported), rather than given an invented size, and is left out of the total. Any change to how this handler stats entries should be coordinated with other open work on the same handler.

Prior work
  • #4911 by @feiiiiii5

The PR(s) above targeted the pre-refactor code and are closed as part of the backlog triage in #4875; this issue is where the work continues, with the PR(s) as a prototype. Thank you to their authors.

Ngôn ngữ chính
TypeScript
Star
91.4k
Fork
11.8k
Merge trung bình
6 giờ 39 phút
Pull request đã merge (30 ngày)
146

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

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 modelcontextprotocol/servers

Tất cả issue của modelcontextprotocol/servers

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.