fix(desktop): bound Runtime Host handler waits - #3795
Open
hqhq1025 wants to merge 1 commit into
Open
Conversation
Astro-Han
reviewed
Aug 25, 2026
Astro-Han
left a comment
Contributor
There was a problem hiding this comment.
I reviewed this head and found no blocking issues.
The reconnect handler wait now correctly times out after 5s (configurable) instead of hanging indefinitely when the Host is unavailable, with retry handling. No new authority or state.
Minor note: timeoutMs=0 edge (remaining 0ms) lacks a direct test, but the <=0 branch exists.
No P0-P2. Checks on 32fbe34c pending — code GO.
简体中文
该头未发现阻断。
hqhq1025
force-pushed
the
codex/fix-followup-send-host-reconnect
branch
from
August 25, 2026 13:15
32fbe34 to
5581c57
Compare
Contributor
Author
|
Rebased onto current Local verification on
Please re-review the refreshed head. |
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 free
to 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.
Problem
When a Runtime Host candidate exits, its channel handlers are removed while the target epoch remains active so a replacement candidate can reconnect. Calls arriving in that interval waited indefinitely for a handler.
The composer performs a reconnectable task-readiness read before sending. If the Host never returned, that promise never settled, so the composer kept its submission guard latched and both the Send button and Enter stopped working.
Root cause
RuntimeHostReconnectingIpcMain.#waitForHandler()supported a timeout only for reconciled controls. Initial dispatches and ordinary reconnectable-read replacement waits called it without a deadline.Fix
RuntimeHostHandlerUnavailableErrorafter the deadline so callers release pending interaction state and retain retryable input.Tests
npm --workspace @maka/desktop run build:mainnode --test apps/desktop/dist/main/__tests__/runtime-host-reconnecting-ipc-main.test.js(15/15, repeated 10 times)npx biome check apps/desktop/src/main/runtime-host-reconnecting-ipc-main.ts apps/desktop/src/main/__tests__/runtime-host-reconnecting-ipc-main.test.tsgoal-dialogDOM-environment failures (getComputedStyle is not defined) and do not touch this path.Repository baseline note
The full workspace dependency build on current
mainis independently blocked by three staleRuntimeHostConnection.queryTurn/stopTurn/startTurncalls inexecution-host-queue.test.tsafter #3784. This PR does not include that unrelated migration.UI evidence
No visual styling or layout changes. The behavior change is covered at the IPC ownership boundary where the indefinite promise originated.