Skip to content

fix(ssh): never offer Move for terminals another Orca desktop or session runs - #25815

Merged
OrcaWin merged 1 commit into
OrcaWin/node-rt-phase3from
OrcaWin/node-rt-p3-move-attribution
Oct 6, 2026
Merged

OrcaWin merged 1 commit into
OrcaWin/node-rt-phase3from
OrcaWin/node-rt-p3-move-attribution

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​66 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​63
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​59 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​49

ELI5

If the only running terminals on an SSH host belong to another computer's Orca, this Orca no longer offers "Move to managed server". It says those terminals belong to another Orca desktop or session, and leaves them alone.

What Changed

Before (real-host test, host B9):

  • Desktop A had no terminals on the host. Desktop B (v1.4.218) had a live relay shell there.
  • A correctly stayed on the relay with relay_terminals_live, terminals: 1, but it also got offerMove: true.
  • A therefore showed the toast and the SSH Hosts action "Move … Its 1 open terminals will restart". That reads as if the terminal were A's own, and clicking Move targets a shell A doesn't own.

After: A shows "Runs the relay while 1 terminals another Orca desktop or session opened on this host are running." It shows no toast and no Move action.

How it works: the terminal check already tells the two cases apart:

The changes:

  • terminalsRunElsewhere(proof) (orcad-migration-terminal-gate.ts) names that case.
  • Terminal verdicts mark it as elsewhere. This covers both relayTerminalsOnConnect and the re-check once connected (relayTerminalsOnceConnected). The connect decision forwards it as terminalsElsewhere.
  • canOfferManagedServerMove returns false for it, so the connect sets no offerMove and no toast appears.
  • Relay status: the relay managedServer status gains an optional terminalsElsewhere, which the remote-state check on paired clients lets through.
  • SSH Hosts status line: it says the terminals belong to another Orca desktop or session, with no Move action.

Why

The lead preferred option (a), attribution, over (b), a stronger confirmation, as long as the census can attribute the terminals. It can, without any new probing.

Mixed case: when this desktop also has its own live terminals, the check reports those first, so Move is still offered for them. Move only stops this target's terminals, then re-runs the full check, so another desktop's shell still makes it refuse (and reconnect). It never ends that shell.

Linked Issue

Node-runtime Phase 3 real-host testing: Move offered for another desktop's relay shell (B9).

Visual Proof

N/A: copy-only change in the SSH Hosts status line, covered by the copy test. The toast and the action are absent for this case.

Testing

  • Automated tests added/updated
    • Connect-time verdict: a live count from the host-wide census only → elsewhere: true. Terminals this target lists or leases are this desktop's.
    • Re-check once connected: another desktop's live shell → terminalsElsewhere: true.
    • Connect decision: terminalsElsewhere is forwarded into the relay decision.
    • Move offer: never offered, never toasted, and the published status carries the flag.
    • Status-line copy: the other-desktop wording, with no action.
    • Admission: terminalsElsewhere passes the field-by-field check.
  • SSH host, terminal-check, move, IPC and settings suites pass. pnpm tc:node, pnpm tc:web and the changed-code gate pass.
  • Not re-run on a real host.

Review

Agent skill upstream boundary

  • Not applicable.

Notes

  • Wire compatibility: one new optional field on the relay status. Older clients drop it and would still see offerMove absent.
  • SSH verdicts: the live / unverifiable / exited verdicts are unchanged.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (CI will cover)

…ion runs

On a host where another desktop held a live relay shell, this desktop read relay_terminals_live
with offerMove, and its copy ("Its N open terminals will restart") implied they were its own. The
census already attributes them: terminals counted only by the host-wide census, with no lease or
listing of this target naming one, run under another target or session. That verdict now carries
elsewhere / terminalsElsewhere; no move is offered (no toast, no status-line action) and the status
line says the terminals belong to another Orca desktop or session.
@OrcaWin
OrcaWin force-pushed the OrcaWin/node-rt-p3-move-attribution branch from 9e2889f to 0c85e5c Compare October 6, 2026 08:04
@OrcaWin
OrcaWin merged commit 54dc1a8 into OrcaWin/node-rt-phase3 Oct 6, 2026
94 of 96 checks passed
OrcaWin pushed a commit that referenced this pull request Oct 6, 2026
…not 2.5k times

check-runtime-electron-ratchet bundled ~2,532 entry points each in full (format cjs, no
splitting), so esbuild held thousands of copies of the runtime graph: about 2.2GB RSS and 11s per
run, twice per test file. It was in flight in every unit shard that died with "The runner has
received a shutdown signal" (#25815 5/5 twice, #25876 2/5 twice). With esm + splitting the shared
modules land in one chunk: same metafile, about 200MB and 2s.
OrcaWin added a commit that referenced this pull request Oct 6, 2026
…s out of the branch-cleanup runtime (#25876)

* refactor(runtime): move run-terminal client-use and shell-alone checks out of the branch-cleanup runtime

orca-runtime-preserved-branch-cleanup.ts had grown past max-lines (303) with
the headless run-terminal helpers. Their logic now lives in
run-terminal-client-use.ts and the runtime keeps one-line delegators, with
behavior unchanged.

* fix(ci): the runtime Electron ratchet bundles its entry points once, not 2.5k times

check-runtime-electron-ratchet bundled ~2,532 entry points each in full (format cjs, no
splitting), so esbuild held thousands of copies of the runtime graph: about 2.2GB RSS and 11s per
run, twice per test file. It was in flight in every unit shard that died with "The runner has
received a shutdown signal" (#25815 5/5 twice, #25876 2/5 twice). With esm + splitting the shared
modules land in one chunk: same metafile, about 200MB and 2s.

---------

Co-authored-by: m4air <[email protected]>
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