Repository navigation
fix(tui): read welcome cwd and footer git status from the session environment - #4649
Conversation
🦋 Changeset detectedLatest commit: c1b3f13 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 |
|
@codex review |
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. Try requesting a review at a lower effort level.
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 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. |
|
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". |
commit: |
The footer ran git and gh on the local machine, so a remote-bound session hid the git badge. Read branch, working-tree, and pull request state through the SDK instead: a live session's own environment, or the local work dir before the lazy session exists. The local HEAD poll stays as a refresh trigger only. Core git commands now time out after 30s, and the pull request cache is keyed by branch so a branch switch no longer serves the previous branch's pull request.
…ctory GitService spawned bare git and gh with the workspace as cwd. On Windows a bare name is looked up in the cwd before PATH, so a binary planted in the workspace could run, and the TUI footer now reads git status at startup, before the workspace trust gate. Resolve both through PATH for the local environment and refuse any match inside the working directory.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
The startup progress row turned into a permanent "Ready." line under the welcome panel. Remove it on success; a failed startup still leaves the "Startup failed." row.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85a3a45e65
ℹ️ 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".
| return { | ||
| key: [sessionId ?? '', workDir, state.environment?.status ?? ''].join('\0'), | ||
| source: { | ||
| status: () => this.harness.getGitStatus(workDir, { sessionId }), |
There was a problem hiding this comment.
Keep Windows workspace containment case-insensitive
On Windows, when PATH names a workspace-local git.exe with casing different from cwd (for example c:\repo\bin versus C:\Repo), this new footer path reaches core's resolveProgramPath, whose isInsideCwd comparison is case-sensitive. The removed TUI resolver lowercased both paths, so the new code can classify the planted executable as external and run it before workspace trust; preserve the Windows-aware containment check when moving resolution into core.
AGENTS.md reference: apps/kimi-code/AGENTS.md:L66-L68
Useful? React with 👍 / 👎.
| return { | ||
| key: [sessionId ?? '', workDir, state.environment?.status ?? ''].join('\0'), | ||
| source: { | ||
| status: () => this.harness.getGitStatus(workDir, { sessionId }), |
There was a problem hiding this comment.
Retain a byte cap for automatic footer git reads
For TUI users in very large or heavily dirty repositories, this automatic footer query now routes git status and git diff --numstat through GitService.collect, which buffers output without a size limit for up to 30 seconds. The replaced implementation capped each command at 4 MiB, so an oversized status previously failed the badge safely but can now consume hundreds of megabytes or terminate the CLI; add an equivalent bounded collector in the core path before using it for startup and periodic refreshes.
AGENTS.md reference: AGENTS.md:L126-L128
Useful? React with 👍 / 👎.
| abstract getGitStatus(workDir: string, input: GitQueryInput): Promise<GitStatusSummary | null>; | ||
|
|
||
| abstract getGitPullRequest(workDir: string, input: GitQueryInput): Promise<GitPullRequest | null>; |
There was a problem hiding this comment.
Keep new RPC methods source-compatible for SDK transports
For SDK consumers that implement a custom transport by subclassing the publicly exported SDKRpcClientBase, this patch release makes their existing subclass fail TypeScript compilation because both new git methods are abstract. The capability is only needed by the TUI, so provide concrete fallback implementations (for example returning null or NOT_IMPLEMENTED) as existing optional capabilities do, or treat the contract change as a breaking SDK release.
AGENTS.md reference: AGENTS.md:L122-L124
Useful? React with 👍 / 👎.
| if (sessionId === undefined && !local) return null; | ||
| const { workDir } = state; | ||
| return { | ||
| key: [sessionId ?? '', workDir, state.environment?.status ?? ''].join('\0'), |
There was a problem hiding this comment.
Preserve cached git state during transient disconnects
When a remote environment moves from ready to connecting or disconnected, including environment.status in this key makes FooterComponent.syncGitCache dispose the cache that contains the last successful badge. The replacement cache then starts empty and its remote read fails, so the badge disappears even though the cache's error path is intended to retain the last good status; keep the binding identity stable across transient statuses and explicitly refresh when the environment becomes ready instead.
AGENTS.md reference: AGENTS.md:L126-L128
Useful? React with 👍 / 👎.
…on Windows resolveProgramPath compared the PATH candidate against the working directory case-sensitively, so on Windows a PATH entry spelled with different casing (c:\repo\bin vs C:\Repo) let a workspace-local executable through.
The git cache key included the environment status, so a remote dropping to connecting or disconnected rebuilt the cache and lost the last badge. Key the cache by session and work dir only, and refresh it when the environment turns ready again.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1b3f13626
ℹ️ 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 (disposed) return; | ||
| const changed = !sameSummary(status.summary, summary); | ||
| status = { summary, fetchedAt: Date.now() }; |
There was a problem hiding this comment.
Preserve cached status on transient Git failures
When a repository already has a cached badge and a later git invocation times out, cannot spawn, or otherwise returns FS_GIT_UNAVAILABLE, getGitStatus converts that error to null, so this assignment replaces the last good summary and hides the badge for at least the next TTL interval. The previous TUI path retained its cached status when git status failed, and the catch immediately above still attempts to provide that behavior for thrown source errors; distinguish “not a repository” from transient unavailability or let the latter propagate into that retention path.
AGENTS.md reference: AGENTS.md:L126-L128
Useful? React with 👍 / 👎.
| headWatchRequested = true; | ||
| void watchLocalHead(source.localWorkDir); |
There was a problem hiding this comment.
Retry installing the HEAD watcher after git init
When the first cache read happens before localWorkDir is a Git repository, this flag is set permanently before watchLocalHead discovers that rev-parse fails. The new TTL behavior can later discover a repository created with git init, but the flag prevents installing its watcher, so subsequent external branch switches are not reflected within the intended two-second polling window and can leave the badge stale until another turn or the 30-second TTL. Set this only after a successful probe or clear it when the probe returns no Git directory.
Useful? React with 👍 / 👎.
| return { | ||
| key: [sessionId ?? '', workDir, local ? 'local' : 'remote'].join('\0'), | ||
| source: { | ||
| status: () => this.harness.getGitStatus(workDir, { sessionId }), |
There was a problem hiding this comment.
Release environment leases on automatic spawn failures
For a remote session whose host lacks git, or whenever the process backend rejects a spawn, this new automatic footer read reaches GitService.runCommand, which acquires an environment lease but returns from the !spawned.ok branch before the existing finally can dispose it. Startup, TTL, and turn-end refreshes can therefore accumulate leaked leases, and removing or reloading that environment then waits for the registry's full drain timeout; dispose the lease on the spawn-failure path before making this a periodic read.
AGENTS.md reference: AGENTS.md:L104-L104
Useful? React with 👍 / 👎.
* fix(tui): read welcome cwd and footer git status from the session environment (#4649) * fix(tui): show remote cwd in welcome panel * fix(tui): read footer git status through the session environment The footer ran git and gh on the local machine, so a remote-bound session hid the git badge. Read branch, working-tree, and pull request state through the SDK instead: a live session's own environment, or the local work dir before the lazy session exists. The local HEAD poll stays as a refresh trigger only. Core git commands now time out after 30s, and the pull request cache is keyed by branch so a branch switch no longer serves the previous branch's pull request. * fix(agent-core-v2): resolve local git and gh outside the working directory GitService spawned bare git and gh with the workspace as cwd. On Windows a bare name is looked up in the cwd before PATH, so a binary planted in the workspace could run, and the TUI footer now reads git status at startup, before the workspace trust gate. Resolve both through PATH for the local environment and refuse any match inside the working directory. * chore: merge changesets for remote cwd and git status * fix(tui): drop the startup Ready. row once startup succeeds The startup progress row turned into a permanent "Ready." line under the welcome panel. Remove it on success; a failed startup still leaves the "Startup failed." row. * fix(agent-core-v2): compare workspace containment case-insensitively on Windows resolveProgramPath compared the PATH candidate against the working directory case-sensitively, so on Windows a PATH entry spelled with different casing (c:\repo\bin vs C:\Repo) let a workspace-local executable through. * fix(tui): keep the footer git badge through a remote disconnect The git cache key included the environment status, so a remote dropping to connecting or disconnected rebuilt the cache and lost the last badge. Key the cache by session and work dir only, and refresh it when the environment turns ready again. * feat: isolate plugin availability by client (#4653) * fix: preserve marketplace descriptions * fix: preserve localized plugin display names * feat: isolate plugin availability by client * fix: preserve cli marketplace loading * fix: harden plugin availability reconciliation * fix: hash plugin marketplace provenance * fix: complete plugin availability reconciliation * fix(transcript): keep realigned turn ids unique when folding cold facts (#4658) * fix(transcript): keep realigned turn ids unique when folding cold facts Realigning base turns to their wire ids only skipped ordinals held by turns without a wire id. When an inherited turn held a forked turn's wire id, that turn kept its base ordinal, and the next turn's wire id could land on the same ordinal, so two turns shared a turn id and the later one replaced the earlier in clients. Claim ordinals in order: turns without a wire id or already at their wire id first, then each realigned turn takes its wire id when free, else keeps its ordinal or moves to the next free one. * chore: add changeset for side chat turn order fix * fix(kap-server): wait for an agent's history before accepting its prompt (#4659) * fix(kap-server): backfill a side chat fork before replying to :btw A fork's inherited history folds into a cold turn at t0, while the live transcript only records it as markers. When the fork's first prompt started before anything read the fork transcript, its live turn took t0; the history backfill then merged the inherited main turn into it by turn id, so the first side chat turn carried the main answer and the real answer landed in a duplicate turn. Finish the fork's history backfill before :btw replies, so the inherited turn holds t0 before the first prompt can start. * fix(kap-server): wait for an agent's history before accepting its prompt Delaying the :btw reply did not order the fork's first prompt after its history backfill: other clients learn the fork from the agent roster as soon as it is created, and checking for a live transcript with forSessionLive created one, so every :btw also waited for the whole main history. Move the wait to prompt submission: a prompt for a non-main agent awaits that agent's history backfill before it is enqueued, which covers every client and leaves :btw unchanged. The backfill is cached per agent, so later prompts do not wait again. * fix: safely launch Windows SSH executors (#4664) * feat: support Windows SSH remote environments * Delete .changeset/windows-remote-environments.md Signed-off-by: 7Sageer <[email protected]> --------- Signed-off-by: 7Sageer <[email protected]> * fix(agent-core-v2): match regional plugin locales (#4666) * fix(plugins): confirm stopping Windows CU processes before install (#4670) * fix(plugins): confirm stopping Windows CU processes before install * test(plugins): cover capability install confirmation contract * fix(plugins): preserve bodyless installs and plugin-only repairs * chore: sync web dist from code-app (#4667) * chore: sync web dist from code-app code-app: 63661fc449e2ec0ce024bc08fe87f2c757d483e8 * chore: sync web dist from code-app code-app: d0e913a6c9607be778c62f0c74ee7310bfb8862a * chore: sync web dist from code-app code-app: b306f4a2f9be8944e5a8064ecb076e3137c968f1 --------- Co-authored-by: kimi-agent-bot <[email protected]> * ci: release packages (#4672) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Signed-off-by: 7Sageer <[email protected]> Co-authored-by: 7Sageer <[email protected]> Co-authored-by: liruifengv <[email protected]> Co-authored-by: qer <[email protected]> Co-authored-by: kimi-agent-bot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Port of the local-environment hardening in upstream MoonshotAI/kimi-code 75f35b0 (MoonshotAI#4649). GitService spawned bare git and gh with the workspace as cwd. On Windows a bare name is looked up in the cwd before PATH, so a binary planted in the workspace could run. Both now resolve through resolveProgramPath, which refuses any match inside the working directory, and the timeout default moves from none to 30s so a hung git cannot wedge a status read. resolveProgramPath compares the PATH candidate against the working directory case-sensitively, so on Windows a PATH entry spelled with different casing (c:\repo\bin vs C:\Repo) let a workspace-local executable through; the containment check now folds case on win32. The pull request cache is keyed by branch, so a branch switch no longer serves the previous branch's pull request. Not ported from the same commit: reading the footer git status through the session environment, which needs the pull-request API of MoonshotAI#4527 and the session workdir of MoonshotAI#4062, neither of which this tree has. The startup "Ready." row it also removes does not exist here.
Fifteen rows enter the ledger: the six commits that landed on upstream/main after the last refresh, and the nine commits that reach main only through the release/2026-11-04 sync (MoonshotAI#4674), which is where the 2.5.0 changelog entries come from. Each 2.5.0 row records what it needs from this tree, so the next batch starts from the blocker instead of rediscovering it: - MoonshotAI#4658 and MoonshotAI#4659 are ported (79a4199, 7a531f5) with tests that fail on the pre-change tree. - MoonshotAI#4649 is in_progress: its agent-core-v2 half landed in 2fa7b6b, while the footer and welcome half needs the pull-request API of MoonshotAI#4527 and the session workdir of MoonshotAI#4062. - MoonshotAI#4653, MoonshotAI#4666 and MoonshotAI#4670 build on the MoonshotAI#4525 plugin marketplace, absent here; MoonshotAI#4670 additionally needs isError2. - MoonshotAI#4664 needs the MoonshotAI#4062 remote environments. - MoonshotAI#4667 and MoonshotAI#4672 are generated-bundle and release commits; settling them as not-applicable needs a signature. Rows were appended by a one-off writer because --refresh fetches and that fetch does not complete on this network; the file still parses under the tool's own column contract, and --verify --batch B5 passes both new probes.
…AI#4649's blocker MoonshotAI#4527 lands in 5eedb6f with a probe over the batch case. MoonshotAI#4649's remaining half no longer waits on the pull-request API it now has; only the MoonshotAI#4062 session workdir is missing.
… 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.
…environment Port of upstream MoonshotAI/kimi-code 75f35b3253 (MoonshotAI#4649), completing the half that waited on the MoonshotAI#4062 remote environments. The footer ran git and gh on the local machine, so a remote-bound session hid the git badge entirely, and the welcome panel always printed the local work dir. Both now read through the session's own environment: - The SDK gains `getGitStatus` / `getGitPullRequest` on `SDKRpcClientBase`, `SDKRpcClientV2` (a live session's workdir on its environment, else the workspace instance for the directory) and `KimiHarness`, typed by `GitQueryInput` / `GitStatusSummary` / `GitPullRequest`. - The footer takes a `FooterGitBinding` whose source reads through that SDK and keys its cache by session and work dir only, so a transient disconnect keeps the last badge and the footer re-reads once the environment is ready again. - `createGitStatusCache` gained a `source` path: it skips local spawning and local repo probing, but still polls HEAD for a local work tree so branch switches stay instant. - The welcome panel shows the binding cwd when the session runs somewhere else. `GitService` now resolves local `git` and `gh` through PATH and refuses a match inside the working directory. A bare name is looked up in the cwd first on Windows, and the footer reads git status at startup, before the trust gate. Local-form notes: the upstream "Ready." startup row does not exist in this TUI, so its removal has no counterpart; `resolveProgramPath` already folded case on Windows from the earlier port; the cache keeps the fork's dependency seam, so the existing local-spawn tests still cover that path unchanged. Verified: apps/kimi-code and node-sdk typecheck clean, node-sdk 321 pass, git and footer/welcome suites green (a new footer case renders a remote badge and proves the cache is not rebuilt across a disconnect; a new welcome case proves the remote cwd replaces the local one), agent-core-v2 git suite 13 pass, check:no-comments, check:deep-imports, check:boundaries, check:locale-keys and check:t-coverage green. The full app suite is green apart from `flag-locale-coverage`, which demands en/zh entries for the `associative_memory` flag an adjacent untracked workstream added to the engine registry. Ledger: MoonshotAI#4649 ported; closed 71 -> 72, remaining 28 -> 27.
Requirement or Bug
在远程环境(
kimi --environment <id>)下,TUI 欢迎面板显示的是本地启动目录,footer 也不显示 git badge,因为 TUI 只会在本机跑 git。本 PR 让这两处都读取会话实际所在的环境:欢迎面板显示远程工作目录,footer 显示远端仓库的分支和工作区状态。git 状态改由 core 提供。顺带修一个小问题:#4062 引入的启动进度行在启动成功后会变成一行永久的
✓ Ready.,留在欢迎面板下面,没有信息量。Bug Reproduction Steps
kimi --environment <id>启动一个绑定了远程工作目录的会话。Directory和 footer 里的工作目录。修复前,欢迎面板是本地目录,footer 是远程目录。✓ Ready.。Root Cause
TUI 自己推断"工作区事实",没有去读 core:
workDir。git和gh得到(apps/kimi-code/src/utils/git/git-status.ts)。它看不到远端,所以远程时只能把 badge 隐藏掉。core 其实早就有按环境路由的
GitService,kap-server 的fs:git_status/fs:pull_request一直在用,只是 SDK 没把它暴露出来,TUI 只好另写一套。本 PR 让 TUI 改用 core 这套,是根本修复。改的过程中在 core
GitService里发现三个既有问题,一并修复:git/gh。Windows 会先在 cwd 里找可执行文件,所以工作区里放一个git.exe就能被执行。TUI 原实现专门防了这一点,而接线到 core 后 TUI 启动时(workspace trust 之前)就会走这条路径,所以必须在 core 里补上。Code Changes
核心思路:footer 不再自己跑 git,而是通过 SDK 读 core 的
GitService。已有 session 时,读这个 session 所在环境的工作目录,远程会话因此能读到远端仓库。启动后、发第一条消息前 session 还没创建,这时本地环境读本地 core,远程环境不显示 badge(和修复前一致)。TUI 只保留缓存、TTL 和刷新触发。欢迎面板沿用 footer 现有的目录规则:远程 cwd 已知时用它,否则用本地workDir。TUI 和 kap-server 现在共用同一个
GitService,所以 core 里的修复会同时作用到 TUI、web 和桌面端。GitServiceGitService;远程返回nullgh慢的时候拖住 badgefooterGitBinding用"sessionId、workDir、是否本地"拼成 key,key 变化时重建缓存。key 不含连接状态,所以远程暂时断开时缓存和上一次的 badge 都保留;环境重新变成 ready 时,footer 主动刷新一次,远程 badge 连上后立即出现,不用等 TTL。阅读指南
packages/agent-core-v2/src/app/git/gitService.ts:默认 30 秒超时、PR 缓存按分支区分、本地命令走resolveProgramPath(拒绝匹配到工作目录内的可执行文件)。packages/node-sdk/src/sdk-rpc-client-v2.ts中的getGitStatus/getGitPullRequest:有 session 走ISessionWorkdir.fs,没有 session 走本地IGitService;FS_GIT_UNAVAILABLE映射为null。写法沿用现有的suggestFiles。apps/kimi-code/src/tui/kimi-tui.ts中的footerGitBinding:决定从哪里读、什么时候重建缓存。apps/kimi-code/src/utils/git/git-status.ts:只剩缓存逻辑,数据来自注入的 source。可以略读:
footer.ts的接线、SDK 的类型和 rpc 透传、欢迎面板的 6 行改动、测试。启动进度行:
showProgressSpinner返回的句柄新增dismiss(),用来把进度行和它上面的空行从 transcript 里移除。启动成功时调用dismiss(),替代原来的stop({ ok: true, label: 'Ready.' });失败时仍然留下✗ Startup failed.。/new和远程首次连接用的进度行不变。Screenshots / Recordings
远程会话(
dev-box,远端目录是 git 仓库)的 footer 第一行,由FooterComponent实际渲染得到,已去掉颜色:修复前(git 位为空,被 tips 占用):
修复后:
Behavior Changes and Affected Users
gitBranchnullnull判断远程的自定义 status line 脚本GitServicerev-parsegit init现在能被发现Initial commit on XNo commits yet on X)fs:pull_request/fs:git_status切分支后的 PRapp-coredaemon client)gh,失败后返回nullgh,直接返回nullFS_GIT_UNAVAILABLEgit status超过 30 秒的超大仓库fs:pull_request在.git目录内或 bare 仓库中FS_GIT_UNAVAILABLEnull(检测方式从rev-parse --is-inside-work-tree改为symbolic-ref)✓ Ready.✗ Startup failed.被替换的旧 TUI 路径的功能清单:
resolveProgramPath(本地环境),已补上 Windows 大小写折叠gh5 秒超时gh仍是 5 秒FS_GIT_UNAVAILABLE会隐藏 badge(见上表)GH_NO_UPDATE_NOTIFIER、GH_PROMPT_DISABLEDNo commits yet on和Initial commit on受影响模块与测试覆盖:
agent-core-v2GitService:新增测试覆盖 PR 缓存按分支失效、detached HEAD 不调用gh(用 PATH 上的假gh)、git 走解析后的绝对路径、PATH 只有工作区内的git时拒绝执行。git-status.test.ts):按注入 source 重写,覆盖 TTL、PR 附加和失败、本地 HEAD 检查、远程 source 完全不碰本机、不在仓库里和 detached HEAD、HEAD 变化和refresh()、失败后保留旧值、强制刷新合并。null时不显示 git 位;远程断开期间不重建缓存,重新 ready 时刷新一次。kimi-tui路由:本地无 session 时读本地;远程无 session 时为null;远程有 session 时按 sessionId 读,且不做本地 HEAD 检查;连接状态变化不改变 key。Ready.;失败时保留Startup failed.。去掉修复后这个测试会失败。没有验证的:真实 SSH 远程环境下的端到端显示;Windows 下的实际执行(路径解析逻辑由 core 现有的
resolveProgramPath负责)。验证记录
apps/kimi-code的test/tui+test/utils:195 个文件、3472 个测试通过。agent-core-v2的test/app/git、test/workspace/workspaceFs、test/program、test/agent/permissionPolicy、test/session:全部通过。node-sdk:212 个测试通过;kap-server 中涉及 git 的测试:113 个通过。agent-core-v2、node-sdk、apps/kimi-code、kap-server的类型检查和check-no-comments通过。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.