Skip to content

feat: support Windows remote environments - #4610

Merged
7Sageer merged 10 commits into
mainfrom
feat/remote-windows-targets
Nov 3, 2026
Merged

7Sageer merged 10 commits into
mainfrom
feat/remote-windows-targets

Conversation

@7Sageer

@7Sageer 7Sageer commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

延续 #3856 与 #4062:Windows 机器作为 SSH 或自定义命令执行目标时,此前会在握手阶段因 pathClass !== "posix" 被拒绝。这个 PR 让这类目标在安装 Git for Windows(Git Bash)后,可以创建和恢复远程会话,并执行文件与进程工具。

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

核心思路是复用本机 Windows 已有的 Git Bash、Shell 路径桥接和进程后端,不新增 PowerShell 执行体系。控制端根据握手里的 pathClass 选择目标路径语义;Windows executor 必须声明新的进程生命周期能力,现有 POSIX executor 与配置行为保持不变。

flowchart LR
  A[本机会话与工具] --> B[SSH / command 启动器]
  B --> C[Windows kimi exec-server]
  C --> D[原生路径的 fs / process RPC]
  A --> E[win32 path mapper]
  E --> D
  C --> F[Git Bash]
Loading
决策 选择 没选 理由
Windows Shell 复用 Git Bash 首版直接支持原生 PowerShell 与本机 Windows 会话共用探测、-c 命令构造和路径桥接,避免引入第二套 Shell 契约
MSYS 路径 无法确认映射就拒绝 在控制端调用本地 cygpath 猜测 控制端无法知道远端挂载,静默转换可能读写错误位置;只保留原生驱动器与词法 drive 路径,UNC 首版拒绝
executor 兼容性 握手要求 windowsProcessLifecycle 只提高全局最低版本 旧 Windows executor 不会进入不受支持的进程回收路径,POSIX 老版本兼容性不受影响
SSH executor 定位 remoteBin = "kimi",从目标 PATH 查找 首版支持任意 Windows 绝对路径 裸命令在 cmd、PowerShell、Git Bash 下都可执行,避开三套远端引号规则
主进程退出后的进程树 Windows 不保留 POSIX process group 在 Windows 上使用负 PID 负 PID 是 POSIX 语义;运行中的进程仍由现有 taskkill /T /F 清理,退出后的限制写入文档

具体变化:

  • normalizeRemoteCwd 接受 Windows 驱动器路径并拒绝 UNC;POSIX 双斜杠输入仍按原逻辑规范化。
  • 本地与远端环境共用 createEnvironmentPath / createEnvironmentWorkspace,远端按握手返回的 pathClass 选择 mapper。
  • 远端 Windows 路径解析不调用控制端 cygpath;/tmp、/usr、/dev、/proc 等无法确认挂载的路径明确报错,不静默读写其他目录。
  • 只由 [A-Za-z0-9_.-] 组成、且不是 shell 保留字的 remoteBin 使用跨 Shell 裸命令(这类 token 在 POSIX shell 中加不加引号语义一致);含其他字符、~ 前缀或保留字的继续走旧 quoting。缺失时的安装指引使用同一判定。cmd 的 9009 以及 Unix OpenSSH 观察到的低 8 位 49 都能得到安装指引,49 必须同时匹配 cmd 缺失错误文本。
  • Shell 路径桥接由 Environment 持有:本机环境提供会调用 cygpath 的实现,Windows 远端提供只做词法 drive 转换、其余 MSYS 路径一律拒绝的实现;HostEnvironmentInfo 不携带路径解析策略,全局 bridge 缓存只服务本机。Windows executor 对非驱动器路径返回“必须是 Windows 驱动器路径”的明确错误。
  • Windows rg 使用对应平台的 zip 包、rg.exe 与目标原生目录,不再执行 chmod。
  • Windows 主进程退出后不进入 POSIX process-group 回收分支;taskkill 完成后不再安装二次 grace kill timer,与本地 Windows 进程行为对齐。
  • native/source smoke 改为校验目标原生 pathClass 与工作目录;跨平台 loopback 覆盖 Windows 执行路径。

