fix(agent-core-v2): make host fs stat follow symlinks and add explicit lstat#1843
Merged
Conversation
🦋 Changeset detectedLatest commit: 33a4128 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
5 tasks
commit: |
Merged
7723qqq
added a commit
to 7723qqq/kimi-code
that referenced
this pull request
Jul 20, 2026
Upstream changes: - feat(cli): replace kimi server command tree with kimi web (MoonshotAI#1826) - Removed daemon/server lifecycle (svc/ layer for launchd/systemd/schtasks) - Multi-server instance registry replaces single-writer lock - /web TUI command uses server picker instead of daemon logic - feat(minidb): switch agent-core-v2 query-store to ClusterDb with 16 shards (MoonshotAI#1907) - Multiple kimi processes can share the read model concurrently - feat: scope thinking effort to current session (MoonshotAI#1933) - feat: add thinking_effort to turn telemetry events (MoonshotAI#1916) - fix(agent-core-v2): host fs stat follows symlinks, add explicit lstat (MoonshotAI#1843) - feat(web): add cache invalidation note to model switcher (MoonshotAI#1940) - ci: release packages (MoonshotAI#1868) Conflicts resolved: - 9 modify/delete conflicts: accepted upstream deletion (server/*, svc/*) - 6 content conflicts: merged while preserving fork's i18n t() calls and fork-specific test suites (config edge cases)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
None — follow-up to #1840, supersedes #1842.
Problem
The v2 engine's
IHostFileSystem.statwas named like Node'sstatbut implementedlstatsemantics — the opposite of Node, and the opposite of the v1 engine'skaos.stat(which follows symlinks by default). Everystat.isFile/stat.isDirectorycall site written with the usual intuition silently mishandled symlinks, and the failure mode was always an invisible skip with no log or warning. This single design flaw has already produced three user-visible bugs in the web backend (a common dotfiles setup installs config/instruction files as symlinks):Readtool rejected symlinked files with"<path>" is not a file.;ReadMediaFilesize checks measured the symlink itself instead of its target.Fixing call sites one by one (#1840, #1842) does not stop new ones from re-introducing the bug, so this PR fixes the semantics at the source.
What changed
IHostFileSystem.statnow follows symlinks (Nodestat/ v1kaossemantics), and a new explicitlstatserves consumers that genuinely need link-level information. The transitionalfollowSymlinksoption added in fix(agent-core-v2): follow symlinks when loading AGENTS.md and reading files #1840 is removed again..gitdiscovery uselstat(symlink-aware behavior preserved); everything else — AGENTS.md loading,Read,ReadMediaFile, glob roots, write-parent checks, workspace validation — now follows links, matching the CLI's v1 engine. This also makes the per-call-site fixes from fix(agent-core-v2): follow symlinks in read and media tools #1842 unnecessary (closing it).Skill discovery and MCP config loading were audited and are not affected: they use
node:fsdirectly, which already follows symlinks.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.