Repository navigation
fix(ssh): replay an undelivered remote PTY stop on the next handshake (#12447 item 1) - #17011
Conversation
A pty.shutdown that dies on the transport left the remote shell running forever: kill.ts marked liveness unverifiable and nothing retried. Record the undelivered stop on the existing durable SshRemotePtyLease and replay it against the authoritative host on the next handshake to that same target, fenced by the host-minted PTY incarnation so a replay cannot kill a later PTY that reused a recycled pty-N id. Retire the record on confirmed delivery, on the host reporting the PTY absent, and on a bounded TTL. No wire change: the fence reads incarnationId, already published on pty.listProcesses. A host that does not publish it degrades to no replay.
Worktree sleep stops through stopAndWait and marks those stops reversible; when one does not land the pane stays live and the user keeps using it. An order recorded there would come back on a later handshake and kill that terminal. Only killPtyFromRuntimeController — where the client gives the PTY up for good — records one, and it skips any PTY a reversible stop owns.
|
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 (18)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe change adds durable SSH PTY kill intents with incarnation identity, validation, TTL pruning, and per-target limits. Failed or unverifiable SSH shutdowns record intents when safe to replay. Persistence APIs manage recording, clearing, and replay-attempt counts. SSH session reattachment reads host inventory, replays matching intents, confirms shutdown results, and updates leases. Tests cover persistence, failure recording, decision logic, replay behavior, and session integration. Merge Risk: 🟠 High · up to Persisted SSH PTY stops can be replayed against a replacement remote process if the PTY ID is reused during the gap between identity validation and shutdown, potentially terminating unrelated user work. A separate timestamp issue can prevent newly recorded stops from replaying at all, so these merge-readiness risks require owner attention before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description is comprehensive and on-topic. It explains the problem, implementation, safety rules, compatibility, risks, tests, and verification results. It does not reproduce several template headings or explicitly provide the requested Visual Proof, AI Disclosure, Agent skill boundary, and checklist responses, but the core required information is present.
✨ 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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/main/ssh/ssh-relay-session-terminal-error.test.ts (1)
110-114: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse the shared
createMockDepsfixture instead of localStoremock copies.src/main/ssh/ssh-relay-session-test-fixtures.tsalready exportscreateMockDepswith the same mockStore, and this PR had to add the same four kill-intent mocks in three places. Each futureStoremethod used by the relay session will need the same triple edit.
src/main/ssh/ssh-relay-session-terminal-error.test.ts#L110-L114: delete the localcreateMockDepsand import it from./ssh-relay-session-test-fixtures.src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts#L163-L167: build the store increateSessionfrom the shared fixture'smockStore, and keep only this file's specific overrides.This follows the coding guideline: "Before writing new logic at any scale — a function, component, IPC channel, state store, or whole subsystem/flow — check whether an existing implementation already does the job (or nearly does). Extend or generalize it instead of building a parallel version".
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1e01391a-f4b0-47d6-a545-39dc3c254d02
📒 Files selected for processing (28)
config/reliability-gates.jsoncsrc/main/ipc/pty-controller-ownership-routing.test.tssrc/main/ipc/pty-daemon-controller-teardown.test.tssrc/main/ipc/pty-daemon-spawn-session-identity.test.tssrc/main/ipc/pty-daemon-ssh-lease-lifecycle.test.tssrc/main/ipc/pty-pane-reservation-settlement.test.tssrc/main/ipc/pty-runtime-ssh-binding-persistence.test.tssrc/main/ipc/pty-serializer-settlement-mapping.test.tssrc/main/ipc/pty-session-liveness-and-ownership.test.tssrc/main/ipc/pty-ssh-undelivered-kill.test.tssrc/main/ipc/pty/provider/liveness.tssrc/main/ipc/pty/runtime/kill.tssrc/main/ipc/pty/runtime/undelivered-ssh-kill.tssrc/main/ipc/ssh-ipc-test-harness.tssrc/main/persistence-ssh-pending-pty-kill.test.tssrc/main/persistence/leasing-ssh-ptys/ssh-normalization.tssrc/main/persistence/leasing-ssh-ptys/ssh-pty-kill-intent-operations.tssrc/main/persistence/loading-store/ssh-lease-recovery-operations.tssrc/main/ssh/ssh-pending-pty-kill-replay.test.tssrc/main/ssh/ssh-pending-pty-kill-replay.tssrc/main/ssh/ssh-relay-session-agent-hooks.integration.test.tssrc/main/ssh/ssh-relay-session-pending-kill-replay.test.tssrc/main/ssh/ssh-relay-session-terminal-error.test.tssrc/main/ssh/ssh-relay-session-test-fixtures.tssrc/main/ssh/ssh-relay-session.tssrc/shared/ssh-pending-pty-kill.test.tssrc/shared/ssh-pending-pty-kill.tssrc/shared/ssh-types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.
| getSshRemotePtyKillIntents: vi.fn().mockReturnValue([]), | ||
| recordSshRemotePtyKillIntent: vi.fn(), | ||
| clearSshRemotePtyKillIntent: vi.fn(), | ||
| noteSshRemotePtyKillReplayAttempt: vi.fn() |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Reset the new kill-intent mocks.
reset() leaves these mocks and configured intent results intact, so one test can affect a later test. Reset all four with the other mockStore methods.
| // Why keep the earliest requestedAt: the TTL bounds how long the intent may chase the host, and | ||
| // a repeated close must not extend it. Attempts carry over so replays stay countable. | ||
| existing.pendingKill = { | ||
| ...intent, | ||
| requestedAt: Math.min(existing.pendingKill?.requestedAt ?? now, now), | ||
| attempts: existing.pendingKill?.attempts ?? intent.attempts | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Do not inherit an expired kill timestamp.
If a relay reuses this PTY ID after 30 days, this merge keeps the stale requestedAt, so the new undelivered kill is immediately excluded from replay. Treat an expired prior intent as absent before preserving its timestamp and attempts.
Proposed fix
+ const prior = existing.pendingKill
+ const priorIsCurrent =
+ prior &&
+ prior.requestedAt <= now &&
+ now - prior.requestedAt <= SSH_PENDING_PTY_KILL_TTL_MS
existing.pendingKill = {
...intent,
- requestedAt: Math.min(existing.pendingKill?.requestedAt ?? now, now),
- attempts: existing.pendingKill?.attempts ?? intent.attempts
+ requestedAt: priorIsCurrent ? Math.min(prior.requestedAt, now) : now,
+ attempts: priorIsCurrent ? prior.attempts : intent.attempts
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Why keep the earliest requestedAt: the TTL bounds how long the intent may chase the host, and | |
| // a repeated close must not extend it. Attempts carry over so replays stay countable. | |
| existing.pendingKill = { | |
| ...intent, | |
| requestedAt: Math.min(existing.pendingKill?.requestedAt ?? now, now), | |
| attempts: existing.pendingKill?.attempts ?? intent.attempts | |
| } | |
| // Why keep the earliest requestedAt: the TTL bounds how long the intent may chase the host, and | |
| // a repeated close must not extend it. Attempts carry over so replays stay countable. | |
| const prior = existing.pendingKill | |
| const priorIsCurrent = | |
| prior && | |
| prior.requestedAt <= now && | |
| now - prior.requestedAt <= SSH_PENDING_PTY_KILL_TTL_MS | |
| existing.pendingKill = { | |
| ...intent, | |
| requestedAt: priorIsCurrent ? Math.min(prior.requestedAt, now) : now, | |
| attempts: priorIsCurrent ? prior.attempts : intent.attempts | |
| } |
pty:kill is a separate implementation from killPtyFromRuntimeController and is the one an ordinary tab close reaches, so the record was never written on the path #12447 describes. Extracted it out of inspect.ts (which was over the line budget and was not what the file is named for) and wired both branches. Also: - finishPtyShutdown no longer retires the order. It runs on paths that asked the host and on paths that never did, so retiring there was a contract every caller had to know, and the one that forgot silently dropped a kill order. Retirement is the replay's, on inventory evidence only. - A recycled relay id now expires its lease. Declining to kill was only half: reattach fences on paneKey/tabId, never incarnation, so an untouched lease bound the user's old pane to whatever now holds the id. - Dropped isPtyAlreadyGoneError from the tombstone path. It matches message text a transport failure could wear; every tombstone now traces to a listing. - TTL is owned by a durable prune that actually deletes, not by a branch that was unreachable behind the read filter and only looked tested. - The replay re-reads the inventory per wave and re-checks the fence next to each shutdown, and can never reject into the connect path.
Resolve inspect.ts: #17011 moved pty:kill into renderer-kill.ts, which keeps its inline barrier await. The swap-window helper and both gates stay.
…stablyai#12447 item 1) (stablyai#17011) * fix(ssh): replay an undelivered remote PTY stop on the next handshake A pty.shutdown that dies on the transport left the remote shell running forever: kill.ts marked liveness unverifiable and nothing retried. Record the undelivered stop on the existing durable SshRemotePtyLease and replay it against the authoritative host on the next handshake to that same target, fenced by the host-minted PTY incarnation so a replay cannot kill a later PTY that reused a recycled pty-N id. Retire the record on confirmed delivery, on the host reporting the PTY absent, and on a bounded TTL. No wire change: the fence reads incarnationId, already published on pty.listProcesses. A host that does not publish it degrades to no replay. * fix(ssh): do not leave a replayable kill order behind a reversible stop Worktree sleep stops through stopAndWait and marks those stops reversible; when one does not land the pane stays live and the user keeps using it. An order recorded there would come back on a later handshake and kill that terminal. Only killPtyFromRuntimeController — where the client gives the PTY up for good — records one, and it skips any PTY a reversible stop owns. * fix(ssh): cover the renderer kill route and harden the replay's evidence pty:kill is a separate implementation from killPtyFromRuntimeController and is the one an ordinary tab close reaches, so the record was never written on the path stablyai#12447 describes. Extracted it out of inspect.ts (which was over the line budget and was not what the file is named for) and wired both branches. Also: - finishPtyShutdown no longer retires the order. It runs on paths that asked the host and on paths that never did, so retiring there was a contract every caller had to know, and the one that forgot silently dropped a kill order. Retirement is the replay's, on inventory evidence only. - A recycled relay id now expires its lease. Declining to kill was only half: reattach fences on paneKey/tabId, never incarnation, so an untouched lease bound the user's old pane to whatever now holds the id. - Dropped isPtyAlreadyGoneError from the tombstone path. It matches message text a transport failure could wear; every tombstone now traces to a listing. - TTL is owned by a durable prune that actually deletes, not by a branch that was unreachable behind the read filter and only looked tested. - The replay re-reads the inventory per wave and re-checks the fence next to each shutdown, and can never reject into the connect path. (cherry picked from commit 7bbb8ad)
…stablyai#12447 item 1) (stablyai#17011) * fix(ssh): replay an undelivered remote PTY stop on the next handshake A pty.shutdown that dies on the transport left the remote shell running forever: kill.ts marked liveness unverifiable and nothing retried. Record the undelivered stop on the existing durable SshRemotePtyLease and replay it against the authoritative host on the next handshake to that same target, fenced by the host-minted PTY incarnation so a replay cannot kill a later PTY that reused a recycled pty-N id. Retire the record on confirmed delivery, on the host reporting the PTY absent, and on a bounded TTL. No wire change: the fence reads incarnationId, already published on pty.listProcesses. A host that does not publish it degrades to no replay. * fix(ssh): do not leave a replayable kill order behind a reversible stop Worktree sleep stops through stopAndWait and marks those stops reversible; when one does not land the pane stays live and the user keeps using it. An order recorded there would come back on a later handshake and kill that terminal. Only killPtyFromRuntimeController — where the client gives the PTY up for good — records one, and it skips any PTY a reversible stop owns. * fix(ssh): cover the renderer kill route and harden the replay's evidence pty:kill is a separate implementation from killPtyFromRuntimeController and is the one an ordinary tab close reaches, so the record was never written on the path stablyai#12447 describes. Extracted it out of inspect.ts (which was over the line budget and was not what the file is named for) and wired both branches. Also: - finishPtyShutdown no longer retires the order. It runs on paths that asked the host and on paths that never did, so retiring there was a contract every caller had to know, and the one that forgot silently dropped a kill order. Retirement is the replay's, on inventory evidence only. - A recycled relay id now expires its lease. Declining to kill was only half: reattach fences on paneKey/tabId, never incarnation, so an untouched lease bound the user's old pane to whatever now holds the id. - Dropped isPtyAlreadyGoneError from the tombstone path. It matches message text a transport failure could wear; every tombstone now traces to a listing. - TTL is owned by a durable prune that actually deletes, not by a branch that was unreachable behind the read filter and only looked tested. - The replay re-reads the inventory per wave and re-checks the fence next to each shutdown, and can never reject into the connect path.
Fixes the remote process leak behind #12447 — the one its "Expected behavior" bullet 1 asks for: "if the remote kill cannot be delivered, record the intent and retry on reconnect — never silently drop it."
ELI5
You close a terminal that is running on a computer somewhere else. Orca sends "please stop" over the network. If the network hiccups at that exact moment, the message never arrives — and until now, Orca just shrugged and forgot about it. Your window closed, so it looked fine. But the program kept running on the other computer, forever, holding a shell and often a whole AI agent.
Now Orca writes the request down in a notebook that survives closing your laptop. Next time it talks to that same computer, it reads the notebook and asks again.
The tricky part is making sure it asks about the right thing. The remote side names its terminals
pty-1,pty-2, … and starts over atpty-1whenever it restarts. So "please stop pty-1" written down yesterday could hit a completely different terminal today — someone else's work. To prevent that, Orca also writes down a fingerprint the remote side gives each terminal when it is born. Before asking again, it checks the fingerprint still matches. If it doesn't, Orca tears the page out instead of asking.Root cause
src/main/ipc/pty/runtime/kill.tsreturnedfalsewhen the shutdown RPC rejected with anything that was notisPtyAlreadyGoneError. It marked livenessunverifiableand warned — correct perdocs/reference/ssh-execution-boundary.md, a transport failure observes nothing — and then nothing ever retried. There was no pending-kill journal.A relay PTY is a child of the detached relay daemon, not of the ssh channel, and the shipped grace default is keep alive until reset. So the shell — and whatever agent it was running — survived on the user's remote machine indefinitely.
The same hole existed on the offline close: when no provider is registered,
killPtyFromRuntimeControllertombstones the leaseterminatedlocally and tells the renderer, but the relay is never asked at all. That branch is the common one — a laptop closed mid-failure.#16752 (client-local close tombstones) and #16970 (relay-id fence) stopped the client showing or resurrecting a tab for that orphan. Neither one stopped the process.
The fix
Record the intent durably, on both kill routes. There are two:
killPtyFromRuntimeController(runtime/CLI) and thepty:killIPC, which is whatwindow.api.pty.killreaches and therefore what an ordinary tab close uses — the route #12447 actually describes. They are separate implementations and both now record. The IPC handler moved out ofipc/inspect.tsintoipc/renderer-kill.ts: it was not what that file is named for, and keeping it there put the file over the 300-line budget (nomax-linesdisable was added).The record itself:
SshRemotePtyLease— the existing per-(targetId, relayPtyId)durable record, which already survives restart — gains one optional field,pendingKill. No parallel journal: the lease is already the thing that names a remote PTY, so the eventual liveness consolidation adopts one record rather than deleting a second one.src/shared/ssh-pending-pty-kill.tsholds the colocated type plus the pure decision logic, deliberately shaped aftersrc/shared/closed-terminal-tab-tombstones.ts(TTL + cap + a retirement rule that never deletes on absence of evidence).Replay it on the next handshake to the same host.
replayPendingSshPtyKillsruns at the top ofSshRelaySession.reattachKnownPtys, which bothestablish()andreconnect()await — so a PTY that dies here is never re-adopted as a live pane by the reattach that follows it.Fence it on the host-minted PTY incarnation.
toAppSshPtyIdisconnectionId + relayPtyId, and a redeployed relay renumbers frompty-1(src/relay/pty-handler.ts,private nextId = 1), so the id alone is not safe — that is the #16970 collision. The relay mints anincarnationId(randomUUID()) per PTY process and already publishes it onpty.listProcesses. The replay only issuespty.shutdownwhen the host still reports that exact incarnation for that id, and it re-checks that immediately before each call rather than trusting the selection pass.This fence has to live on the client.
pty.shutdowntakes{ id, immediate, keepHistory }and no identity parameter, and the relay kills whatever holds the id — its handler also returns the same empty success for a PTY it never had. Adding anexpectedIncarnationparam would be a safe Rule-1 field, but an old host would ignore it, so the client would still have to fence itself and the host change would buy nothing today.Retire on three paths, and never assert an exit.
terminatedterminatedexpired— no killOnly the two rows carrying positive evidence of absence from the host that owns the process write a
terminatedtombstone, and both derive it from a successfulpty.listProcesses— never from an error predicate.isPtyAlreadyGoneErrormatches message text (/Session not found/i) that a transport failure could wear, and #16763 landed precisely because that class of flattening had already gone wrong here once; a tombstone resting on it would bury a live remote shell. Nothing here emits a renderer exit event — the synthetic exit already fired at kill time — and no branch invents anexitedfor something nobody observed. The vocabulary stayslive/unverifiable/exited.Retirement is never inferred from a resolved RPC.
finishPtyShutdowndeliberately does not clear the order. It runs both on paths that asked the host and on paths that never did, so retiring from there would be a contract every call site had to remember — and the one that forgot would silently drop a valid kill order. It is also not evidence: the relay answerspty.shutdownfor a PTY it never had with the same empty success. Retirement belongs to the replay, which only ever acts on a livepty.listProcesses.A recycled id expires the lease that named it. Declining to kill is only half the fix. The reattach one step later filters on lease state and fences on
paneKey/tabId, never on incarnation — so an untouched lease would bind the user's old pane to whatever process now holds the recycled id. It is markedexpired, notterminated: losing the route is all that was observed, and nothing says the shell it named ever died.Only a caller that gives the PTY up for good records an order. This is the sharpest edge in the change and it is worth stating explicitly.
stopAndWaitPtyFromRuntimeControllerdeliberately records nothing: worktree sleep stops through it and wraps those stops inmarkReversibleStops, and when one does not land the pane is left live and usable and the failure is handed back to the caller. An order recorded there would come back on a later handshake and kill a terminal the user had gone back to using — turning a leak fix into a data-loss bug.recordUndeliveredSshPtyKilladditionally refuses any PTY a reversible stop currently owns, so the rule is enforced rather than assumed. Both are covered by tests.Wire-compatibility analysis
Per
docs/reference/remote-wire-compatibility.md:pty.listProcessesandpty.shutdown, both long-shipped.pendingKillis client-local persisted state and never crosses the wire.incarnationIdonpty.listProcessesresults (added in fix(terminal): make remote agent sessions host-authoritative #9687). That is Rule 1, and it has the second state Rule 1 alone does not describe: absent means the host never published one — not "no incarnation", and not "matches".decideSshPendingPtyKillreturnsdeferfor absent, so a client newer than its host does not replay at all rather than replaying unfenced. Degraded, never dangerous. The record also cannot be created without an incarnation (recordUndeliveredSshPtyKillno-ops), so against a host that never publishes one the whole feature is inert and behavior is exactly today's.normalizeSshRemotePtyLeaseis a strict whitelist, so an older build reading a store written by this one dropspendingKilland behaves exactly as it does today. A downgrade loses queued kill orders; it cannot corrupt or misfire them. That whitelist is also whynormalizeSshPendingPtyKillhad to be added to it — without that the record was silently stripped on every launch, the same failureclosed-terminal-tab-tombstones.tsrecords having shipped once. A test covers it.tests/e2e/cross-version-wire/) covers the terminal stream only and is unaffected; this change is on the relay RPC path, which it does not exercise, and nothing about the framing moved.Cost on the connect path, and containment
Zero when nothing is pending —
replayPendingSshPtyKillsreads the store and returns before touching the mux. When something is, it is one inventory per wave of 4 plus one to prove the batch: two round trips for the common single-order case,ceil(n/4)+1at worst. A per-PTYverifyPtyStoppedwas the first shape and cost two round trips per order; one inventory for the whole batch was the second and left the fence going stale across the batch. Per-wave is the compromise, and it is what keeps a stop's identity evidence within one round trip of the stop.replayPendingSshPtyKillsnever rejects. It is best-effort work thatestablish()/reconnect()await, so an unguarded throw — including from a persistence write — would turn a failed cleanup into a failed SSH connection, which is strictly worse than the leak. Two tests pin it, one for a throwing store read and one for a throwing write.Growth is bounded by a 30d TTL and 200 records per target (not globally), enforced on write, on read, and by a durable prune that actually deletes.
Residual risks, stated rather than implied
pty.shutdowncarries{ id, immediate, keepHistory }and no incarnation, so the host enforces nothing and no client-side arrangement can make list-then-kill atomic. Re-reading per wave and re-checking beside each call narrows the window to one round trip; it cannot close it. Closing it needs the host to refuse a stale kill — an incarnation onpty.shutdown, capability-negotiated per Rule 2. That is deliberately out of scope here and is exactly the kind of thing the SSH-v3 consolidation should absorb: "the execution host owns everything that touches execution."incarnationId. Their orders defer forever and leave only via the 30d TTL, which deliberately does not tombstone the lease. That is correctness over leak-prevention — an unfenced kill on a renumbered id is worse than the leak — but it does mean the leak is unfixed against pre-fix(terminal): make remote agent sessions host-authoritative #9687 hosts.relay-id-recycled, but nothing surfaces that a wrong kill may have happened. Diagnostics gap, not a correctness one.confirmDelivered's inventory read is notshouldContinue()-gated mid-loop, so a late retirement can land over a superseded mux. It only ever acts on positive host evidence, so this is redundant rather than wrong.Deliberately not in this PR
finishPtyShutdownmarks the leaseterminatedand callsmarkClaudePtyExitedon RPC success alone, including on a branch whose own comment says the relay was never asked. By this PR's own standard that isunverifiablebeing written asexited. It is pre-existing, it is not compounded here — this change no longer touches that function's retirement behaviour at all, and the replay readspendingKillacross every lease state, so even a wrongly-tombstoned lease still gets its order replayed. Fixing it properly means settling what counts as proof of death across everyfinishPtyShutdowncaller, which deserves its own review rather than riding along. Tracked as follow-up work.Fix evidence
Every test was verified to bite by reverting the fix and capturing the red output.
1. The leak itself — remove the
recordUndeliveredSshPtyKillcalls fromkill.ts:2. Restart survival — remove
pendingKillfrom the lease load whitelist:3. The recycled-id fence — delete the incarnation-mismatch branch:
The unfenced build kills the recycled PTY. That is the failure this test exists to prevent.
4. TTL retirement — delete the TTL branch:
5. Bounded growth — remove the per-target cap:
6. The session wiring — remove the
replayPendingSshPtyKillscall fromreattachKnownPtys:7. The renderer kill route — remove the
recordUndeliveredSshPtyKillcalls fromipc/renderer-kill.ts(thepty:killIPC a tab close reaches):8. The recycled-id lease expiry — delete the
relay-id-recycledbranch fromretire(), leaving the order cleared but the lease active:That is the state in which reattach binds the user's old pane to whatever now holds the recycled id.
9. The phantom lease's state — create the invented lease
attachedinstead ofterminated:10. The reversible-stop carve-out — re-add a
recordUndeliveredSshPtyKillcall to thestopAndWaitfailure path, and separately drop thereversibleStopOwnersByPtyIdguard:The other two retirement paths (delivery confirmed, host reports absent), the "still live after a replayed stop" case, the two-round-trip batching bound, and the wire-skew degradation are covered in
src/main/ssh/ssh-pending-pty-kill-replay.test.ts.Checks
pnpm tccleanoxlintclean repo-wide; nomax-linesdisable added anywherepnpm test src/main/ipc/ src/main/ssh/plus the persistence and shared suites — 465 files, 5137 passingChurn outside the change itself: existing
Storestubs in the PTY/SSH tests gained the new methods, and thepty:killhandler moved fromipc/inspect.tstoipc/renderer-kill.ts(a straight lift, plus the recording calls).