Skip to content

refactor(pty): delete relay-fed SSH output intake and projection threading - #27515

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-A3
Oct 11, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-A3

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 26 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3634 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3632
Prod 54 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​59 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5819 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5760

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

  • Deleted, unreachable in production:
    • all 45 src/main/ipc/ssh-pty-*.ts files: 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.
  • Local delivery path: the optional projection argument and the projectionAdmissionIds / projectionAdmissionsTransferred fields are removed from delivery/{accept,pending,flush,payload,accounting,exit,wire-session,producer-sync}.ts, ipc/resize-visibility.ts, session.ts and pty-pending-data-drain-contract.ts. So are session.sshOutputIntake, session.sourceCreditPendingPtys (only a relay span ever set it) and the intake cleanup hook in listener-lifecycle.ts. sendPtyDataToRenderer now returns sent as a plain boolean. Every removed line was either a sshOutputIntake?.… 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.
  • Shared: pty-source-credit-contract.ts / -validation.ts keep only what terminal-output-source-range.ts uses. Eleven exports that only the deleted files used are removed.
  • Tests: suites for the deleted modules are removed. Three cases that fed the intake directly are also removed: one from pty-ipc-producer-flow-control.test.ts, one from pty-pending-output-cap.test.ts, and the intake-joined it.each in terminal-multiplex-source-range-admission.test.ts. Unused vi.mock lines for the intake registry are removed from eight SSH IPC suites. reliability-gates.jsonc and ci-shard-timings.json drop 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:

  • The intake's only input calls, acceptSshPtyOutputData and acceptSshPtyOutputExit, 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.ts already hard-coded "no producer" after refactor(pty): delete the SSH PTY provider and its registry slot #27499.
  • I listed every exported symbol of the deleted files (159 names) plus the removed fields and helpers. rg -w finds zero real hits in src tests mobile config .github. The only matches are unrelated local names that happen to be spelled the same (retainedBytes, admissionError, SpanRecord).
  • The same rg -w over all 159 @ts-nocheck files finds zero hits.
  • A cascade check finds no orphaned module among the deleted files' imports.
  • build:electron-vite, build:cli and build:orcad all 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 for ackOutputSourceRanges on terminal.subscribe used 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 are null there. The client keeps the byte-window ACK (ackOutputSourceRanges is parsed as === 1 and 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 in stream-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), and setRemoteTerminalSourceRangeConsumerHooks plus 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

  • Automated tests updated (see above). No new behaviour needs a new test. The declined capability path is already covered by keeps legacy multiplex clients outside source replacement admission and the orcad-host suites.
  • Focused vitest: src/main/ipc, src/main/runtime, src/shared, src/main/daemon (including the serialize-grid transcript replay), src/main/providers, src/main/startup and tests/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, and build:electron-vite / build:cli / build:orcad.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 99572a8c-f98c-4d3a-8900-b67984a98d62

📥 Commits

Reviewing files that changed from the base of the PR and between cdf372eb7bf2f600e21a2c3d862de5ab8a1222b9 and 0522ebf.


You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c93b00b7-0925-4dcc-859d-e1dfa8a540b0



📥 Commits

Reviewing files that changed from the base of the PR and between 8622b0c and 37be659bbeeac20037b4fa71d58a43ddc22272c5.