阅读顺序:

  1. packages/agent-core-v2/src/environment/environmentDefaults.ts:cwd 与路径语义。
  2. packages/agent-core-v2/src/remote/client/remoteEnvironmentProvider.ts:握手信息如何进入 Environment。
  3. packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts:本机转换与远端拒绝策略的边界。
  4. packages/agent-core-v2/src/remote/client/launchers.ts、connection.ts:跨 Shell 调用与 executor 能力协商。
  5. packages/agent-core-v2/src/remote/server/processManager.ts:Windows 进程退出边界。
  6. packages/agent-core-v2/src/os/backends/node-local/tools/rgLocator.ts:Windows rg 安装。

测试、双语文档、CI 和 changeset 可略读。

Behavior Changes and Affected Users

Behavior Before After Who relies on the old behavior Escape hatch
Windows 目标握手 非 POSIX 目标直接拒绝 接受声明 windowsProcessLifecycle 的 win32 executor;旧 Windows executor 与未知 path class 仍拒绝 使用 Windows SSH / command 目标的 TUI、print、desktop/web、VS Code、ACP 与 SDK 用户 在目标升级当前 executor 并安装 Git for Windows;POSIX executor 兼容行为不变
MSYS 路径转换 Windows 目标不可用 无法确认挂载的 /tmp、/usr、/dev、/proc 等路径直接报错,不调用控制端 cygpath;UNC 也拒绝 在 Windows 远端使用文件工具或指定 Bash cwd 的用户 使用原生驱动器或 /c/... 词法 drive 路径
远端 cwd 规范化 只接受 POSIX 绝对路径 接受 Windows 驱动器路径,拒绝 UNC;POSIX 双斜杠输入不变 已有 POSIX 环境声明;依赖 // 开头 POSIX 路径的用户 旧输入及规范化结果由测试钉住,无需迁移
裸名称 remoteBin 调用 使用 POSIX 单引号包裹命令与参数 由 [A-Za-z0-9_.-] 组成且非 shell 保留字的名称不加引号;其他名称保留旧 quoting 在目标 PATH 中安装 executor 的用户;既有 POSIX 自定义 remoteBin 用户 POSIX shell 中裸 token 与单引号 token 语义一致,保留字仍加引号;Windows 使用 remoteBin = "kimi"
executor 缺失指引 只把 126/127 识别为缺失 同时识别 cmd 9009 及 Unix 观察到的 49;49 必须匹配 cmd 缺失文本 Windows cmd + SSH 用户,包括 Linux/macOS 控制端 按错误中的 PATH 安装指引处理
rg 自动安装 Windows 远端报告不支持 下载 Windows 对应包,安装 rg.exe,跳过 chmod Windows 远端使用 Grep、文件搜索的用户 也可预装 rg 或手动放置到提示的目标路径
主进程退出后的子进程回收 Windows 目标不可用 Windows 不保留 POSIX process group;运行中的进程仍用 taskkill Windows 远端的后台任务及其子进程 主进程退出前停止后台任务;POSIX 回收逻辑不变

没有修改系统提示词、工具描述、公开 API、session 元数据格式或旧 runtime 行为。现有 POSIX 用户的默认值、launcher quoting、进程回收和 cwd 规范化均有原测试覆盖。

