[Bug] Kimi RC workspace folder picker does not display symbolic link directories

Đang mở Phù hợp với người mới
#5,296 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

@markankamaransheogarat-sys đang làm issue này rồi.

Từ ngày 24/11/2026.

  • #5360 của @markankamaransheogarat-sys — đang mở

Đá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
62/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
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu trong packages/agent-core-v2/src/app/hostFolderBrowser/hostFolderBrowserService.ts: tìm chỗ danh sách thư mục được tạo bằng readdir và được lọc trên dirent.isDirectory(), thứ này là false đối với symlink. Thêm một nhánh thực hiện stat trên các mục symlink và bao gồm những mục phân giải thành thư mục, đồng thời nuốt lỗi đối với liên kết hỏng và đường dẫn bị vòng lặp và giữ nguyên các kiểm tra ranh giới workspace hiện có. Xong nghĩa là các thư mục symlink xuất hiện trong RC New Workspace picker và một bài kiểm thử bao phủ thư mục thường, symlink, symlink hỏng và lỗi quyền sẽ vượt qua.

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

Mô tả

bug
What version of Kimi Code is running?

2.3.2

Which open platform/subscription were you using?

kimi code

Which model were you using?

kimi-3.1-pro

What platform is your computer?

linux

What issue are you seeing?

Title

[Bug] Kimi RC workspace folder picker does not display symbolic link directories

Description

The Kimi Code Remote Control (RC) web interface does not display symbolic link (symlink) directories in the workspace folder picker.

This prevents users from creating a new workspace through the RC web UI when the desired project directory is accessed via a symbolic link.

However, the same directory works correctly when launching Kimi Code from the terminal using its symlink path.

This suggests that the issue is related to directory enumeration or symlink handling in the RC workspace folder browser, rather than the underlying filesystem or Kimi Code's ability to access the target directory.

Environment

  • Kimi Code version: 2.3.2
  • Feature: Remote Control (RC) web interface
  • Affected functionality: New Workspace → Folder Picker
  • Filesystem: Symbolic links pointing to both directories inside and outside the current parent directory

Steps to Reproduce

  1. Create a symbolic link pointing to an existing project directory.

    Example:

    ln -s /data/projects/my-project /home/user/projects/my-project
    
  2. Open the Kimi Code RC web interface.

  3. Select New Workspace.

  4. Navigate to /home/user/projects/.

  5. Observe that my-project does not appear in the folder picker.

  6. Try the same directory from the terminal:

    cd /home/user/projects/my-project
    kimi
    

    Kimi Code starts successfully from the symlink directory.

Actual Behavior

  • Symbolic link directories are missing from the RC workspace folder picker.
  • Users cannot navigate into these directories through the web interface.
  • Consequently, users cannot create a new workspace using a symlink path through RC.

This affects both:

  • Symlinks pointing to directories within the current project tree.
  • Symlinks pointing to directories outside the current project tree, such as another disk or a shared project location.

Expected Behavior

The RC workspace folder picker should:

  1. Detect symbolic links that point to valid directories.
  2. Display them as navigable directories.
  3. Allow users to enter these directories.
  4. Allow users to create workspaces using either the symbolic link path or the resolved physical path.
  5. Handle broken symlinks, symlink loops, and permission errors gracefully.
  6. Preserve existing filesystem security restrictions, especially for symlinks pointing outside permitted workspace boundaries.

Ideally, users should be able to choose between preserving the original symlink path and resolving it to the physical target path.

Possible Root Cause

The directory enumeration logic in the host folder browser may only include entries for which:

dirent.isDirectory()

returns true.

In Node.js, Dirent.isDirectory() returns false for symbolic links, even when they point to valid directories.

The directory browser should also check:

dirent.isSymbolicLink()

and use stat() to determine whether the symlink target is a directory.

Relevant source file to investigate:

packages/agent-core-v2/src/app/hostFolderBrowser/hostFolderBrowserService.ts

This is a potential root cause and should be verified against the affected release.

Suggested Fix

Update the host folder browser to recognize both regular directories and symbolic links pointing to directories.

For example:

if (dirent.isDirectory()) {
  // Include regular directories
} else if (dirent.isSymbolicLink()) {
  const targetStat = await stat(entryPath);

  if (targetStat.isDirectory()) {
    // Include symbolic link directories
  }
}

The implementation should also handle broken links, permission errors, and circular symlinks without causing directory browsing to fail.

It would be useful to preserve the original symlink path while resolving the target path internally for filesystem operations, with an option to use the physical path when registering a workspace.

Workaround

Currently, a possible workaround is to launch Kimi Code directly from the symlink directory:

cd /home/user/projects/my-project
kimi

Then use /rc from the CLI to access the existing session through the Remote Control web interface.

This avoids using the RC folder picker to create the workspace, but it does not fix the underlying issue.

Request

Could the development team investigate and fix symbolic link handling in the RC workspace folder picker?

Supporting symlink directories would make RC significantly more useful for developers who organize projects using symlinks, shared directories, mounted volumes, or multiple development environments.

Thank you!

What steps can reproduce the bug?
Environment
  • Kimi Code version: 2.3.2
  • Feature: Kimi Code Remote Control (RC) Web UI
  • Affected page: New Workspace → Folder Picker
Steps to Reproduce
  1. Create a normal project directory and two symbolic links pointing to directories inside and outside the parent directory:

    mkdir -p /tmp/kimi-test/projects/real-project
    mkdir -p /tmp/kimi-test/external-project
    
    # Symlink pointing to a directory inside the parent directory
    ln -s /tmp/kimi-test/projects/real-project \
      /tmp/kimi-test/projects/internal-link
    
    # Symlink pointing to a directory outside the parent directory
    ln -s /tmp/kimi-test/external-project \
      /tmp/kimi-test/projects/external-link
    
  2. Start Kimi Code and open the Remote Control (RC) web interface.

  3. Click New Workspace to open the folder picker.

  4. Navigate to:

    /tmp/kimi-test/projects/
    
  5. Observe that the normal directory real-project is visible, but the symbolic link directories internal-link and external-link are missing.

  6. Try accessing the same directories through the terminal:

    cd /tmp/kimi-test/projects/internal-link
    kimi
    

    Kimi Code launches successfully from the symbolic link directory.

  7. Repeat the test with external-link. The same issue occurs in the RC folder picker.

Actual Result

Symbolic link directories are not displayed in the RC workspace folder picker, so users cannot navigate into them or create workspaces through the web interface.

What is the expected behavior?
Expected Result

Both internal and external symbolic links pointing to valid directories should be displayed and navigable in the folder picker. Users should be able to create workspaces using either the symlink path or the resolved physical path.

Additional information
Additional Information

This issue occurs before a workspace or session is created, so a session ID and context usage are not applicable.

Launching Kimi Code directly from a symlink directory via the CLI works correctly. Using /rc to expose the existing CLI session through the web interface is a possible workaround.

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.