Repository navigation
Conversation
There was a problem hiding this comment.
ℹ️ No blocking issues — the revert is sound and well-argued; two citation/comment nits below.
Reviewed changes
- Stop certifying a death from the relay's not-found answer —
handlePtyReattachFailureno longer callsruntime.onPtyExit(…, { hostExitConfirmed: true }); it publishespty:exitcode-1only. - Loosen the recovery gate back to refuse-on-positive-verdicts —
recoverTerminalPanenow refuses onunverifiable/liveinstead of requiring a positiveexited, keeping genuinely-dead panes recoverable (an host-attested exit tombstones the leaseterminated, so noexitedwriter co-occurs with a reattachableexpiredlease). - Revert the fabricated inventory certificate — the
observed === falsebranch returns toforgetPtyLivenessVerdict, and the orphanedmarkPtyLivenessExitedis deleted. - Tests — a new end-to-end gate test, two
pty-inventory-liveness-verdictadditions, and a ratchet pinningisProvenProcessExit(code) === falseon the published-1.
The central claim is correctly demonstrated in the tests and matches the boundary doc: every exited writer tombstones terminated, and the only expired-co-occurring signal the gate ever sees is an answered-and-omitted id, so recovering on null is the right reading. No wire change; old clients unaffected.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| // a remote pane. Lives in a `.test.ts` rather than beside the other recoverPane cases in | ||
| // orca-runtime-tests/*.spec.ts because config/vitest.config.ts — the config CI runs — includes only | ||
| // `*.test.ts`, so a ratchet placed there would never execute. |
There was a problem hiding this comment.
This justification is incorrect: the .spec.ts fragments under orca-runtime-tests/ are not skipped by CI — orca-runtime.test.ts imports all 98 explicitly, and orca-runtime-test-fragment-coverage.test.ts enforces that. The relocation is therefore unnecessary and splits these gate cases away from the sibling recoverPane cases still in terminal-handles.spec.ts (near-identical "unverifiable" and "host confirmed" tests already live there). Either correct the comment or fold these back beside them.
| // and is covered in ssh-relay-orphan-abandon-paths.test.ts. | ||
| // running on the host and duplicates its agent. This is the `unverifiable` arm only; the | ||
| // relay's own absence branch (`handlePtyReattachFailure`) reaches the runtime with no verdict | ||
| // at all, and is covered by the relay-disowned case in terminal-handles-part-02.spec.ts. |
There was a problem hiding this comment.
This points at the wrong file — the "relay-disowned" case was removed from terminal-handles-part-02.spec.ts in this same PR and now lives in terminal-pane-recovery-liveness-gate.test.ts.
4c16ecd to
69c774f
Compare
018b582 to
69c774f
Compare
|
Folded into #18013. The S1 commit ( |

Stacked on #18013. Reverts that PR's S1 commit, which I asked for and which was wrong. The other three commits (S11 tab resolution, S2
expired → attached, S5 predicate) are untouched.The question, and the answer is "no"
#18013's S1 change made
recoverTerminalPanerequire a positiveexitedverdict, and supplied that verdict by writinghostExitConfirmed: trueon thepty.attachnot-found branch. Review flagged that as fabricating a death certificate, so this branch removes it — and then asks whether the gate still works without it.It does not.
exitedand a reattachableexpiredlease are mutually exclusive by construction.recoverTerminalPanerequires anexpiredlease thatsshRemotePtyLeaseAllowsReattachpermits, but every legitimateexitedsource writesterminated:retireExitedPty(ssh-relay-session.ts:2230)terminatedif (!expiredLease)host-reports-absent(ssh-pending-pty-kill-replay.ts:49)terminatedprovider.shutdown(ssh-connection-handlers.ts:156)terminatedDemonstrated by reverting the inventory hunk while keeping the gate:
So the S1 gate as specified would have made genuinely-dead panes permanently unrecoverable.
S1 did not raise the bar — it relocated the fabrication
The one writer that did co-occur with a reattachable
expiredlease was S1's other hunk:refreshPtyWorktreeRecordsWithControllerInventorypromotingobserved === falsetoexited.That rests on exactly the evidence the review rejected.
pty.listProcessesreturns the relay's current session map, and ids arepty2:${ptyIdMintEpoch}:${n}with a fresh epoch per relay start — so a restarted relay omits every previously-minted id whether or not those shells died. Same union aspty.attachnot-found, one hop further from where it is documented.What this branch does
hostExitConfirmed: truewrite;handlePtyReattachFailurepublishes onlypty:exitcode-1again.unverifiable/live.nullthere is not "nobody asked": reaching the gate needs a registered pty record withconnected === false, and for an SSH pane onlyonPtyExitor the inventory sweep clears that — both record their doubt when they have any. A fresh app start has no pty record and fails earlier onterminal_not_found.forgetPtyLivenessVerdict.exitedretention andonPtyExit's host-attested write — a host-delivered exit frame is now its only writer. RemovedmarkPtyLivenessExited, which had no production caller once the fabricated site was gone.A second effect of change (3), easy to miss
hostExitConfirmed: truealso flipspreservesAbnormalSshSurfaceto false inonPtyExit— so a mere relay not-found was additionally runningretireMobileSessionSurfacesForPty(the pane disappears from paired-client snapshots instead of surviving the reconnect grace),retirePtyAgentLaunchAuthority,failActiveDispatchOnExit, andreconcileAgentStatusForEndedProcessFn.Old-client impact: none. No wire change, and published content returns to its pre-S1 (=
main) shape. This is strictly a rollback perdocs/reference/remote-wire-compatibility.md.Also resolves the conflict with #17963
#17963's ratchet pins the opposite claim — that
pty.attachnot-found must not certify a death — and its wording is the careful one. That ratchet is now on this branch with its original wording, so the two no longer contradict.Testing
Failing before:
After:
Test Files 3 passed (3) / Tests 19 passed (19).Negative controls, all green: a host-attested exit still recovers;
liverefuses;unverifiablerefuses; #17963's ratchet (isProvenProcessExit(publishedCode) === false) passes.Broader:
src/main/runtime+src/main/ssh→ 7858 passed;src/main/ipc/pty+src/shared→ 670 passed.tc:node,tc:web,check:code-quality:changed(0 new findings),oxfmt --checkall clean.One claim in the working notes I could not reproduce
The implementation reported that the 98
.spec.tsfiles undersrc/main/runtime/orca-runtime-tests/never run in CI, becauseconfig/vitest.config.tsincludes onlysrc/**/*.test.ts. That is not the case — all 98 are imported byorca-runtime.test.ts, which does run; the harness executes 1220 tests. The test relocation it made on that basis is unnecessary, though harmless.Follow-ups deliberately not taken
exitedby requiring the listing to name siblings on that host — the boundary doc's own test. As written it treats an empty listing from a restarted relay identically to a populated one that omits the id.SshPtyProvider.hasPtyis a client-sidelivePtyIdsset, so theobserved === falsebranch mixes host evidence with client bookkeeping.