feat(desktop): manage the supervised Local Host - #4161
Conversation
jackwener
left a comment
There was a problem hiding this comment.
I cannot approve 21da4582138931eb7a03ec754db7290c75223f70 yet because two merge-blocking defects remain.
-
[P1] The renderer no longer type-checks. In
runtime-host-profiles-section.tsx, theprofile.transport.kind === "ssh"narrowing is not preserved inside theonClickcallback, soprofile.transport.destinationfails withTS2339.npx tsc -p apps/desktop/tsconfig.renderer.json --noEmitreproduces this on the exact head. Capture the SSH destination while the transport is narrowed, or narrow it again inside the callback. -
[P1] A stopped Local service cannot be started from the new management dialog. Status and logs intentionally bypass Host retirement, so a deployment-bound operator can report
state: "stopped"and the dialog displays Start. The mutation then entersrunManagedServiceChange(). For an unavailable supervised target,retireOwnedLocalHost()returnsnot_owned, and line 617 callsrunManagedLocalHostChange(), whoselifecycle.quiesce()requires a ready candidate and throws before the operator is invoked. A production-seam probe with a real managed lifecycle receipt returnedstatus: "stopped", then both Start and Uninstall failed withRuntime Host reconnect lifecycle is closed; the operator saw only the status call. Uninstall had already persistedstate: "uninstalling", so startup recovery repeats the same failure. Please keep the manager mutation serialization, but allow the bound operator change to run when there is no current supervised candidate, then schedule reconnect. Add a stopped-service regression through the Local lifecycle/provider seam.
The Desktop main/preload/overlay build, 25 focused management tests, Biome, and git diff --check pass. The current-main merge tree is clean, and the exact-head package check is green, but neither covers the failing renderer type-check or the stopped-service path above.
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
所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。
|
Both blockers are fixed in
The follow-up review loop also closed the related recovery boundaries: persisted peer changes and uninstall replay through the exact canonical operator before Local startup, and committed managed authority is adopted independently of Direct peer availability. Validation: Desktop typecheck and build, 22 focused lifecycle/management tests, lint, and 简体中文两个 blocker 均已在
后续审查同时关闭了相关恢复边界:持久化 peer 变更与卸载会在 Local 启动前通过精确的 canonical operator 重放;已经提交的 managed authority 不再依赖 Direct peer 能力即可采用。 验证包括 Desktop typecheck 与构建、22 个聚焦生命周期/管理测试、lint 和 |
f72b893 to
4f85193
Compare
jackwener
left a comment
There was a problem hiding this comment.
The two blockers from my previous review are closed on 4f85193acca39bebb7aedde3b28f18642ebbfdbe.
- The SSH destination is captured while the transport remains narrowed, so the PR no longer produces the
profile.transport.destinationtype error. - Managed Local changes now suspend the reconnect lifecycle across both a ready supervised candidate and a connection gap. Pre-start recovery also completes persisted peer-change and uninstall intents directly through the exact deployment-bound operator before an ephemeral Host can claim the root.
I found no remaining P0–P2 issues. The affected Runtime Host build and 82 focused reconnect/Desktop lifecycle/management tests pass, along with Biome and git diff --check. The two remaining Desktop renderer type errors are byte-for-byte inherited from current main (scrollOwner in app-shell.tsx and quote-companion-panel.tsx), not introduced by this PR. The exact head merges cleanly with current main.
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
所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。
Reuse the managed Runtime Host management surface for the built-in Local Host after remote access promotes it to a supervised service. Preserve Local lifecycle authority while routing service operations through the deployment-bound operator. Generated-by: OpenAI Codex
Keep Local service management on the shared surface without inventing Direct peer or credential operations that belong to remote profiles. Gate the renderer by the target capability and make confirmation copy valid for every Host. Generated-by: OpenAI Codex
Make managed Local lifecycle recovery independent of Direct peer availability, preserve exact operator authority across setup and uninstall replay, and let service changes proceed while no Runtime Host candidate is connected. Consolidate the shared management controller and retain only focused lifecycle tests. Generated-by: OpenAI Codex
4f85193 to
88d6527
Compare
English
Summary
Enabling remote access promotes the built-in Local Host from a Desktop child process to a system-supervised service. Desktop now keeps Local as the connection identity while exposing the same service-management surface used for managed SSH Hosts, without creating a duplicate remote profile or a second lifecycle authority.
Builds on the Local lifecycle ownership and cleanup semantics in #4146.
Verification
npm run lint— 2,944 files checked, no findingsgit diff --checkThe repository-wide Desktop typecheck/build is currently blocked by UI API drift already present on
origin/main(autoScrollinpackages/ui/src/chat-surface-layout.tsxandscrollOwnerinquote-companion-panel.tsx); both files are byte-identical toorigin/mainand outside this PR's diff.Electron dogfood on macOS with an isolated user-data directory verified that Local management reads the supervised service status, PID, version, update policy, and project roots; disabling Direct peer connectivity preserves the managed service and Manage entry; unified uninstall removes the lifecycle receipt, deployment, and background process.
AI use
Select exactly one:
Tool(s) and scope: OpenAI Codex implemented and reviewed the change, added focused tests, and exercised the Electron workflow. Every affected commit contains a
Generated-by: OpenAI Codextrailer.Checklist
Does this PR entail a change in behavior?
简体中文
概要
开启远程访问会把内置 Local Host 从 Desktop 子进程提升为系统托管服务。Desktop 保留 Local 作为连接身份,同时复用托管 SSH Host 的服务管理界面,不创建重复的远程 Profile,也不引入第二套生命周期 authority。
本 PR 基于 #4146 已提供的 Local 生命周期 ownership 与清理语义。
验证
git diff --check通过仓库级 Desktop typecheck/build 当前被
origin/main已存在的 UI API 漂移阻塞(packages/ui/src/chat-surface-layout.tsx的autoScroll与quote-companion-panel.tsx的scrollOwner);两个文件均与origin/main完全一致,不在本 PR diff 中。在 macOS 隔离用户目录中完成 Electron 实机验证:Local 管理界面可读取系统托管服务的状态、PID、版本、更新策略和项目根目录;关闭 Direct peer 后,托管服务与 管理 入口仍保留;统一卸载会移除 lifecycle receipt、deployment 与后台进程。
AI 使用
OpenAI Codex 参与了实现、审查、聚焦测试与 Electron 流程验证。所有受影响提交均包含
Generated-by: OpenAI Codextrailer。检查项
高价值生命周期边界已有测试覆盖;lint 与受影响测试套件均通过;行为变化已在概要中说明。