fix(desktop): keep transcript lifecycle registry-owned - #3711
Open
Astro-Han wants to merge 1 commit into
Open
Conversation
Astro-Han
marked this pull request as ready for review
August 24, 2026 11:43
Keep a transcript consumer registered after delivery failures and request a reset instead of silently detaching it. This preserves the Registry as the sole lifecycle authority across Host replacement and removes the Observer's duplicate renderer-destruction listener. Generated-by: Codex
Astro-Han
force-pushed
the
fix/transcript-consumer-lifecycle
branch
from
August 24, 2026 18:10
a1da22e to
52adc4e
Compare
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.
Summary
RuntimeHostSessionObservationRegistryas the sole transcript lifecycle authority and remove the Observer duplicate renderer-destruction listenerThe production diff is
+4 / -11. The earlier Renderer close/reopen retry has been removed; this repair adds no retry protocol, recovery state, or second consumer identity.Root cause
RuntimeHostSessionObservertreated delivery work failure as consumer termination and removed the physical consumer from its indexes.RuntimeHostSessionObservationRegistrystill retained the renderer logical registration because it owns continuity across Runtime Host replacement. Every later range request therefore passed the Registry and failed in the Observer withDesktop transcript consumer does not exist.The diagnostic report cannot distinguish whether the original detach was triggered by a send failure, acknowledgement timeout, or delivery-capacity protection. All three entered the same silent-detach path.
Architecture
The lifecycle is now one-way:
This removes the conflicting Observer termination authority. Explicit close, renderer destruction, and Registry shutdown still release the consumer and idle Session normally.
Verification
Desktop transcript consumer does not existnode --test apps/desktop/dist/main/__tests__/runtime-host-session-observer.test.js apps/desktop/dist/main/__tests__/desktop-transcript-range-store.test.js— 51 passednpm --workspace @maka/desktop run typechecknpx biome check apps/desktop/src/main/runtime-host-session-observer.ts apps/desktop/src/main/__tests__/runtime-host-session-observer.test.tsnpm run check:asf-headersThe previous CI failure was inherited from five missing ASF headers on the old base. #3708 fixed that baseline failure; this branch is rebased onto current green
mainand the new exact-head CI is running.AI use
Select exactly one:
Tool(s) and scope: Codex diagnosed the lifecycle mismatch, performed the simplification audit, authored the Observer repair and regression coverage, and ran the focused automated and real-window verification. The commit includes the required
Generated-by: Codextrailer.Checklist
Does this PR entail a change in behavior?