Repository navigation
Let a timed-out remote terminal pane reconnect when the host session is still alive - #12213
Conversation
A remote-runtime PTY pane that missed the 60s auto-recovery window latched to "disconnected" permanently, even while the host kept the session alive and streaming. The cutoff destroyed every path back at once: it dropped the pending retry and evicted the pane from the shared retry registry (so window `online` and system-resume became no-ops), and the transport tore down the accepted host-snapshot listener. The listener was also inert for the common case, since a host that keeps publishing the same live handle never rotates it. The cutoff now only stops the retry timer; the pane keeps its pending retry and stays revivable. The accepted-snapshot listener survives the latch, and a post-cutoff snapshot is accepted as reattach evidence whether the host rotated the handle or republished the same one. The require-replacement published-wait guard is scoped to its own recovery epoch so Reconnect and online/resume are no longer swallowed. No new polling: a latched pane still issues zero self-initiated RPCs, and the same-handle reattach consumes a snapshot the client already receives. Closes #12097
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe changes update remote PTY recovery and reattachment behavior. Recovery preserves pending retries after deadline expiration and allows disconnected panes to start new recovery epochs. The transport tracks recovery epochs for published-handle waits, retries subscriptions for republished handles, and continues rebinding for replacement handles. Tests cover timeout cleanup, manual revival, same-handle reattachment, rotated handles, retry polling, callbacks, and cleanup. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts (1)
1347-1355: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueUse the returned epoch for the resubscribe call.
recovery.begin()returns the new epoch, sosubscribeToHandle(...)can use that exact value instead of readingrecovery.currentEpoch.♻️ Optional use of the returned epoch
- recovery.begin() + const reattachEpoch = recovery.begin() clearPublishedHandleWait() const reusedPtyId = remotePtyId - void subscribeToHandle(recovery.currentEpoch, true).catch((error) => { + void subscribeToHandle(reattachEpoch, true).catch((error) => {
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 06be15ba-29f8-43f8-9d5c-6309a4a47337
📒 Files selected for processing (4)
src/renderer/src/components/terminal-pane/remote-runtime-pty-deadline-reattach.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-recovery-state.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-recovery-state.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
… lands The recovery cutoff now keeps a pending retry so online/resume can revive a latched pane, but the host-session attach wait schedules a single-shot closure that the cutoff itself resolves. Retaining it left the pane registered as revivable work: 'online' would bump the epoch, arm a fresh 60s deadline and flip the phase to 'recovering' while invoking a no-op, hiding the working Reconnect button and the same-handle snapshot reattach for a full minute. The attach wait now discards its own scheduled retry as it settles, so a pane latched on that path stays 'disconnected' and Reconnect keeps working. Retries scheduled by the resubscribe paths re-enter real work and are unaffected. Co-authored-by: Orca <[email protected]>
…to 'ready' Co-authored-by: Orca <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/remote-runtime-pty-deadline-reattach.test.ts (1)
327-332: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winStrengthen the "no RPC in flight" claim with a call-count assertion.
The comment at Line 330 states that replaying the settled attach wait would happen "with no RPC in flight," but the test only asserts that
retryAllRemoteRuntimePtyRecoveriesNow()returns0advanced recoveries.retryNow()could still issue an RPC throughruntimeCallwithout counting as "advanced," so the current assertion does not directly verify the claim in the comment. CaptureruntimeCall.mock.calls.lengthbefore Line 331 and assert it is unchanged afterward, to directly validate the exact regression this PR fixes.♻️ Proposed strengthening of the assertion
+ const callCountBeforeRetry = runtimeCall.mock.calls.length // The attach wait is single-shot and the cutoff already settled it; replaying it would spin the banner with no RPC in flight. expect(retryAllRemoteRuntimePtyRecoveriesNow()).toBe(0) expect(transport.getRecoveryState?.().phase).toBe('disconnected') + expect(runtimeCall.mock.calls.length).toBe(callCountBeforeRetry)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d5388f36-d497-49e3-975a-b6f07862630d
📒 Files selected for processing (3)
src/renderer/src/components/terminal-pane/remote-runtime-pty-deadline-reattach.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-recovery-state.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/renderer/src/components/terminal-pane/remote-runtime-pty-recovery-state.ts
- src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
…onnect and resume Reconnect and the online/system-resume trigger both opened a fresh recovery epoch, which switched off the accepted-snapshot reattach path (gated on the 'disconnected' phase) for 60s while the require-replacement inventory wait dead-ended without scheduling anything. Gate the same-handle reattach on a spent auto-recovery window instead of the live phase, consumed once per window, and park an unarmed retry at the require-replacement dead end so online/resume/Reconnect have work to revive. Co-authored-by: Orca <[email protected]>
…gistry entry The recovery cutoff now keeps the retry-registry entry and the accepted-snapshot listener alive, so cover the two module-global collections that could accumulate: destroy/detach cycles, concurrent latched panes, revive storms and snapshot churn all return to baseline. Co-authored-by: Orca <[email protected]>
…C claim Addresses both CodeRabbit nitpicks: subscribeToHandle now takes the epoch begin() returned rather than re-reading currentEpoch, and the latched attach-wait test asserts the runtime call count is unchanged instead of only the advanced count. Co-authored-by: Orca <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/renderer/src/components/terminal-pane/remote-runtime-pty-deadline-reattach.test.ts (2)
290-294: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the reattached handle.
The length check proves only that a second subscription exists. It does not prove that the new subscription uses
terminal-stale. Assert the latest subscribed handle, or the exact expected handle sequence, in both tests.Also applies to: 321-325
305-317: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winExercise the online and system-resume triggers.
Line 317 calls
retryAllRemoteRuntimePtyRecoveriesNow()directly. This verifies the scheduler, not that the online listener or system-resume listener invokes it. Add explicit coverage for both triggers, or rename this test and add integration coverage for the event bridge.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bd2c9873-f7b0-4b17-87cc-5518854417ad
📒 Files selected for processing (5)
src/renderer/src/components/terminal-pane/remote-runtime-pty-deadline-reattach.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-latched-pane-retention.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-recovery-state.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-recovery-state.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
…is still alive (#12213) * fix(terminal): let a timed-out remote terminal pane reconnect again A remote-runtime PTY pane that missed the 60s auto-recovery window latched to "disconnected" permanently, even while the host kept the session alive and streaming. The cutoff destroyed every path back at once: it dropped the pending retry and evicted the pane from the shared retry registry (so window `online` and system-resume became no-ops), and the transport tore down the accepted host-snapshot listener. The listener was also inert for the common case, since a host that keeps publishing the same live handle never rotates it. The cutoff now only stops the retry timer; the pane keeps its pending retry and stays revivable. The accepted-snapshot listener survives the latch, and a post-cutoff snapshot is accepted as reattach evidence whether the host rotated the handle or republished the same one. The require-replacement published-wait guard is scoped to its own recovery epoch so Reconnect and online/resume are no longer swallowed. No new polling: a latched pane still issues zero self-initiated RPCs, and the same-handle reattach consumes a snapshot the client already receives. Closes #12097 * fix(terminal): drop the settled attach retry when the recovery cutoff lands The recovery cutoff now keeps a pending retry so online/resume can revive a latched pane, but the host-session attach wait schedules a single-shot closure that the cutoff itself resolves. Retaining it left the pane registered as revivable work: 'online' would bump the epoch, arm a fresh 60s deadline and flip the phase to 'recovering' while invoking a no-op, hiding the working Reconnect button and the same-handle snapshot reattach for a full minute. The attach wait now discards its own scheduled retry as it settles, so a pane latched on that path stays 'disconnected' and Reconnect keeps working. Retries scheduled by the resubscribe paths re-enter real work and are unaffected. Co-authored-by: Orca <[email protected]> * fix(test): type the reattach host snapshot factory so status narrows to 'ready' Co-authored-by: Orca <[email protected]> * fix(terminal): keep an exhausted remote pane reattachable through Reconnect and resume Reconnect and the online/system-resume trigger both opened a fresh recovery epoch, which switched off the accepted-snapshot reattach path (gated on the 'disconnected' phase) for 60s while the require-replacement inventory wait dead-ended without scheduling anything. Gate the same-handle reattach on a spent auto-recovery window instead of the live phase, consumed once per window, and park an unarmed retry at the require-replacement dead end so online/resume/Reconnect have work to revive. Co-authored-by: Orca <[email protected]> * test(terminal): pin latched-pane retention to one listener and one registry entry The recovery cutoff now keeps the retry-registry entry and the accepted-snapshot listener alive, so cover the two module-global collections that could accumulate: destroy/detach cycles, concurrent latched panes, revive storms and snapshot churn all return to baseline. Co-authored-by: Orca <[email protected]> * refactor(terminal): use the returned reattach epoch and pin the no-RPC claim Addresses both CodeRabbit nitpicks: subscribeToHandle now takes the epoch begin() returned rather than re-reading currentEpoch, and the latched attach-wait test asserts the runtime call count is unchanged instead of only the advanced count. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
…is still alive (stablyai#12213) * fix(terminal): let a timed-out remote terminal pane reconnect again A remote-runtime PTY pane that missed the 60s auto-recovery window latched to "disconnected" permanently, even while the host kept the session alive and streaming. The cutoff destroyed every path back at once: it dropped the pending retry and evicted the pane from the shared retry registry (so window `online` and system-resume became no-ops), and the transport tore down the accepted host-snapshot listener. The listener was also inert for the common case, since a host that keeps publishing the same live handle never rotates it. The cutoff now only stops the retry timer; the pane keeps its pending retry and stays revivable. The accepted-snapshot listener survives the latch, and a post-cutoff snapshot is accepted as reattach evidence whether the host rotated the handle or republished the same one. The require-replacement published-wait guard is scoped to its own recovery epoch so Reconnect and online/resume are no longer swallowed. No new polling: a latched pane still issues zero self-initiated RPCs, and the same-handle reattach consumes a snapshot the client already receives. Closes stablyai#12097 * fix(terminal): drop the settled attach retry when the recovery cutoff lands The recovery cutoff now keeps a pending retry so online/resume can revive a latched pane, but the host-session attach wait schedules a single-shot closure that the cutoff itself resolves. Retaining it left the pane registered as revivable work: 'online' would bump the epoch, arm a fresh 60s deadline and flip the phase to 'recovering' while invoking a no-op, hiding the working Reconnect button and the same-handle snapshot reattach for a full minute. The attach wait now discards its own scheduled retry as it settles, so a pane latched on that path stays 'disconnected' and Reconnect keeps working. Retries scheduled by the resubscribe paths re-enter real work and are unaffected. Co-authored-by: Orca <[email protected]> * fix(test): type the reattach host snapshot factory so status narrows to 'ready' Co-authored-by: Orca <[email protected]> * fix(terminal): keep an exhausted remote pane reattachable through Reconnect and resume Reconnect and the online/system-resume trigger both opened a fresh recovery epoch, which switched off the accepted-snapshot reattach path (gated on the 'disconnected' phase) for 60s while the require-replacement inventory wait dead-ended without scheduling anything. Gate the same-handle reattach on a spent auto-recovery window instead of the live phase, consumed once per window, and park an unarmed retry at the require-replacement dead end so online/resume/Reconnect have work to revive. Co-authored-by: Orca <[email protected]> * test(terminal): pin latched-pane retention to one listener and one registry entry The recovery cutoff now keeps the retry-registry entry and the accepted-snapshot listener alive, so cover the two module-global collections that could accumulate: destroy/detach cycles, concurrent latched panes, revive storms and snapshot churn all return to baseline. Co-authored-by: Orca <[email protected]> * refactor(terminal): use the returned reattach epoch and pin the no-RPC claim Addresses both CodeRabbit nitpicks: subscribeToHandle now takes the epoch begin() returned rather than re-reading currentEpoch, and the latched attach-wait test asserts the runtime call count is unchanged instead of only the advanced count. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
Summary
A remote-runtime terminal pane that missed the 60-second auto-recovery window latched to
disconnectedforever, even though the host session was alive and streaming (terminal.listreportingconnected=true, orphaned=false). The cutoff severed every path back at the same instant:armDeadline's expiry calledclearRetryTimer()(remote-runtime-pty-recovery-state.ts:162onmain), which droppedpendingRetryand didscheduledRecoveries.delete(this). WindowonlineandpowerMonitor 'resume'— the only two automatic triggers (src/renderer/src/runtime/use-remote-runtime-recovery-triggers.ts:11-15) — became permanent no-ops for that pane.onChangehandler calledclearPublishedHandleWait()ondisconnected(remote-runtime-pty-transport.ts:238-240onmain), unsubscribing the accepted-host-snapshot listener, which after bounded inventory polling stops is the pane's only event-driven path back.waitForPublishedHostSessionHandleignored any snapshot whoseterminalHandle === previousHandle(remote-runtime-pty-transport.ts:1332onmain), and a host that keeps a live surface only ever republishes the same handle.Renderer-only changes (line numbers are on this branch):
remote-runtime-pty-recovery-state.ts:205-217— splitclearRetryTimer()into a privatestopRetryTimer()(timer handle only) and the existing full teardown. The deadline now callsstopRetryTimer()(armDeadline,:184-198, call at:191-192), so a latched pane keeps its pending retry and stays inscheduledRecoverieswhile arming no timer of its own.remote-runtime-pty-recovery-state.ts:123-145—retryNow()also fires fordisconnected, opening a fresh epoch (epoch += 1,attempt = 0, new deadline) so the transport'srequestedRecoveryEpochsatisfiesisCurrent().remote-runtime-pty-recovery-state.ts:104-113— newparkRetryForExternalTrigger(): a wait that ends with no liveness evidence (bounded inventory exhausted, or arequire-replacementpolicy with no replacement published) arms no backoff timer at all, so before this change there was nothing foronline/resume to advance. The transport parks an unarmed retry there (remote-runtime-pty-transport.ts:1479-1485). BecauseretryNow()still requiresbackoffordisconnected, a parked retry cannot fire while recovery is still running — it only becomes reachable after the cutoff.remote-runtime-pty-recovery-state.ts:115-121— newdiscardPendingRetry():waitForHostSessionAttachRetryis single-shot, so it drops its own scheduled retry when it settles (remote-runtime-pty-transport.ts:563-587). Without this, replaying that wait after the cutoff would strand the pane inrecoveringwith no RPC in flight.remote-runtime-pty-transport.ts:242-253—clearPublishedHandleWait()moves to adisposed-only branch; the stream close andsubscriptionGenerationbump stay ondisconnected, so the listener survives the latch. The same block sets a newautoRecoveryWindowSpentflag ondisconnectedand clears it onidle.remote-runtime-pty-transport.ts:1350-1370— a post-cutoff snapshot republishing the same handle is now accepted as reattach evidence. It is gated onautoRecoveryWindowSpent(set only when a full 60 s window expired, cleared on a healthyidleand consumed by each accepted reattach), on there being no live multiplexed stream for that handle, and onsurfacePresenthost evidence (:1343-1346retires the pane otherwise). The resubscribe is issued assubscribeToHandle(epoch, /* sameHandleEndRecovery */ true), so a successful reattach is recorded byrecordSameHandleEndReuseand feeds the existingHOST_SESSION_SAME_HANDLE_END_REUSE_LIMITescalation. A post-cutoff rotated handle re-opens a recovery epoch before rebinding (:1367-1370), so a failed resubscribe isn't swallowed as already-latched.remote-runtime-pty-transport.ts:1553-1559,1579— therequire-replacementpublished-wait early return is scoped to its own recovery epoch viapublishedHandleWaitEpoch. Because the wait now survives the latch (change 5), the unscoped guard would otherwise silently swallow the Reconnect button and everyonline/resume revive.Net:
disconnectedstill means "automatic retrying stopped" — no timer, no self-initiated RPC — but a host snapshot (rotated or same handle),online/system-resume, and the Reconnect button all reach a fresh subscribe again.Closes #12097 — the reported failure mode (a pane latched at
auto-retry stoppedwhile the host session is alive and streaming, with Reconnect not restoring it). Two of the issue's suggested fixes are deliberately not implemented: there is no new tab-visibility/focus trigger, and no low-frequency background retry loop while latched. The pane is revived by host evidence the client already receives, byonline/system-resume, or by Reconnect — see Limitations.ELI5
Your terminal window connects to a machine somewhere else. If the connection drops, the app spends a minute quietly trying to get it back. Before this change, once that minute ran out the app threw away all its notes — so even when the other machine said "I'm right here, still running," nothing was listening, and clicking Reconnect went nowhere. Now the app stops trying on its own after a minute, but keeps its notes. The moment the other machine says it's alive, or your laptop wakes up, or your network comes back, the window quietly reconnects.
Fix proof
The throwaway repro used while diagnosing (
remote-runtime-pty-transport.bug-12097.test.ts) is not part of this diff — it was reworked into permanent, correctly-named suites:remote-runtime-pty-deadline-reattach.test.ts(new, transport-level, following theremote-runtime-pty-snapshot-escape-tail.test.ts/remote-runtime-pty-query-reply-immediate.test.tsfocused-file idiom in the same directory) and rewritten/added cases in the existingremote-runtime-pty-recovery-state.test.ts. Coverage corrections and additions made while reworking:RECOVERY_DELAYS_MS[0](250 ms), so it fired long before the 60 s cutoff and left nothing pending to preserve. The real backoff ladder (250, 500, 1000, 2000, 4000, 8000, 15_000, 30_000) sums to 60,750 ms, i.e. the 8th attempt is armed at t=30.75 s and is still pending when the cutoff lands. The permanent test models that.online/resume). The permanent transport suite has six, adding: the actual reported case (host republishes the same handle after the cutoff), a negative case proving the same-handle fence is untouched before the cutoff, the Reconnect window, and a pane latched during the attach wait (where replaying the single-shot wait must be refused).remote-runtime-pty-recovery-state.test.tsgains two new cases beyond the rewritten registry test: reviving a parked retry that never armed a backoff timer, and refusing to park over an armed backoff or a stale epoch.Permanent suites against unfixed source (both changed source files reverted to
main, tests kept) — 7 failures:The two cases that pass without the fix are the intended negatives:
ignores a same-handle snapshot while automatic recovery is still running(the#7718fence must stay intact pre-cutoff) andleaves Reconnect available when online fires on a pane latched during the attach wait.Same suites with the fix — all green:
No regressions
All neighbouring
terminal-panesuites plus every suite importing the two changed modules.Specifically preserved:
remote-runtime-pty-transport.test.ts"reattaches from a later host snapshot after bounded replacement polling stops" (including its subscriber-count 1 → 1 → 0 sequence and its "user input must not turn a bounded reconnect into recurring host-inventory polling" assertion), the post-cutoff quiescence assertions elsewhere in that file (runtimeCall/runtimeSubscribecall counts unchanged across 5 minutes after the cutoff), and theit.eachregistry test assertingmarkHealthy/markDisconnected/cancel/disposestill evict a pane fromscheduledRecoveries.Trade-offs
These are real user-visible changes, not zero-cost:
retireRemoteTerminalId→onPtyExit) instead of sitting there with a Reconnect button. This is the correct pre-deadline behavior, but it is new for latched panes.recovering; if the reattach fails it re-latches after a fresh 60 s window rather than staying latched.#7718same-handle fence is deliberately narrowed. A post-cutoff same-handle snapshot now re-subscribes a handle a stale error previously fenced off. It is gated on a full 60 s window having been spent (autoRecoveryWindowSpent), on there being no live multiplexed stream, and on freshsurfacePresenthost evidence. The reattach is counted byrecordSameHandleEndReuse— it is not blocked byHOST_SESSION_SAME_HANDLE_END_REUSE_LIMIT; the counter's effect is to escalate the replacement policy on the following stream-end cycles. Same-handle behavior before the deadline is unchanged, and a dedicated negative test pins it.beginResubscribeInventoryWindowis keyed on epoch, soHOST_SESSION_INVENTORY_MAX_WINDOWS_PER_RECOVERYbecomes a per-online/resume-event cap rather than a lifetime cap. Bounded per event, unbounded in aggregate across many events on a flapping link.Cross-platform
Pure renderer TypeScript over
setTimeout/clearTimeoutand in-memorySet/Map. No platform-conditional code, no keyboard shortcuts (nometaKey/ctrlKey), no Electron accelerators, no shortcut labels, no filesystem paths (so nopath.joinneed). Identical on macOS, Linux and Windows.window.api.ui.onSystemResumed(main-processpowerMonitor 'resume') and theonlineevent are pre-existing triggers whose plumbing is untouched; this change only makes them effective for latched panes, on every OS.SSH / remote: this is the remote path. The bug only exists for remote-runtime PTY panes reached over a runtime environment (the report is a VPN'd
ws://host:6768), and the fix is specifically about tolerating a slow reconnect instead of giving up permanently. Nothing assumes local execution, and the same-handle reattach consumes an event the client already receives rather than issuing a new round trip — the right shape for a high-latency link.Folder workspaces (non-git): unaffected.
worktreeIdis used purely as a runtime session selector viatoRuntimeWorktreeSelector; no Git is run, no.gitis inspected, and nothing assumes the workspace is a worktree. No Git subcommand, option, capability probe, orGitCapabilityCacheentry is added or changed, so the Git 2.25 baseline and GitHub/GitLab provider compatibility are untouched.Performance
Setentry and one accepted-snapshot subscriber that previously would have been released.queueAcceptedWebSessionTerminalSnapshotearly-returns when there are no subscribers for the session key, and otherwise only iterates subscribers for snapshots the client is already receiving;resolveSubscriberUpdateis a filter over one snapshot's tab list.RuntimeMobileSessionTabsResultan inventory poll would have fetched, so it is strictly better evidence than asession.tabs.listat no request cost. The regression test asserts thesession.tabs.listcount is unchanged across the reattach.autoRecoveryWindowSpentbefore resubscribing and callsrecovery.begin(), so further snapshots are ignored until another full 60 s window has been spent — at most one same-handle resubscribe per 60 s per latched pane.emitRecoveryStateis already de-duplicated bylastRecoveryStateKey.Security
No change. No IPC surface added or modified, no command execution, no path handling, no auth or credential surface touched. The change is confined to renderer-side recovery scheduling and to which already-received host snapshot events are acted on. The
#7718stale-handle fence is narrowed (see Trade-offs), but it still requires fresh host evidence that the surface is present — it cannot attach to an arbitrary or attacker-chosen handle, only to the handle the host itself is currently publishing for this pane.Limitations
session.tabssnapshot for its surface, whenonline/system-resume fires, or when the user clicks Reconnect. If a client somehow stops receiving session-tabs snapshots for that worktree and neither trigger fires, the pane stays latched until Reconnect is clicked. The issue's suggested "re-arm on tab visible/focused" and "low-frequency retry while latched" were not implemented.AI Review Report
Reviewed by independent subagents in a loop until clean, across two hostile lenses — correctness/regressions and cross-platform + remote + performance.
Remediation applied between rounds: 1 pass(es). Findings judged false-positive were rejected with evidence rather than coded around.
Made with Orca 🐋