Uh oh!
There was an error while loading. Please reload this page.
fix(desktop): preserve state across Runtime Host reconnects - #2901
Merged
Conversation
Fence reconnectable reads against replaced candidates so late responses retry through the current connection. Distinguish target changes from same-target reconnects, retain Client-owned drafts, and hide Client-path actions when the active target cannot expose local paths. Generated-by: Codex
M4n5ter
marked this pull request as ready for review
August 12, 2026 06:37
A replaced Runtime Host candidate must not publish either a stale result or a stale ordinary error. Retry reconnectable reads against the active candidate while preserving the no-replay rule for commands. Generated-by: Codex
M4n5ter
commented
Aug 12, 2026
MemberAuthor
EnglishI have manually reviewed and confirmed the fixes included in this PR, including the follow-up that prevents a replaced Runtime Host candidate from returning either a late result or a late ordinary failure. The resulting reconnect behavior and command no-replay boundary match the intended design. 简体中文我已人工审查并确认本 PR 所包含的修复,包括后续补充的修复:被替换的 Runtime Host candidate 不会再返回迟到结果或迟到的普通异常。最终的重连行为以及 command 不重放的边界符合预期设计。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
English
Summary
Prevent a replaced Runtime Host candidate from returning a late reconnectable-read result. The IPC router reuses its existing per-candidate handler identity as the connection fence and retries the read through the current candidate.
Desktop now distinguishes a real target change from a reconnect to the same target. Same-target reconnects retain Client-owned Session selection, composer drafts, attachments, and quotes while refreshing Host projections. Local-path actions in the titlebar, command palette, and Skills surface are hidden when the active target cannot expose Client paths; project identity remains visible.
Follow-up to #2834.
Verification
npm run lintnpm run format:checknpm run buildnpm run typechecknpm test -w @maka/desktop— 761 passednpm test -w @maka/ui— 113 passednpx knip --workspace apps/desktopnpx knip --workspace packages/uiagent-browser: the local project breadcrumb remained visible and actionable after making the action optionalChecklist
Does this PR entail a change in behavior?
简体中文
摘要
阻止已被替换的 Runtime Host candidate 返回延迟完成的可重连读取结果。IPC router 直接复用现有的 candidate handler 身份作为连接 fence,并通过当前 candidate 重新执行读取。
Desktop 现在会区分真正的目标切换和同一目标的重连。同目标重连会保留 Client 侧的 Session 选择、输入草稿、附件和引用,同时刷新 Host 投影。当当前目标无法暴露 Client 路径时,标题栏、命令面板和 Skills 页面会隐藏本地路径操作,但仍保留项目身份展示。
这是 #2834 的跟进修复。
验证
npm run lintnpm run format:checknpm run buildnpm run typechecknpm test -w @maka/desktop— 761 项通过npm test -w @maka/ui— 113 项通过npx knip --workspace apps/desktopnpx knip --workspace packages/uiagent-browser完成 Electron smoke:将打开动作改为可选后,本地项目 breadcrumb 仍正常显示且可操作检查清单
这个 PR 是否改变行为?
AI disclosure: Codex materially assisted with the implementation, validation, and this draft description; M4n5ter remains the contributor of record.