Repository navigation
perf: reduce remote file operation round trips - #4543
Conversation
🦋 Changeset detectedLatest commit: d2abf6b 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 |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f497c5099
ℹ️ 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".
| for (const file of filePaths) { | ||
| if (signal.aborted) { | ||
| const outOfTime = signal.aborted || Date.now() >= deadline; | ||
| if (outOfTime && (filesScanned > 0 || filePaths.length === 0)) { |
There was a problem hiding this comment.
Handle zero-file inventory timeouts before the scan loop
When ripgrep is unavailable and the batched walk reaches the 30-second deadline before yielding any file (for example, when files exist only beyond the partial inventory), filePaths is empty, so this loop and its only FS_GREP_TIMEOUT check never run. When the array is nonempty, this condition can only be entered after filesScanned > 0, making the nested zero-progress throw unreachable there as well; the Node fallback therefore returns a successful empty/truncated response instead of the timeout error for a zero-progress scan. Check the zero-progress timeout before entering the loop.
Useful? React with 👍 / 👎.
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Speed up file completion in remote environments without ripgrep. |
There was a problem hiding this comment.
Disclose the new fallback walk limits
The new WorkspaceFsService.walk applies 10,000-directory, 100,000-entry, 8 MiB, and per-directory 50,000-entry limits to local/ACP searches and Node-fallback suggest/grep, while the previous local recursive path had only the depth boundary. Large local workspaces can therefore now omit hits or fail with a too-many-results error, but this release note mentions only faster remote completion and does not name the behavior users lose; update it to disclose the truncation/error behavior (and any retained escape hatch).
AGENTS.md reference: AGENTS.md:L117-L117
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff2e2403b4
ℹ️ 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".
| const SUGGEST_TIMEOUT_MS = 10_000; | ||
| const SUGGEST_WALK_ABORTED = new Error('suggest walk aborted'); | ||
| const WALK_MAX_DEPTH = 64; | ||
| const WALK_DEFAULT_IGNORE = ['.git/']; |
There was a problem hiding this comment.
Preserve case-sensitive
.git exclusion when ignores are off
On case-sensitive filesystems, requests with follow_gitignore: false now feed this rule to ignore(), whose v5 default is case-insensitive, so a real directory such as .Git/ is pruned before the visitor. The replaced recursive path only skipped name === '.git' when ignores were disabled, so search and the Node grep/suggest fallbacks previously included .Git/; preserve an exact-case metadata check instead of routing the default through the case-folding matcher.
AGENTS.md reference: AGENTS.md:L127-L129
Useful? React with 👍 / 👎.
| let inventoryTruncated = false; | ||
| for (const root of roots) { | ||
| const ignoreRules = query.followGitignore ? await this.walkIgnoreFor(root.dir) : WALK_DEFAULT_IGNORE; | ||
| inventoryTruncated = await this.walk(root.dir, ignoreRules, async (relPath, _name, kind) => { |
There was a problem hiding this comment.
Stop visiting candidates after the suggestion deadline
When a batched walk resolves after the 10-second timer has fired—for example, after accumulating many entries before a slow final readdir—this callback still scores every returned entry because the first signal.aborted check is only after this.walk returns. The replaced visitor stopped before scoring each entry, so completion can now process up to the 100,000-entry batch after its deadline; check the absolute deadline during reconstruction/visiting and stop promptly.
AGENTS.md reference: AGENTS.md:L127-L129
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4023039cc2
ℹ️ 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".
| } | ||
| this.gitignoreCache.set(rootDir, ig); | ||
| return ig; | ||
| const rules = ['.git/', ...contents.split(/\r?\n/)]; |
There was a problem hiding this comment.
Make
.git pruning immune to ignore negations
When follow_gitignore is true and the root .gitignore contains !.git/ (or another later negation matching it), this ordered rule list lets that negation override the synthetic .git/ rule. The walker then inventories .git even though visitDirectory later discards it, so a large object tree can consume the 100,000-entry or 8 MiB budget and omit real workspace hits; the replaced walker performed the exact name === '.git' check before applying the matcher, so keep this as an unconditional exact-name prune instead of an overridable ignore rule.
AGENTS.md reference: AGENTS.md:L127-L129
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| if (mode === 'files_with_matches') cmd.push('-l'); | ||
| if (mode === 'files_with_matches') cmd.push('-l', '--sortr=modified'); |
There was a problem hiding this comment.
Preserve Grep on ripgrep binaries without
--sortr
When PATH contains a pre---sortr ripgrep, the existing locator still accepts it (the local path only checks executability, while the remote probe only requires rg --version to succeed), but the default files_with_matches mode now unconditionally passes --sortr=modified; that binary exits with an unknown-option error and Grep returns no matches, although -l worked before. I checked rg 14.1.0 --help, which defines --sortr as descending sorting and describes modified as “Always single-threaded”; capability-probe/version-gate this flag or retain the previous sorting fallback.
AGENTS.md reference: AGENTS.md:L111-L113
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b799a95a36
ℹ️ 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".
| if (signal.aborted || Date.now() >= deadline) break; | ||
| } | ||
|
|
||
| if ((signal.aborted || Date.now() >= deadline) && filesScanned === 0 && filePaths.length === 0) { |
There was a problem hiding this comment.
Reject an expired inventory before reading its first file
Although the empty-inventory case is now checked, when walk discovers at least one file and then consumes the 30-second deadline (for example in a later slow directory), filePaths.length === 0 is false and the loop guard also permits its first iteration while filesScanned is zero. The Node fallback then starts an unbounded readText after its deadline and can return a normal partial response instead of the previous zero-progress FS_GREP_TIMEOUT; reject any expired inventory with zero scanned files before entering the loop.
AGENTS.md reference: AGENTS.md:L111-L113
Useful? React with 👍 / 👎.
| try { | ||
| await write(); | ||
| } catch (error) { | ||
| if (!isHostFsNotFound(error) && !isHostFsNotDirectory(error)) throw error; |
There was a problem hiding this comment.
Normalize ACP not-found errors before the retry
When the active backend is AcpHostFileSystem and writeTextFile reports a missing parent as ACP RequestError.resourceNotFound (code === -32002), isHostFsNotFound cannot recognize it because that predicate only accepts HostFsError or string ENOENT; this branch rethrows before ensureParentDirectory. The old execution called stat/mkdir before every write, so ACP Writes to new nested paths now fail instead of creating the parent; map the ACP error or preserve that fallback.
AGENTS.md reference: AGENTS.md:L127-L129
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 854b50cfdc
ℹ️ 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".
| const SUGGEST_TIMEOUT_MS = 10_000; | ||
| const SUGGEST_WALK_ABORTED = new Error('suggest walk aborted'); | ||
| const WALK_MAX_DEPTH = 64; | ||
| const WALK_DEFAULT_IGNORE = ['.git/']; |
There was a problem hiding this comment.
Exclude regular
.git metadata files from walks
When follow_gitignore is false in a linked worktree or submodule, .git is a regular file, and the directory-only .git/ ignore pattern does not match it. Nonempty workspace search can therefore return that metadata file, and the Node grep fallback can scan its gitdir: contents, whereas the replaced walker skipped every entry whose exact name was .git; preserve an unconditional exact-name prune (or add the file form of the rule).
AGENTS.md reference: AGENTS.md:L127-L129
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2abf6b0ec
ℹ️ 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".
| const result = await this.call<FsWalkResult>(FS_WALK_METHOD, { | ||
| path, | ||
| ignore: options.ignore, | ||
| timeoutMs: Math.min(remainingMs, FS_WALK_DEFAULT_TIMEOUT_MS), |
There was a problem hiding this comment.
Leave transfer headroom in the walk RPC budget
When a nonempty remote workspace search runs close to this 55-second walk budget, RemoteExecConnection.call still expires the request after 60 seconds, while the executor constructs and sends the single response (up to 8 MiB) only after traversal finishes. On an SSH link that cannot encode and deliver that frame in the remaining few seconds, the client raises RequestTimeoutError and discards the partial inventory instead of returning truncated: true; the replaced per-directory path did not place the entire traversal and response under one request timer. Reserve post-walk transfer headroom or allow this call a longer timeout.
AGENTS.md reference: AGENTS.md:L129-L129
Useful? React with 👍 / 👎.
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Fix searches failing on dot-only filenames, completion exceeding its timeout, and false directory warnings. |
There was a problem hiding this comment.
Drop the intra-PR warning fix from the release note
The false-directory-warning clause describes only an intermediate regression in this PR: on the base commit, reaching the 10 MiB capture cap did not terminate ripgrep, so it did not create the signal-exit warning; this PR adds cap-initiated termination and then suppresses that warning. Keep the two net user fixes in this entry, but remove that clause so the release notes do not claim a user-visible fix that never exists in a released tree.
AGENTS.md reference: AGENTS.md:L91-L91
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2abf6b0ec
ℹ️ 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".
|
|
||
| let traversalWarning: string | undefined; | ||
| if (exitCode !== 0 && exitCode !== 1 && !timedOut) { | ||
| if (exitCode !== 0 && exitCode !== 1 && !timedOut && !bufferTruncated) { |
There was a problem hiding this comment.
Keep real rg diagnostics when the output cap fires
When stdout crosses the 10 MiB cap after ripgrep has already emitted an unreadable-path diagnostic (for example, a permission error), bufferTruncated bypasses this branch and the matching guard in grepTool.ts:200, after which neither tool incorporates stderr; users see only the cap notice even though the previous code surfaced the warning/error. I checked rg 14.1.0 --help, which says --no-messages suppresses messages for failed opening and reading of files; these invocations do not pass that flag, so legitimate stderr can coexist with matches. Suppress only the cap-induced signal exit and retain nonempty diagnostics.
AGENTS.md reference: AGENTS.md:L111-L113
Useful? React with 👍 / 👎.
| timeoutMs: Math.min(remainingMs, FS_WALK_DEFAULT_TIMEOUT_MS), | ||
| }); | ||
| for (const entry of result.entries) { | ||
| if (options.deadlineMs !== undefined && Date.now() >= options.deadlineMs) return { truncated: true }; |
There was a problem hiding this comment.
Preserve remote completion candidates collected before timeout
When rg is unavailable and a remote fs/walk consumes the 10-second suggestion budget, the executor returns the entries collected before its timeout only at or after the caller deadline, so this check exits before invoking the visitor for even the first entry. suggestWithNode therefore returns an empty result instead of the partial candidates retained by the old per-directory visitor (and expected by fsService.test.ts:1608); reserve response/replay headroom or retain a bounded prefix while still honoring the deadline.
AGENTS.md reference: AGENTS.md:L127-L129
Useful? React with 👍 / 👎.
| matched += 1; | ||
| top.push(this.displayCandidate(root, candidate)); | ||
| }, { deadlineMs: deadline }) || inventoryTruncated; | ||
| if (signal.aborted || Date.now() >= deadline) break; |
There was a problem hiding this comment.
Mark completion truncated when the deadline skips roots
With multiple workspace roots, if the first local walk finishes cleanly just after the deadline but before the abort timer callback runs—for example, its final awaited readdir is a slow empty directory—this branch skips every later root without setting inventoryTruncated. When the match count is below the cap, the response consequently reports truncated: false despite never searching those roots; set the truncation flag before breaking on the absolute deadline.
AGENTS.md reference: AGENTS.md:L131-L133
Useful? React with 👍 / 👎.
Every remote-path file this commit touches is absent from the tree: the fork's local backend lives at os/backends/host, src/remote carries only its declaration layer, and the remote filesystem and fs-handler modules arrive with MoonshotAI#4062. Re-evaluate once that line lands.
… it blocked The full remote-environment port landed with 4166ca3, so MoonshotAI#4062 is `ported` with the evidence that closes it out: 29 port commits, typecheck 23/23, the fifteen check gates, a 26/26 build whose bundle answers `--version` and an `exec-server` initialize frame, and every suite green (agent-core-v2 8415, kap-server 1314, node-sdk 321, klient 118, acp-server 177, apps/kimi-code 5049). Three rows were parked behind it and now have their prerequisites: - MoonshotAI#4600 (legacy ACP session file tools) — `IAgentEnvironmentBindingService` and `IEnvironmentService` are exported from the engine root, `start.ts` constructs `RemoteEnvironmentProviderFactory`, and the provider registration block the repair edits exists. - MoonshotAI#4649 (TUI footer/welcome on the session environment) — the engine half landed in 2fa7b6b; the missing piece was the session workdir, which now carries the environment cwd. - MoonshotAI#4543 (remote file round trips) — every remote file it changes exists; the batched walk methods it adds are still absent from `methods.ts`. All three move from `blocked`/`in_progress` to `pending`; none is ported. Ledger: closed 68 -> 69, remaining 31 -> 30.
Port of upstream MoonshotAI/kimi-code 2d674cf (MoonshotAI#4543), adapted onto this fork's host backend and workspace fs. A remote session paid one round trip per directory and per file the model touched: `Read` asked for metadata and then for bytes, and every list, search, grep and completion walked the tree through `readdir` calls. - `IHostFileSystem` gains `readFileHead(path, maxBytes)` (metadata and the first bytes in one answer) and `walk(path, options, visit)` (a streaming visitor with an ignore matcher and an optional deadline). `HostFileSystem` implements both, `walk` through the new `walkDirectoryTree`, and `RemoteFileSystem` maps them onto the new `fs/readFile` head answer and a streamed `fs/walk`. - `WorkspaceFsService` no longer carries its own recursive walk: the private walk delegates to the host filesystem's, keeping the per-root gitignore matcher by passing it as a precompiled `HostWalkOptions.matcher`. Errors are mapped the same way as before, so an oversized directory still surfaces as `fs.too_many_results`. - `Read` reads the head instead of stat-then-read, `Write` writes optimistically and creates the parent only when the first write misses (keeping the fork's realpath write guard and file memory), and `runRg` kills ripgrep as soon as its output cap is reached. Local-form notes: - The fork's backend is `os/backends/host`, not `node-local`, so the two files upstream adds there are ported into it. - `HostWalkOptions.matcher` is a fork addition: this tree caches a compiled gitignore per root, and rebuilding rule strings per call would throw that cache away. - `mappingHostFs` (kap's shared remote fs fixture) gained `readFileHead` and `walk`; the local copy in the workspace fs test now delegates to `walkDirectoryTree` through a separator-normalising readdir, because that fixture models a POSIX tree on any host. - The read-media fixture's `readFileHead` delegates to its own `readBytes` so the existing call-count assertions still describe the head read. Verified: agent-core-v2 typecheck clean; full suite green (pooled failures are contention and pass in isolation); targeted trees — os backends 380, remote 68 pass / 55 skip, workspace 330, workspaceFs 92, agent tools 82, tool 270, kap-server 1330 / 14 skip, acp-server 180. check:no-comments, check:deep-imports and check:no-hardcoded-prose green; oxlint 0 errors on the touched trees. Ledger: MoonshotAI#4543 ported.
The remote filesystem batching landed in 64a73fc. The row records what the port covers, the two hand-ported paths, the fork-only `HostWalkOptions.matcher` field and its reason, and the three fixture adaptations. Ledger: closed 78 -> 79, remaining 21 -> 20.
Requirement or Bug
延续 #4062 的远程执行环境。高 RTT 下,Read、Write 和 Workspace 的 Node 遍历会被串行 RPC 放大。本 PR 合并这些往返,并修复搜索、补全的超时与输出截断边界。
Bug Reproduction Steps
在远程 workspace 读取小文件、写入已有目录,或在无 rg 的环境中搜索 / 补全。即使结果很小,也要等待 stat、内容探测、父目录检查或逐目录 readdir 的多次往返。
Root Cause
控制端逐步执行文件算法,每一步都是独立 RPC。本 PR 将 metadata 与文件头、整棵目录树遍历合并到执行端,直接减少往返,不引入缓存或重试。
Code Changes
优化只落在
IHostFileSystem和远程协议层,工具层不判断后端能力。本地与 executor 复用 node-local 的walkDirectoryTree,保持深度优先顺序、ignore 语义和 64 层深度上限一致。fs/readFile一次返回 metadata 和开头字节,小文件从 3 次 RPC 降为 2 次。正文仍走readLines,以保留 ACP 客户端未保存内容的编辑器视图。fs/walk,执行端按 8 MiB 响应和 55 秒预算截断,单目录超过 5 万条仍报错。search / suggest / grep 共用截止时间,约束遍历、结果回放和候选评分。重点阅读
hostFileSystem.ts、hostFsService.ts、remoteFileSystem.ts、fsHandler.ts和workspaceFs/fsService.ts;其余主要是工具接入、ACP / kap-server 透传与测试。Screenshots / Recordings
Glob 达到 10 MiB 上限时,不再多出错误的目录警告:
[stdout truncated at 10485760 bytes; results may be incomplete — use a more specific pattern]Glob completed with warnings; some directories could not be read.[stdout truncated at 10485760 bytes; results may be incomplete — use a more specific pattern]Behavior Changes and Affected Users
“远程”指 SSH / Docker / command 环境,覆盖 TUI、print、desktop / web、VS Code、ACP 和 SDK 客户端。
fs/walkFS_GREP_TIMEOUT...等合法名称可能让 Node 回退失败.git排除.git文件和目录.git排除,取反规则不能覆盖.GIT等大小写变体的仓库.GIT现在也会跳过;linked worktree / submodule 的.git文件仍被排除fs/readFile支持 metadata;新增fs/walkkimi exec-server的实验功能用户IHostFileSystem实现方readFileHead与walk配置、环境变量、提示词、CLI 参数、公共 REST / WS / SDK 契约和旧会话格式不变。Grep 的命中文件排序、ACP 正文读取和文件历史持久化路径也不变。
测试覆盖:
read.test.ts、write.test.ts、acp-fs.test.ts、remote/fs.test.ts覆盖 RPC 次数、父目录回退和错误转换。glob.test.ts、grep.test.ts覆盖上限终止、信号退出和部分结果。hostFsService.test.ts、remote/fs.test.ts覆盖顺序、ignore、全点号名称、截止时间、截断和单次 RPC。fsService.test.ts、kap-server/test/workspaceFs.test.ts覆盖深度边界、.git、多 root 截止时间、grep 超时与部分结果。验证结果与未覆盖环境
workspaceFs.test.ts29 项通过;工作区 typecheck、相关 lint、禁注释和git diff --check通过。watch.test.ts单独重跑 20 项通过,属于高负载下的 flaky。human/agent/origin.ts违规。Checklist
gen-changesetsskill:CLI patch,记录远程性能优化及搜索、补全边界修复。gen-docsskill:无新用户操作或配置,用户指南无需更新;远程协议说明已同步。