📒 Files selected for processing (80)
  • config/reliability-gates.jsonc
  • config/scripts/ci-shard-timings.json
  • config/scripts/ssh-source-frontier-benchmark.mjs
  • src/main/ipc/pty-ipc-producer-flow-control.test.ts
  • src/main/ipc/pty-pending-data-drain-contract.ts
  • src/main/ipc/pty-pending-output-cap.test.ts
  • src/main/ipc/pty-pending-projection-admissions.test.ts
  • src/main/ipc/pty-pending-projection-admissions.ts
  • src/main/ipc/pty/delivery/accept.ts
  • src/main/ipc/pty/delivery/accounting.ts
  • src/main/ipc/pty/delivery/exit.ts
  • src/main/ipc/pty/delivery/flush.ts
  • src/main/ipc/pty/delivery/payload.ts
  • src/main/ipc/pty/delivery/pending.ts
  • src/main/ipc/pty/delivery/producer-sync.ts
  • src/main/ipc/pty/delivery/ssh-intake.ts
  • src/main/ipc/pty/delivery/wire-session.ts
  • src/main/ipc/pty/ipc/resize-visibility.ts
  • src/main/ipc/pty/provider/listener-lifecycle.ts
  • src/main/ipc/pty/register-handlers.ts
  • src/main/ipc/pty/session.ts
  • src/main/ipc/ssh-app-shutdown.test.ts
  • src/main/ipc/ssh-connect-decision-cancellation.test.ts
  • src/main/ipc/ssh-disconnect-cancellation.test.ts
  • src/main/ipc/ssh-handler-reregistration.test.ts
  • src/main/ipc/ssh-ipc-mock-shapes.ts
  • src/main/ipc/ssh-ipc-module-mocks.ts
  • src/main/ipc/ssh-ipc-test-harness.ts
  • src/main/ipc/ssh-pty-closed-generation-ranges.test.ts
  • src/main/ipc/ssh-pty-closed-generation-ranges.ts
  • src/main/ipc/ssh-pty-legacy-projection-publication.ts
  • src/main/ipc/ssh-pty-legacy-projection-record.ts
  • src/main/ipc/ssh-pty-legacy-projection.test.ts
  • src/main/ipc/ssh-pty-legacy-projection.ts
  • src/main/ipc/ssh-pty-model-admission-contract.ts
  • src/main/ipc/ssh-pty-model-admission-entry.ts
  • src/main/ipc/ssh-pty-model-admission-generation-scope.test.ts
  • src/main/ipc/ssh-pty-model-admission-limits.ts
  • src/main/ipc/ssh-pty-model-admission-migration.ts
  • src/main/ipc/ssh-pty-model-admission-pressure.ts
  • src/main/ipc/ssh-pty-model-admission-snapshot.ts
  • src/main/ipc/ssh-pty-model-admission.test.ts
  • src/main/ipc/ssh-pty-model-admission.ts
  • src/main/ipc/ssh-pty-output-exit-deadline.test.ts
  • src/main/ipc/ssh-pty-output-exit-deadline.ts
  • src/main/ipc/ssh-pty-output-exit.ts
  • src/main/ipc/ssh-pty-output-generation-guard.test.ts
  • src/main/ipc/ssh-pty-output-generation-guard.ts
  • src/main/ipc/ssh-pty-output-intake-contract.ts
  • src/main/ipc/ssh-pty-output-intake-recovery-cancellation.test.ts
  • src/main/ipc/ssh-pty-output-intake-registry.ts
  • src/main/ipc/ssh-pty-output-intake-test-harness.ts
  • src/main/ipc/ssh-pty-output-intake-validation.ts
  • src/main/ipc/ssh-pty-output-intake.test.ts
  • src/main/ipc/ssh-pty-output-intake.ts
  • src/main/ipc/ssh-pty-output-model-migration.test.ts
  • src/main/ipc/ssh-pty-output-model-migration.ts
  • src/main/ipc/ssh-pty-output-source-obligations.ts
  • src/main/ipc/ssh-pty-projection-terminality.ts
  • src/main/ipc/ssh-pty-remote-source-range-consumers.test.ts
  • src/main/ipc/ssh-pty-remote-source-range-consumers.ts
  • src/main/ipc/ssh-pty-remote-source-range-replacement.ts
  • src/main/ipc/ssh-pty-source-ack-coalescer.test.ts
  • src/main/ipc/ssh-pty-source-ack-coalescer.ts
  • src/main/ipc/ssh-pty-source-ack-publication.ts
  • src/main/ipc/ssh-pty-source-ack-session-contract.test.ts
  • src/main/ipc/ssh-pty-source-obligation-contract.ts
  • src/main/ipc/ssh-pty-source-obligation-coordinator.test.ts
  • src/main/ipc/ssh-pty-source-obligation-coordinator.ts
  • src/main/ipc/ssh-pty-source-obligation-ledger.test.ts
  • src/main/ipc/ssh-pty-source-obligation-ledger.ts
  • src/main/ipc/ssh-pty-source-obligation-state.ts
  • src/main/ipc/ssh-pty-source-obligation-transitions.ts
  • src/main/ipc/ssh-state-broadcast-fanout.test.ts
  • src/main/ipc/ssh-target-registry.test.ts
  • src/main/ipc/ssh.test.ts
  • src/main/runtime/rpc/terminal-multiplex-source-range-admission.test.ts
  • src/main/startup/headless-serve-ssh-registration.test.ts
  • src/shared/pty-source-credit-contract.ts
  • src/shared/pty-source-credit-validation.ts



