Repository navigation
refactor(pty): delete relay-fed SSH output intake and projection threading - #27515
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
📥 Commits
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established; the gate commands do not add CI test runs. Pre-merge checks |
|
37be659 to
cdf372e
Compare
…ading Nothing in production feeds the SSH PTY output intake: its only data and exit entry points were called from tests, and the SSH PTY provider that would have fed it is gone. Delete the intake, its source-obligation ledger, model admission, projection publication and source-ack plumbing, and strip the projection ids and source-credit bookkeeping they threaded through the local renderer delivery path (accept, pending, flush, payload, accounting, exit, session). Local terminal delivery is unchanged. Because the intake also installed the runtime's remote source-range hooks, this desktop host now answers a terminal.subscribe that asks for ackOutputSourceRanges the way every orcad host already does: without the capability, so the client uses the byte-window ACK. No source ranges were ever attached to local output.
cdf372e to
0522ebf
Compare
The host side of the terminal source-range ACK protocol had one producer: the relay-fed SSH output intake, deleted in #27515. Since then nothing installs the runtime's source-range hooks and nothing passes source ranges into PTY output, so every terminal.multiplex subscribe that offers ackOutputSourceRanges is already answered without it and uses the byte-window ACK. Delete the ledger, the per-connection registry, the consumer hook surface on the runtime, the stream-level reservation/commit/rollback plumbing in flow control, initial snapshot and cleanup, the source-range ACK frame schema, and the range slicing in output chunks, batching and replay. The subscribe schema still accepts the ackOutputSourceRanges capability, and the client keeps its range-ACK support for older hosts. A new golden test pins that an offering subscribe gets the same reply and frames as a byte-ACK one.
The host side of the terminal source-range ACK protocol had one producer: the relay-fed SSH output intake, deleted in #27515. Since then nothing installs the runtime's source-range hooks and nothing passes source ranges into PTY output, so every terminal.multiplex subscribe that offers ackOutputSourceRanges is already answered without it and uses the byte-window ACK. Delete the ledger, the per-connection registry, the consumer hook surface on the runtime, the stream-level reservation/commit/rollback plumbing in flow control, initial snapshot and cleanup, the source-range ACK frame schema, and the range slicing in output chunks, batching and replay. The subscribe schema still accepts the ackOutputSourceRanges capability, and the client keeps its range-ACK support for older hosts. A new golden test pins that an offering subscribe gets the same reply and frames as a byte-ACK one. Co-authored-by: m4air <m4air@Mac.localdomain>
ELI5
When Orca still drove SSH terminals through the old relay, the relay's output came into the app through a dedicated "intake". The intake tracked every chunk until the screen had shown it, so the relay could be told how much it was allowed to send next. The relay and the SSH terminal provider are gone (#27214, #27215, #27499), so nothing hands the intake any output now. It still starts with the app, and the local terminal path still carries its bookkeeping. This PR deletes the intake and that bookkeeping. Local terminals behave the same.
What Changed
src/main/ipc/ssh-pty-*.tsfiles: the intake and its registry, model admission, legacy projection, source-obligation ledger and coordinator, source-ACK coalescer and publication, generation guards, exit deadline and remote source-range consumers;ipc/pty/delivery/ssh-intake.ts, which built the intake when PTY handlers were registered;ipc/pty-pending-projection-admissions.ts;config/scripts/ssh-source-frontier-benchmark.mjs, a benchmark for one of the deleted files.projectionAdmissionIds/projectionAdmissionsTransferredfields are removed fromdelivery/{accept,pending,flush,payload,accounting,exit,wire-session,producer-sync}.ts,ipc/resize-visibility.ts,session.tsandpty-pending-data-drain-contract.ts. So aresession.sshOutputIntake,session.sourceCreditPendingPtys(only a relay span ever set it) and the intake cleanup hook inlistener-lifecycle.ts.sendPtyDataToRenderernow returnssentas a plain boolean. Every removed line was either asshOutputIntake?.…call on a field that was never fed, or a branch that ran only when a projection id was present. Local output never had one.pty-source-credit-contract.ts/-validation.tskeep only whatterminal-output-source-range.tsuses. Eleven exports that only the deleted files used are removed.pty-ipc-producer-flow-control.test.ts, one frompty-pending-output-cap.test.ts, and the intake-joinedit.eachinterminal-multiplex-source-range-admission.test.ts. Unusedvi.mocklines for the intake registry are removed from eight SSH IPC suites.reliability-gates.jsoncandci-shard-timings.jsondrop the deleted files; the gate checker passes.Net lines: prod +52 / −5,362 (−5,310), tests +2 / −3,725 (−3,723), config +7 / −366 (−359).
Why
Phase 3.99 (A3) removes code that is compiled, wired at startup and tested, but that nothing in production feeds. The projection bookkeeping sat in the terminal delivery hot path, so every change to local delivery had to keep it intact. The alternative was to stop installing the intake and leave the threading in place. That would leave dead branches on every flush, ACK, drop and exit.
Proof the deleted code is unreachable:
acceptSshPtyOutputDataandacceptSshPtyOutputExit, had no production caller. They were used only by two PTY IPC tests and the SSH IPC mock module. Its generation, migration and publisher entry points (allocateSshPtyProviderGeneration,beginSshPtyOutputGenerationMigration,installSshPty{SourceAck,SourceCancellation}Publisher,applySshPty*CancellationProof,getSshPtyAcceptedSourceCheckpoints,closeSshPtyOutputGeneration) were referenced only by that mock.ssh-intake.tsalready hard-coded "no producer" after refactor(pty): delete the SSH PTY provider and its registry slot #27499.rg -wfinds zero real hits insrc tests mobile config .github. The only matches are unrelated local names that happen to be spelled the same (retainedBytes,admissionError,SpanRecord).rg -wover all 159@ts-nocheckfiles finds zero hits.build:electron-vite,build:cliandbuild:orcadall succeed.One observable change, mixed-version safe (the design assumed this was dead, but it is not exactly): the intake was also the only thing that installed the runtime's remote source-range hooks (
setRemoteTerminalSourceRangeConsumerHooks). So a paired client that asks this desktop app forackOutputSourceRangesonterminal.subscribeused to get it granted. No source range was ever attached to local output, so those streams carried empty range lists. Now the desktop host declines the capability, which is what every orcad and headless host already does: the hooks arenullthere. The client keeps the byte-window ACK (ackOutputSourceRangesis parsed as=== 1and defaults to off). Every client version that requests the capability already handles hosts that decline it, so old and new clients both work. The request field stays accepted instream-schemas.ts. The host-side source-range ledger itself is deleted in A6, and that PR's golden test (a byte-identical reply) relies on this.Left for later PRs in the stack:
OrcaRuntime.acceptPtyDataBounded/resetPtyModelAfterMigrationFailure(A4), andsetRemoteTerminalSourceRangeConsumerHooksplus the source-range ledger (A6). They now have no production caller.SSH boundary / folder workspaces / Windows / WSL: nothing here decides liveness or routes work, so no SSH-owned state ever becomes local or exited. Folder workspaces, Windows and WSL paths are untouched; the WSL guest has its own transport.
Linked Issue
N/A (maintainer, Phase 3.99 cleanup plan, PR A3)
Visual Proof
N/A. No UI change. Local terminal output, flow control, hidden-pane drops and exit ordering are unchanged.
Testing
keeps legacy multiplex clients outside source replacement admissionand the orcad-host suites.src/main/ipc,src/main/runtime,src/shared,src/main/daemon(including the serialize-grid transcript replay),src/main/providers,src/main/startupandtests/e2e/cross-version-wire. 3,058 files and 33,130 tests passed.pnpm tc,oxlint,pnpm run check:code-quality:changed(0 new findings),pnpm lint(all ratchets OK),check-reliability-gates, andbuild:electron-vite/build:cli/build:orcad.AI Disclosure
Review
Agent skill upstream boundary