Skip to content

fix(agent-core-v2): follow symlinks in read and media tools#1842

Closed
7Sageer wants to merge 1 commit into
mainfrom
fix/read-tool-symlink
Closed

fix(agent-core-v2): follow symlinks in read and media tools#1842
7Sageer wants to merge 1 commit into
mainfrom
fix/read-tool-symlink

Conversation

@7Sageer

@7Sageer 7Sageer commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

Follow-up to #1840 (same root cause; that PR only covered AGENTS.md loading before it was merged).

Problem

The v2 engine's filesystem stat uses lstat semantics, so symbolic links are not counted as regular files. Two user-visible consequences in the web backend (installing files as symlinks is a common dotfiles setup):

  • The Read tool rejects symlinked files with "<path>" is not a file.
  • ReadMediaFile size checks measure the symlink itself instead of its target, so oversized media behind a symlink bypasses the size limit.

The CLI (v1 engine) follows symlinks and handles such files correctly, so CLI and web behavior diverge.

What changed

Skill discovery and MCP config loading were audited for the same problem and are not affected: they use node:fs directly, which already follows symlinks.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 25f8967

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

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code 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

@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

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

commit: 25f8967

@7Sageer

7Sageer commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #1843, which fixes the same class of symlink issues at the semantics level (stat now follows symlinks by default), making these per-call-site fixes unnecessary.

@7Sageer 7Sageer closed this Jul 17, 2026
@7Sageer
7Sageer deleted the fix/read-tool-symlink branch July 17, 2026 11:21
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.

1 participant