💤 Files with no reviewable changes (69)
  • src/main/ipc/ssh-target-registry.test.ts
  • src/main/ipc/pty/register-handlers.ts
  • src/main/ipc/ssh-pty-closed-generation-ranges.test.ts
  • src/main/ipc/pty-pending-projection-admissions.test.ts
  • src/main/ipc/ssh-pty-source-obligation-coordinator.test.ts
  • src/main/ipc/ssh-pty-source-ack-coalescer.test.ts
  • src/main/ipc/ssh-pty-legacy-projection.test.ts
  • src/main/ipc/ssh-pty-source-ack-session-contract.test.ts
  • src/main/ipc/ssh-pty-model-admission-generation-scope.test.ts
  • src/main/ipc/ssh-disconnect-cancellation.test.ts
  • src/main/ipc/pty/ipc/resize-visibility.ts
  • src/main/ipc/ssh-pty-model-admission.test.ts
  • config/scripts/ssh-source-frontier-benchmark.mjs
  • src/main/ipc/ssh.test.ts
  • src/main/runtime/rpc/terminal-multiplex-source-range-admission.test.ts
  • src/main/ipc/ssh-connect-decision-cancellation.test.ts
  • src/main/ipc/ssh-pty-output-intake.test.ts
  • src/main/ipc/ssh-pty-source-obligation-contract.ts
  • src/main/ipc/ssh-pty-output-intake-test-harness.ts
  • src/main/startup/headless-serve-ssh-registration.test.ts
  • src/main/ipc/ssh-pty-output-model-migration.test.ts
  • src/main/ipc/ssh-pty-output-intake-validation.ts
  • src/main/ipc/ssh-handler-reregistration.test.ts
  • src/main/ipc/pty/delivery/ssh-intake.ts
  • src/main/ipc/ssh-pty-remote-source-range-consumers.test.ts
  • src/main/ipc/ssh-pty-remote-source-range-consumers.ts
  • src/main/ipc/ssh-pty-output-exit-deadline.test.ts
  • src/main/ipc/ssh-pty-output-intake-recovery-cancellation.test.ts
  • src/main/ipc/ssh-pty-output-generation-guard.test.ts
  • src/main/ipc/pty/provider/listener-lifecycle.ts
  • src/main/ipc/ssh-ipc-mock-shapes.ts
  • src/main/ipc/ssh-pty-model-admission-snapshot.ts
  • src/main/ipc/ssh-app-shutdown.test.ts
  • src/main/ipc/ssh-state-broadcast-fanout.test.ts
  • src/main/ipc/ssh-pty-model-admission-contract.ts
  • src/main/ipc/ssh-pty-output-exit-deadline.ts
  • src/main/ipc/pty/delivery/producer-sync.ts
  • src/main/ipc/ssh-pty-closed-generation-ranges.ts
  • src/main/ipc/ssh-pty-source-ack-publication.ts
  • src/main/ipc/ssh-pty-remote-source-range-replacement.ts
  • src/main/ipc/ssh-pty-source-obligation-state.ts
  • src/main/ipc/ssh-pty-projection-terminality.ts
  • src/main/ipc/pty-pending-projection-admissions.ts
  • src/main/ipc/pty/delivery/accounting.ts
  • src/main/ipc/pty-pending-output-cap.test.ts
  • src/main/ipc/ssh-pty-source-obligation-coordinator.ts
  • src/main/ipc/ssh-pty-source-obligation-ledger.test.ts
  • src/main/ipc/ssh-pty-output-generation-guard.ts
  • src/main/ipc/ssh-ipc-test-harness.ts
  • src/main/ipc/pty-pending-data-drain-contract.ts
  • src/main/ipc/ssh-pty-model-admission-pressure.ts
  • src/main/ipc/ssh-pty-model-admission-limits.ts
  • src/main/ipc/ssh-pty-model-admission.ts
  • src/main/ipc/ssh-ipc-module-mocks.ts
  • src/main/ipc/ssh-pty-output-source-obligations.ts
  • src/main/ipc/ssh-pty-output-intake.ts
  • src/main/ipc/ssh-pty-output-exit.ts
  • src/main/ipc/ssh-pty-output-intake-contract.ts
  • src/main/ipc/ssh-pty-model-admission-migration.ts
  • src/main/ipc/ssh-pty-source-obligation-transitions.ts
  • config/scripts/ci-shard-timings.json
  • src/main/ipc/ssh-pty-legacy-projection-publication.ts
  • src/main/ipc/ssh-pty-legacy-projection.ts
  • src/main/ipc/ssh-pty-source-ack-coalescer.ts
  • src/main/ipc/ssh-pty-legacy-projection-record.ts
  • src/main/ipc/ssh-pty-output-model-migration.ts
  • src/main/ipc/ssh-pty-model-admission-entry.ts
  • src/main/ipc/ssh-pty-output-intake-registry.ts
  • src/main/ipc/ssh-pty-source-obligation-ledger.ts



Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.





📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request deletes SSH PTY output-intake, model-admission, source-credit, and projection-tracking modules and their tests. PTY renderer delivery and session interfaces no longer carry projection-admission state. Reliability-gate commands and CI timing entries are updated, SSH test mocks are removed, and the source-frontier benchmark is deleted.





Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 37be6

No merge-blocking issue is established; the gate commands do not add CI test runs.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 10 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: removal of the relay-fed SSH output intake and projection threading.
Description check Passed The description is detailed and covers the change, rationale, linked-issue exception, visual proof, testing, compatibility impact, and AI disclosure sections. The Review and Checklist sections are not…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.



Full details: Docstring Coverage

Explanation

Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 10 files. (1 skipped: 1 unsupported.)






✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR





  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…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.
@OrcaWin
OrcaWin merged commit 0df25b7 into main Oct 11, 2026
31 checks passed
OrcaWin pushed a commit that referenced this pull request Oct 11, 2026
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.
OrcaWin added a commit that referenced this pull request Oct 11, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant