feat(desktop): manage Runtime Host update policy - #3771
Conversation
e69de0f to
ae5a1dd
Compare
Expose each managed Host's update policy and one-shot reconciliation through its bound SSH operator. Require explicit scheduler support before presenting automatic updates as available. Generated-by: Codex
ae5a1dd to
d61bc15
Compare
Exclude stale build output from development CLI archives, own the packaging child lifecycle, and keep managed update targeting and scheduler support represented once. Generated-by: Codex
Apply reconciliation service snapshots atomically, avoid redundant SSH reads after failed status, and fail closed when policy state becomes uncertain. Generated-by: Codex
Astro-Han
left a comment
There was a problem hiding this comment.
I reviewed this head and found a blocking issue.
[P2] Development build closing race allows immediate retry to join a doomed build
runtime-host-setup-package.ts:104-111 reuses shared developmentBuild even while its close is still in flight. After the last waiter aborts and closes, a new resolve() can immediately pick the same closing build and receive stopped instead of starting a fresh build.
Fix: mark closing builds as unavailable and handle last-waiter/new-waiter race with proper ownership.
Checks on ca70545a12 are package: success but test: pending — not green.
简体中文
存在开发构建关闭竞态阻断。Terminate interactive SSH process trees through the shared platform abstraction.\n\nBuild transient CLI archives outside formal release outputs and clean them with the Desktop resolver.\n\nGenerated-by: OpenAI Codex
Keep closing development builds as serialization barriers without letting new callers join their doomed result.\n\nFence process-tree termination with the PTY exit identity before acting on its PID.\n\nGenerated-by: OpenAI Codex
Astro-Han
left a comment
There was a problem hiding this comment.
Update on 6cafd6fac7:
[P2] Closing build still reusable
runtime-host-setup-package.ts:103-111 reuses developmentBuild while its close is still in flight; immediate retry joins the doomed build and gets stopped.
[P2] SSH terminator lacks incarnation guard
runtime-host-ssh-terminal.ts:997-1002 passes PID to async terminator without hasExited/incarnation check; after exit and before discovery, a reused PID could receive SIGTERM/SIGKILL intended for the old PTY.
Checks on 6cafd6fac7 are package: success but test: queued — not green.
English
Summary
Managed Runtime Hosts can now follow a per-Host update policy: manual, an exact version, the latest stable channel, or the next preview channel. Desktop reads and changes the policy through the Host's bound SSH operator, exposes one-shot reconciliation, and reconnects after a compatible update.
Automatic policies are offered only when the Host reports a healthy update scheduler. Every Desktop policy and reconciliation request is fenced to the expected managed service target, so a stale or redirected operator cannot mutate another Host.
Local Desktop development now prepares and caches a private CLI archive on first use.
MAKA_RUNTIME_HOST_SETUP_ARCHIVEremains an optional override; normal development no longer depends on a matching npm version being published.Fixes #3768
Verification
git diff --check— passedScreenshots
AI use
Tool(s) and scope: OpenAI Codex contributed implementation, tests, analysis, and remote Desktop verification under maintainer direction and review
Checklist
Does this PR entail a change in behavior?
简体中文
摘要
现在可以为每个受管 Runtime Host 分别选择更新策略:手动、固定版本、Latest 稳定频道或 Next 预览频道。Desktop 通过该 Host 绑定的 SSH operator 读取和修改策略,支持立即执行一次 reconciliation,并在兼容更新后重新连接。
只有 Host 报告更新调度器状态正常时才开放自动更新策略。Desktop 发出的每个策略与 reconciliation 请求都会绑定预期的受管服务目标,避免过期或被重定向的 operator 修改其他 Host。
本地 Desktop 开发现在会在首次需要时自动生成并缓存私有 CLI archive。
MAKA_RUNTIME_HOST_SETUP_ARCHIVE仍可用于显式覆盖;常规开发不再依赖 npm 已发布相同版本。修复 #3768
验证
git diff --check— 通过截图
AI 使用
工具与范围:OpenAI Codex 在维护者指导和审核下参与了实现、测试、分析和远程 Desktop 验证
检查清单
本 PR 是否会改变行为?