fix(web): recover stale response streams - #1086
Merged
SamSaffron merged 5 commits intoAug 30, 2026
Merged
Conversation
Format the reviewed reconnect test and update stale bundle ceilings. Upstream main is already 436 bytes over the 423,000-byte JS raw budget and 161 bytes over the 161,500-byte CSS raw budget; this PR builds at 424,638/124,876 bytes for JS and 161,661/31,132 bytes for CSS under local Go 1.27 compression. Set bounded ceilings of 426,000/126,000 and 162,500/32,000 respectively.
Only publish newly discovered prompts instead of every recovery refresh, and publish terminal state transitions so peer tabs reconcile once. This prevents cross-tab interaction refreshes from bouncing indefinitely and re-rendering approval or ask-user dialogs during user input.
Treat a session's request ID as the stable interaction identity when recovery reports a different or newly-known response ID. This keeps a dismissed or resolved prompt from surviving as a duplicate waiting record and reopening its modal.
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
response.createdevent instead of aborting every admitted POST into snapshot recoveryRoot causes
The mobile failure was a chain of three independent holes:
fetch()returned a response.1, while the server emits a generated run epoch. The firstresponse.createdevent therefore caused an epoch mismatch, aborted the original WebRTC POST, and forced every response through snapshot recovery.404was treated as a retryable transport failure. The server session was idle, but the stale local projection remained the UI authority and displayedWorking/Running a commandindefinitely.Behavior
An authoritative status sample that began while the same projected response was active can now reconcile an idle server through the durable transcript revision. Once that revision is installed and the session remains idle, the stale projection, transport lease, and supervisor are retired. A newer run or an uninstalled transcript revision prevents retirement.
Verification
mise x node@24 -- npm test— 408 tests passedmise x node@24 -- npm run typecheckmise x node@24 -- npm run lint:tsmise x node@24 -- make buildWorkingnow clears