验证结论:

  • 全仓 pnpm run typecheck 通过。
  • 全仓 pnpm run lint:0 错误;既有 warning 保留。
  • 隔离 Linux 环境全量 Vitest:875 个测试文件、16947 个测试通过,4 个文件 / 20 个测试按既有条件跳过。
  • 本机 native 构建与 smoke(exec-server、askpass)通过。
  • 中英文 VitePress 文档构建通过。
  • PR CI 全部通过。Windows loopback 曾在临时 Windows runner 上验证通过(fs/process RPC、Git Bash 探测、capability 协商及相关单元测试);后续按反馈移除常驻 Windows CI 作业,避免每个 PR 增加约 2 分钟,其余 CI 继续执行。
  • 尚未执行真实的非 Windows 控制端 → Windows OpenSSH 目标验收,因此先开 draft。首版也不包含 Windows Docker、原生 PowerShell、UNC、完整 MSYS mount 映射或主进程退出后的完整进程树回收。
测试文件与基线说明
  • Windows cwd、path mapper、握手与 capability、launcher、cmd 9009/49、未解析路径拒绝、进程退出分支和 rg 的针对性测试均加入现有测试文件。
  • packages/agent-core-v2/test/remote/session.test.ts 改为跨平台 loopback,覆盖握手、文件读写、进程输出与终止。
  • 最后一轮未新增测试用例,仅删除失效的 UNC 接受断言。
  • 单独运行 agent-core-v2 lint:imports 时,未改动的 src/human/agent/origin.ts 在基线同样报既有 import 违规,本 PR 未处理。

Checklist

Copilot AI balanced review requested due to automatic review settings November 2, 2026 09:38
@changeset-bot

changeset-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0e10bea

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copilot AI 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.

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.

@7Hanrui

7Hanrui commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T12:58:25.776110Z 0e10bea Manual request
ℹ️ 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: 813df0d604

