Skip to content

fix(rc): display symlinked directories in HostFolderBrowser (#5296) - #5360

Open
markankamaransheogarat-sys wants to merge 5 commits into
MoonshotAI:mainfrom
markankamaransheogarat-sys:fix/rc-folder-picker-symlink-dirs-5296
Open

markankamaransheogarat-sys wants to merge 5 commits into
MoonshotAI:mainfrom
markankamaransheogarat-sys:fix/rc-folder-picker-symlink-dirs-5296

Conversation

@markankamaransheogarat-sys

Copy link
Copy Markdown

Fixes #5296

Summary

  • packages/agent-core-v2/src/app/hostFolderBrowser/hostFolderBrowserService.ts: Update HostFolderBrowser.browse() so dirent.isSymbolicLink() entries are checked via stat(entryPath) and included when targetStat.isDirectory() is true. Broken symlinks, circular symlink loops (ELOOP), permission errors, and file symlinks are skipped without failing directory browsing.
  • packages/agent-core-v2/test/app/hostFolderBrowser/hostFolderBrowserService.test.ts: Add unit test verifying internal/external directory symlinks are listed and navigable while file, broken, and looped symlinks are ignored.
  • .changeset/rc-folder-picker-symlinks.md: Add patch changesets for @moonshot-ai/agent-core-v2, @moonshot-ai/kimi-code-sdk, @moonshot-ai/kimi-code, kimi-code-app, and kimi-code.

Verification

  • pnpm --filter @moonshot-ai/agent-core-v2 test test/app/hostFolderBrowser/hostFolderBrowserService.test.ts -> 1/1 passed
  • pnpm --filter @moonshot-ai/agent-core-v2 typecheck -> passed

@changeset-bot

changeset-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 81d16d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@moonshot-ai/kimi-code Patch
kimi-code-app Patch
kimi-code Patch
@moonshot-ai/agent-core-v2 Patch
@moonshot-ai/kap-server Patch
@moonshot-ai/kimi-code-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T14:10:03.039584Z dd21a01 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5560eb6505

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

entries.push({ name: d.name, path: entryPath, is_dir: true as const });
}
} catch {
// Ignore broken symlinks, loops (ELOOP), or unreadable targets.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the new TypeScript comment

This newly added explanatory comment violates the repository-wide prohibition on comments in JS/TS source. packages/agent-core-v2 is currently excluded from the automated comment checker, but that only means CI will not catch this violation; delete the comment and express the tolerated error cases through naming, control flow, or tests instead.

AGENTS.md reference: AGENTS.md:L82-L83

Useful? React with 👍 / 👎.

Comment on lines +54 to +56
} catch {
// Ignore broken symlinks, loops (ELOOP), or unreadable targets.
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Propagate unexpected stat failures

When stat() fails for a process or filesystem condition other than the intentionally tolerated broken, looped, or unreadable-link cases (for example EIO, ENOMEM, or EOVERFLOW), this unconditional catch converts the browse into a successful response with the symlink silently omitted. That makes an operational failure indistinguishable from a non-directory link and gives the user no way to report it; inspect the errno and suppress only the expected per-link failures while propagating the rest.

AGENTS.md reference: AGENTS.md:L212-L214

Useful? React with 👍 / 👎.

Comment thread .changeset/rc-folder-picker-symlinks.md Outdated
Comment on lines +2 to +6
"@moonshot-ai/agent-core-v2": patch
"@moonshot-ai/kimi-code-sdk": patch
"@moonshot-ai/kimi-code": patch
"kimi-code-app": patch
"kimi-code": patch

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add a kap-server changeset entry

This package list omits @moonshot-ai/kap-server, even though the externally visible behavior being changed is the public /api/v1/fs:browse route implemented in packages/kap-server/src/routes/workspaceFs.ts:72-85. The repository delegates changeset review to .agents/skills/gen-changesets/SKILL.md, whose public-KAP rule requires the owning package to receive an entry, so the server can otherwise ship this behavior change without its own version bump or changelog record.

AGENTS.md reference: AGENTS.md:L190-L190

Useful? React with 👍 / 👎.

markankamaransheogarat-sys added a commit to markankamaransheogarat-sys/kimi-code that referenced this pull request Nov 24, 2026
@markankamaransheogarat-sys

Copy link
Copy Markdown
Author

Addressed all 3 Codex Review notes in dd21a01d5:

  • Removed the inline TypeScript comment in hostFolderBrowserService.ts.
  • Only ignore expected symlink-resolution errors (ENOENT, ENOTDIR, ELOOP, EACCES, EPERM) during stat(entryPath); unexpected errors are rethrown.
  • Added @moonshot-ai/kap-server to .changeset/rc-folder-picker-symlinks.md.

Verified:

  • pnpm --filter @moonshot-ai/agent-core-v2 test test/app/hostFolderBrowser/hostFolderBrowserService.test.ts -> 1/1 passed
  • pnpm --filter @moonshot-ai/agent-core-v2 typecheck -> passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd21a01d55

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .changeset/rc-folder-picker-symlinks.md Outdated
Comment on lines +2 to +5
"@moonshot-ai/agent-core-v2": patch
"@moonshot-ai/kap-server": patch
"@moonshot-ai/kimi-code-sdk": patch
"@moonshot-ai/kimi-code": patch

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Split library and product changesets

When Changesets generates releases, this one Remote Control sentence will be copied into the changelogs of three libraries and three products. AGENTS.md delegates this check to .agents/skills/gen-changesets/SKILL.md, which requires technical library entries and a separate user-facing product file for propagated changes; split the library packages from the affected products so each audience receives the correct release note.

AGENTS.md reference: AGENTS.md:L190-L190

Useful? React with 👍 / 👎.

await rm(dir, { recursive: true, force: true });
}
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add a regression test for unexpected stat errors

If stat errors are swallowed again, this sole test still passes because it exercises only successful directory links plus intentionally ignored broken, looped, and file links; the previous catch-all therefore satisfies every assertion here. Add a fault-injected case such as EIO that asserts browse() rejects, so the regression test actually fails on the behavior this follow-up corrected.

AGENTS.md reference: AGENTS.md:L61-L61

Useful? React with 👍 / 👎.

markankamaransheogarat-sys added a commit to markankamaransheogarat-sys/kimi-code that referenced this pull request Nov 26, 2026
@pkg-pr-new

pkg-pr-new Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@81d16d6
npx https://pkg.pr.new/@moonshot-ai/kimi-code@81d16d6

commit: 81d16d6

markankamaransheogarat-sys added a commit to markankamaransheogarat-sys/kimi-code that referenced this pull request Nov 26, 2026
@markankamaransheogarat-sys
markankamaransheogarat-sys force-pushed the fix/rc-folder-picker-symlink-dirs-5296 branch from f3f7fc4 to 81d16d6 Compare November 26, 2026 11:40

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant