[Bug] extra_skill_dirs does not expand Windows-style ~\ paths

Đang mở
#5,059 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
25/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

Hướng nghiên cứu

Read resolveConfiguredDir in packages/agent-core-v2/src/features/skill/catalog/skillRoots.ts and the existing coverage in packages/agent-core-v2/test/features/skill/catalog/skillRoots.test.ts. Check how configured paths beginning with ~/ are expanded, then run the skill roots tests with a ~\\notes case. Done means the Windows-style path resolves under the home directory and the regression test passes. The author says they already have a local fix and asks maintainers to approve before opening a PR.

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

Mô tả

What version of Kimi Code is running?

2.6.3 (source main snapshot, 2026-11-18). Reproduces in the repository's unit tests without a login.

Which open platform/subscription were you using?

None involved.

Which model were you using?

None involved.

What platform is your computer?

Windows 11 x64.

What issue are you seeing?

extra_skill_dirs supports ~ and ~/, but not the Windows-style ~\.

With extra_skill_dirs = ["~\\notes"], the path is resolved relative to the project root as a literal ~ directory instead of the user's home directory, so the skill directory is never discovered.

What steps can reproduce the bug?
  1. Create C:\Users\<name>\notes and put a skill under it.

  2. In config.toml, set:

    extra_skill_dirs = ["~\\notes"]
    
  3. Start Kimi in a git repository and check the skill catalog.

  4. ~\notes is resolved as <project>/~\notes (which does not exist), so the skill is missing.

A unit test reproduces the same behavior in packages/agent-core-v2/test/features/skill/catalog/skillRoots.test.ts:

const roots = await configuredRoots(['~\\notes'], root, homeDir, 'extra');
// before the fix: roots is []
What is the expected behavior?

Paths beginning with ~\ should expand to the user's home directory, the same way ~/ does.

Additional information

Root cause: resolveConfiguredDir in packages/agent-core-v2/src/features/skill/catalog/skillRoots.ts only checks dir.startsWith('~/').

Proposed fix: also accept dir.startsWith('~\\') and join the remainder with osHomeDir.

I have a local fix and a regression test ready. Please /approve this issue if you want me to open a PR.

Contribution
  • I am willing to submit a PR for this bug fix myself (please wait for maintainer approval in this issue first)
Ngôn ngữ chính
TypeScript
Star
8.3k
Fork
1.4k
Merge trung bình
12 giờ 6 phút
Pull request đã merge (30 ngày)
596

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 MoonshotAI/kimi-code

Tất cả issue của MoonshotAI/kimi-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.