ℹ️ 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 (this.environmentValue.pathClass !== 'posix') {
if (this.environmentValue.pathClass !== 'posix' && this.environmentValue.pathClass !== 'win32') {

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 Resolve Git Bash paths on the target before accepting win32

When a Windows executor is controlled from Linux/macOS—or from a different Windows installation—file-tool inputs copied from Git Bash such as /usr/... or /tmp/... are translated incorrectly. getShellPathBridge() receives the remote shellPath but invokes existsSync/cygpath.exe on the controller, so it cannot resolve the target's MSYS mounts and leaves the path unchanged; the target then interprets it as a current-drive root path such as C:\usr\..., potentially reading or writing a different file. The new Windows CI loopback runs controller and executor on the same host and does not expose this. Path conversion needs to run on the executor or use target-provided mount information before win32 executors are admitted.

AGENTS.md reference: AGENTS.md:L104-L104

Useful? React with 👍 / 👎.

Comment on lines +230 to +232
if (process.platform === 'win32') {
if (entry.killTimer !== undefined) clearTimeout(entry.killTimer);
return;

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 Gate Windows targets on an executor containing this fix

When the controller is upgraded but the Windows target still runs a previous released executor, the handshake now accepts it because MIN_EXECUTOR_VERSION remains 0.1.0, even though this Windows-specific cleanup branch exists only in the new executor. The older ProcessManager sends every completed command into the POSIX exitedGroups reaper, where negative-PID probing is unsupported on Windows and can leave a recurring timer and map entry for every Bash, Grep, or Glob process. Negotiate this capability or raise the required executor version for win32 so users receive upgrade guidance instead of silently running the incompatible server.

AGENTS.md reference: AGENTS.md:L104-L104

Useful? React with 👍 / 👎.

if (!(error instanceof HandshakeError)) return 'other';
if (error.kind === 'executor-exit') {
return error.exitCode === 127 || error.exitCode === 126 ? 'missing' : 'other';
return error.exitCode === 127 || error.exitCode === 126 || error.exitCode === 9009 ? 'missing' : 'other';

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 Recognize the Unix-observed missing-executor status

When a Linux or macOS controller SSHes to a Windows target where cmd.exe cannot find kimi, the remote status is 9009, but the Unix controller observes only its low eight bits, 49, so this exact === 9009 check classifies the failure as other and omits the intended installation guidance. OpenSSH returns the remote command's status (OpenSSH ssh(1)), while POSIX wait() exposes only the low-order eight bits (POSIX wait(3p)). Detect the normalized status together with the Windows command-not-found stderr, rather than expecting 9009 to survive an SSH process running on Unix.

Useful? React with 👍 / 👎.

@7Hanrui

7Hanrui commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@codex review

@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: fedc5784f5

ℹ️ 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 on lines 101 to 102
if (normalized === '/' && env.pathResolution !== 'reject-unresolved') return normalized;
if (VIRTUAL_FS_PREFIXES.some((prefix) => normalized.startsWith(prefix))) return normalized;

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 Reject virtual MSYS paths on remote Windows

On a Windows remote, file-tool inputs such as /dev/null or /proc/... hit this unconditional return before the new pathResolution === 'reject-unresolved' handling; the native filesystem RPC then treats the leading slash as a current-drive-root Windows path such as C:\dev\null, so it can silently access the wrong target data when that path exists. Fresh evidence beyond the prior review is this virtual-filesystem exception, which still bypasses the newly added remote rejection; make this exception local-only or reject these paths remotely.

AGENTS.md reference: AGENTS.md:L130-L132

Useful? React with 👍 / 👎.

Comment on lines +230 to +232
if (process.platform === 'win32') {
if (entry.killTimer !== undefined) clearTimeout(entry.killTimer);
return;

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 Avoid scheduling a Windows kill after process closure

When terminating a Windows remote process, HostProcess.kill() waits for forced taskkill to finish; if the target exits and maybeClose() runs during that await, this branch sees no killTimer to clear, after which beginTermination() installs the grace timer anyway. Five seconds later that timer invokes taskkill again with the stale PID, which can terminate an unrelated process tree if Windows has already reused the PID. Skip the grace timer on Windows or recheck entry.closed after the awaited kill.

AGENTS.md reference: AGENTS.md:L104-L104

Useful? React with 👍 / 👎.

Comment on lines +84 to +85
if (/^[A-Za-z0-9_.-]+$/.test(remoteBin)) {
return [remoteBin, ...EXEC_SERVER_ARGV].join(' ');

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 Keep POSIX reserved executor names quoted

For an existing POSIX SSH configuration whose bare remoteBin is also a shell reserved word, such as an executor symlink named if or time, this new fast path removes the quoting that previously forced command lookup. The remote shell now parses the name as syntax (if ... fails parsing and time ... runs the wrong command), even though the PR states POSIX launcher semantics are unchanged; exclude reserved words from this branch or reject them explicitly.

AGENTS.md reference: AGENTS.md:L110-L112

Useful? React with 👍 / 👎.

@7Hanrui

7Hanrui commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@codex review

@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: 50ad811cdb

ℹ️ 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 (this.environmentValue.pathClass !== 'posix') {
if (this.environmentValue.pathClass !== 'posix' && this.environmentValue.pathClass !== 'win32') {

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 Avoid killing a reused PID during Windows shutdown

When a Windows remote disconnects while a command is running, accepting win32 here makes StdioHost.shutdown() call ProcessManager.terminateAll(), which invokes killGroup() once before waiting and again for every snapshotted entry after it has exited. On Windows, HostProcess.kill() ignores the requested signal and runs forced taskkill /T /F both times, so the second call can terminate an unrelated process tree if the original PID has already been reused. Distinct from the fixed grace-timer path, this unconditional shutdown pass remains; await/remove exited Windows entries or skip their second kill.

AGENTS.md reference: AGENTS.md:L104-L104

Useful? React with 👍 / 👎.

export function normalizeRemoteCwd(cwd: string): string {
if (!posixPath.isAbsolute(cwd) || cwd.includes('\0')) {
throw new EnvironmentError('environment.invalid_cwd', 'remote cwd must be an absolute POSIX path; relative paths and ~ are not expanded');
const path = /^[A-Za-z]:[\\/]/.test(cwd) || cwd.startsWith('\\\\') ? win32Path : posixPath;

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 Preserve UNC roots through file-tool canonicalization

When a Windows remote uses the newly accepted UNC defaultCwd, or a file tool receives a UNC path, resolvePathAccessPath() runs pathe.resolve() after the shell-path bridge; pathe 2.0.3 converts \\server\share into /server/share, as shown by its upstream reproduction. Because the bridge has already run, that slash-rooted path reaches the Windows filesystem RPC and is interpreted as a current-drive root such as C:\server\share, so relative and absolute Read/Write/Edit/Grep operations can silently access machine-local files instead of the network share while Bash remains in the intended UNC workspace. Preserve UNC paths with win32 semantics or convert/reject the post-canonicalization result.

AGENTS.md reference: AGENTS.md:L130-L132

Useful? React with 👍 / 👎.

@7Hanrui

7Hanrui commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@codex review

@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: f8dbb1d328

ℹ️ 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 (this.environmentValue.pathClass !== 'posix') {
if (this.environmentValue.pathClass !== 'posix' && this.environmentValue.pathClass !== 'win32') {

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 Restore the Windows remote environments changeset

This enables Windows targets as a user-visible CLI capability, but the cumulative PR diff contains no .changeset entry because the original feature changeset was subsequently deleted. As a result, the Changesets release flow will not attribute a CLI version bump or changelog entry to this feature; restore a minor changeset for @moonshot-ai/kimi-code.

AGENTS.md reference: AGENTS.md:L89-L90

Useful? React with 👍 / 👎.

@7Hanrui

7Hanrui commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: a24e646bca

ℹ️ 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".

@7Hanrui

7Hanrui commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 7f563b5d08

ℹ️ 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".

@7Hanrui

7Hanrui commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 04bff0ca4c

ℹ️ 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".

@7Sageer
7Sageer marked this pull request as ready for review November 2, 2026 12:30
@pkg-pr-new

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

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

commit: 0e10bea

@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: 04bff0ca4c

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

);
}
if (this.environmentValue.pathClass !== 'posix') {
if (this.environmentValue.pathClass !== 'posix' && this.environmentValue.pathClass !== 'win32') {

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 Skip shutdown kills for already-exited Windows processes

When this gate admits a Windows executor, a command can have exited while its output streams are still open; onExit() sets exitCode, but maybeClose() leaves the entry in processes. The fresh residual is the initial shutdown pass: although the new final loop skips Windows, terminateAll() still sends SIGTERM to every snapshot entry. Windows HostProcess.kill() turns that into taskkill /T /F /PID, so if the PID has been reused this can kill an unrelated process tree. Skip the initial shutdown kill for entries whose exit code is already set.

AGENTS.md reference: AGENTS.md:L104-L104

Useful? React with 👍 / 👎.

@7Hanrui

7Hanrui commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@codex review

@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: 0e10beacd5

ℹ️ 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".

}

export const MIN_EXECUTOR_VERSION = '0.1.0';
export const MIN_EXECUTOR_VERSION = '2.5.0';

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 Preserve compatibility with older POSIX executors

When a controller is upgraded to this release while a POSIX target still runs any previously accepted executor version (including 2.4.1), this global minimum rejects the connection before considering the target platform. The newly required lifecycle capability is Windows-specific and optional in the protocol, so these POSIX executors remain compatible but their remote environments become entirely unavailable until users manually upgrade every target. Keep the existing minimum for POSIX and enforce the new version or capability only for win32 executors.

AGENTS.md reference: AGENTS.md:L110-L112

Useful? React with 👍 / 👎.

@7Sageer
7Sageer merged commit 9f0e9d7 into main Nov 3, 2026
16 checks passed
@7Sageer
7Sageer deleted the feat/remote-windows-targets branch November 3, 2026 03:15
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.

4 participants