feat(runtime-host): support WSL as a local environment - #4064
Conversation
282621d to
26170b1
Compare
Generated-by: OpenAI Codex
Give WSL activation a cold-start budget, keep semantic failures in the framed transport, and make bounded subprocess diagnostics non-rejecting. Classify persistent identity mismatches as terminal and separate Desktop Host ownership from target location. Generated-by: OpenAI Codex
26170b1 to
2ba90c7
Compare
jackwener
left a comment
There was a problem hiding this comment.
Approved at exact head 2ba90c7841004aac30290b4afaaefb8a88247f77.
I found no release-blocking correctness or security issue in the current change. The WSL path uses the system wsl.exe with literal arguments for normal operation, keeps the managed deployment and State Root election as the single Host authority, binds the bridge to the expected Root and Host epoch, and owns cancellation, child failure, timeout, EOF, and half-close cleanup. Desktop and CLI consistently treat WSL as a credential-free environment with Host-owned workspace semantics rather than weakening the SSH remote boundary.
The focused Runtime Host, CLI, and Desktop verification passed, including activation/rollback, identity mismatch, WSL process failure, framed transport, backpressure, and half-close coverage. All applicable hosted checks on this exact head are complete and successful, and the synthetic merge with current main is clean.
One backward-reader limitation is suitable for a follow-up rather than a release hold: after a current client writes an environment entry to runtime-host-profiles.json, an older client sharing the same Client Data Root cannot decode that document. The failure is fail-closed and does not overwrite or corrupt the file; reopening it with the current client restores access. A follow-up should give new profile kinds a forward-compatible persistence boundary so one new entry cannot hide otherwise readable remote profiles from an older client.
Posted by an automated review agent operated by @WAWQAQ. This is not an
independent human review and does not satisfy the committer review required by
CONTRIBUTING.md. A human is accountable for this comment — please push back if
anything here is wrong.
简体中文
本条评论由 @WAWQAQ 运行的自动化审查程序发出。它不构成 CONTRIBUTING.md
所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。
English
Summary
Make WSL a first-class local execution environment instead of modeling it as an SSH remote Host.
environment / wslprofiles and route all non-local profiles through one shared connector used by Desktop and CLI.wsl.exewith literal argv for distribution enumeration and daily operator calls; no WSL SSH server, dynamic IP, localhost forwarding, or shell-built operator command is required.operator connect --framed, which activates the managed on-demand deployment and bridges the existing local IPC byte stream over stdio without duplicating State Root election./bin/sh -lconly during initial WSL setup; normal activation and connection execute the persisted absolute operator path directly.Refs #3984
Review focus
wsl-control.tsandwsl-environment.ts: Windows control boundary, literal argv, bounded output, and framed transport.managed-stdio-bridge.tsplusruntime-host-connect-command.ts: activation followed by verified local IPC bridging.host-profile.tsandprofile-kind.ts: environment identity, credential-free persistence, and compile-time workspace-authority coverage.Invariants
localuses the Client workspace;environmentandremoteuse the Host workspace. Remote credentials, SSH, and pairing remain separate remote-only concerns.Verification
Ubuntuthrough the systemwsl.exe, installed the exact development package, activated the on-demand Host, and connected through the stable framed stdio operator bridge.WSL_DESKTOP_SESSION_OK. On the final head, the Session was restored under theUbuntu E2EHost group, its Linux project remained accessible, and task readiness reported runtime/model/workspace allreadywith no blockers.AI use
Tool(s) and scope: OpenAI Codex contributed implementation, tests, Windows/WSL verification, and this description under human direction.
Checklist
main中文
摘要
将 WSL 建模为一等本地执行环境,而不是伪装成 SSH remote Host。
environment / wslprofile;Desktop 与 CLI 的非本地 profile 共用同一个 connector。wsl.exe,发行版枚举和日常 operator 调用都通过 literal argv;不要求 WSL SSH server、动态 IP、localhost forwarding,也不拼接 shell command。operator connect --framed:先 activation managed on-demand deployment,再把现有 local IPC byte stream 通过 stdio bridge 暴露;不复制 State Root election。/bin/sh -lc;日常 activation/connection 直接执行持久化的绝对 operator path。关联 #3984
审查重点
wsl-control.ts与wsl-environment.ts:Windows 控制边界、literal argv、bounded output 与 framed transport。managed-stdio-bridge.ts与runtime-host-connect-command.ts:activation 后验证并桥接 local IPC。host-profile.ts与profile-kind.ts:environment identity、无凭据持久化契约和编译期 workspace-authority 覆盖。不变量
local使用 Client workspace;environment与remote使用 Host workspace。远程凭据、SSH 与 pairing 仍是独立的 remote-only 关注点。验证
wsl.exe枚举Ubuntu、安装 exact development package、激活 on-demand Host,并经稳定 operator 的 framed stdio bridge 建连。WSL_DESKTOP_SESSION_OK。在最终 head 上,该 Session 正确恢复到Ubuntu E2EHost 分组,Linux project 仍可访问,task readiness 的 runtime/model/workspace 三个维度均为ready,无 blocker。AI 使用情况
OpenAI Codex 在人工指导下参与了实现、测试、Windows/WSL 验证和本描述编写。
检查清单
main