fix(desktop): replace conflicting Local Runtime Host during startup - #4185
Conversation
679e52c to
5348488
Compare
jackwener
left a comment
There was a problem hiding this comment.
Reviewed at exact head 5348488762699c8ffd11e488d1005b99d7396169.
The replacement path is appropriately narrow: Desktop offers the destructive action only for a canonical supervised Local Host, the user's consent is bound to the observed Host epoch and PID, and the CLI revalidates that identity under the deployment lock before retiring or replacing anything. Ephemeral, remote-profile, stale-owner, and successor-owner cases remain fail-closed. Registry and development-archive paths both retain exact package identity, and the original connection is retried only after the replacement transaction completes.
The full workspace build, lint, eight affected test files (115/115), diff check, commit attribution, and the current-main merge result passed locally. The first hosted test attempt failed only in three unchanged WorkHub E2E cases; the exact base-main CI run is green and this PR does not change those WorkHub surfaces, so I triggered a failed-job rerun. The Windows package check is still running. Those hosted jobs remain merge gates, but I found no P0–P2 issue in this change.
Automated review notice: This comment was posted by an automated review agent operated by WAWQAQ. It is not an independent human review and does not replace one.
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
5348488 to
cb2b957
Compare
English
Summary
Desktop can resolve an incompatible Local Runtime Host during startup without asking users to discover an unknown process:
The admission fence covers interrupted-transition recovery and normal replacement. Compatible Hosts release the State Root before the updater acquires a writer fence and retires the supervisor, preventing a restarted process from becoming the new Host during cutover.
Verification
16731with PID54831, advanced the deployment revision from 3 to 4, and opened Desktop successfully.npm run lintnpm run format:check@maka/core,@maka/storage,@maka/runtime-host,maka-agent, and the Desktop main process after rebasing ontoorigin/main.AI use
Select exactly one:
Tool(s) and scope: OpenAI Codex implemented, reviewed, tested, and dogfooded the change. Every commit includes the required
Generated-bytrailer.Checklist
Does this PR entail a change in behavior?
中文
概要
Desktop 启动时遇到不兼容的本地 Runtime Host,可以直接解决冲突,不再要求用户自行寻找未知进程:
admission fence 同时覆盖中断事务恢复与正常替换。兼容 Host 释放 State Root 后,更新器先取得 writer fence,再退休 supervisor,避免重启进程在 cutover 期间成为新 Host。
验证
16731替换为 PID54831,部署 revision 从 3 升至 4,Desktop 正常进入主界面。npm run lintnpm run format:checkorigin/main后构建@maka/core、@maka/storage、@maka/runtime-host、maka-agent与 Desktop 主进程。AI 使用
OpenAI Codex 完成实现、审阅、测试和真实 dogfood;每个提交都包含要求的
Generated-bytrailer。