Skip to content

fix(emulator): show and stream a paired server's simulators in its workspaces - #48798

Merged
AmoabaKelvin merged 2 commits into
mainfrom
emulator-paired-server
Nov 27, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
emulator-paired-server

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

If your project lives on another computer you paired with (a Remote Orca Server), the Mobile Emulator panel now shows and controls that computer's iPhone simulators, with their live picture, instead of the ones on the laptop in front of you.

Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​199 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​199
Prod 41 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​980 $\color{#cf222e}{\Huge{\mathbf{−}}}$​179 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​801

What Changed

Before: in a workspace that lives on a paired server, the Mobile Emulator pane listed and booted this desktop's own simulators (#47447), and Connect failed with selector_not_found (#45687).

After: the pane acts on the server that runs the workspace. The device list, connecting, taps, gestures, the Home button, rotation, typing and shutting down all go to that server, and the server's simulator streams in the pane.

  • Routing: every emulator.* call goes to the workspace's owner runtime instead of { kind: 'local' }, and the tab is stamped with that host. A workspace that two hosts both claim is refused instead of guessed. Local, direct-SSH and folder workspaces still route locally, as before.
  • Picture: the server's serve-sim stream lives on the server's own loopback. After a server attach, the desktop carries it over the existing paired port forward (network.portForward), with one forward per attach:
    • It takes an OS-picked local port, so this desktop's own simulator port range stays free.
    • It's listed in Ports as "Mobile Emulator" and never saved or restored.
    • It closes when its session ends: device switch, Shut down, the pane closing, or the window reloading, crashing or closing.
    • If the server disconnects, the pane shows Connect instead of a frozen picture.
    • Main reads the H.264 stream only from a URL that names one of its own live forwards.
  • Android on a server: not supported yet, since scrcpy has no port to forward. The desktop asks the server for iOS only (new optional backend param on emulator.attach, which older servers ignore). The server never switches away another backend's session that an agent may own. The pane says "Android emulators on aren't supported yet."
  • Closing the pane: on a server, it stops only the session this desktop started, and only while it's still on that device (new optional activeDevice param on emulator.shutdown, which older servers ignore), so an agent's session there is left alone.
  • Keyboard: on a server, printable keys are sent as typed text and the keyboard-layout sync is skipped, because it would apply the server's Mac layout, not this keyboard's.
  • Copy: the picker reads "Other devices on ", and the first-use and missing-device messages name the server.

Why

The emulator pane predates paired servers: it assumed the simulator always runs on this desktop, so it hardcoded the local runtime, and serve-sim's helper URLs are loopback on whichever machine runs the simulator. Fixing routing at the call sites and carrying the stream over the paired port forward that already ships reuses existing code. It needs no new tunnel RPC, and it gets that forward's OS-account admission and flow control for free.

Supersedes #47448 by @neozheng-dev. We kept its routing approach, but replaced its new emulator.tunnel RPC and client tunnel with the existing paired port forward, which now does the same job.

Linked Issue

Fixes #47447
Fixes #45687

STA-17473, STA-16690

Visual Proof

Real captures: a hidden dev build paired to another dev build acting as the server, showing the server's workspace.

Before (main) After (this PR)
Connect, light before: selector_not_found after: server simulator streaming, Ports lists Mobile Emulator
Connect, dark before dark after dark, typed text reached the server's simulator
Device picker before: Other devices on this computer after: Other devices on mac-host
Android on a server (new) Android emulators on mac-host aren't supported yet same, dark

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

macOS, two hidden dev builds on one Mac, one paired to the other, with the server's folder workspace open on the client:

  • Main reproduces both reports: the pane lists this computer's devices, and Connect shows selector_not_found.
  • This branch:
    • The pane lists the server's devices and connects through the server.
    • The picture streams; lsof shows only the server dialing serve-sim, and the client dialing its own forward.
    • Taps open apps, and typing reaches the simulator's search field.
    • Ports shows one "Mobile Emulator" forward on an OS-picked port. Shut down, reload and server disconnect each closed it. After a disconnect the pane showed Connect, and Connect worked after reconnecting.
    • Picking an Android device shows the message without booting anything.

Tests (each fails with its guard removed):

  • paired-port-forward-sessions.test.ts (real manager, queue and save):
    • a session forward is unshared, unsaved, on an OS-picked port, and closes with its session;
    • a session that ends while its ensure is queued opens nothing;
    • an edit adopting the forward before its session ends keeps it;
    • a window reload ends the session.
  • runtime-emulator-attach.test.ts: a backend-limited attach never switches away another backend's session, whether its stream is live, and even when that session attached while the desktop's attach was choosing a device.

Performance

None for local workspaces. The only added work is one owner lookup per emulator RPC (tap, gesture end, button, committed text), which uses indexed lookups; nothing runs per render or per keystroke. A server workspace's stream goes through the existing per-server paired tunnel with its flow control and memory budget: two TCP streams per pane (video and control), with no decoding or copying beyond the tunnel framing. Each attach owns one forward, and it closes when the session ends, so idle listeners don't pile up. (Checked with perf-scan.)

Risk

Level: Medium

  • The riskiest part is the stream forward lifetime. If it's wrong, users would see a frozen picture or a leftover "Mobile Emulator" row in Ports. Forwards are never saved, and the tests above cover the end-of-session races.
  • New optional backend field on emulator.attach and activeDevice field on emulator.shutdown: older servers drop them.
  • A server without network.portForward.v1 is refused before attach, with "Update Orca on ".
  • Back out with a plain revert; nothing persisted changes.

Follow-ups, not in this PR:

  • Android emulators on a paired server.
  • A server deployed over SSH lists only its SSH forwards in Ports, so the emulator forward works but isn't listed there.
  • The server's paste key on a non-US simulator layout when no layout sync ran (pre-existing server path).
  • The pane falls back to this desktop when the workspace's owner rows are missing (same as the browser pane).
  • An agent's CLI attach and a desktop attach racing in the same workspace can still switch each other; this PR only rechecks the backend right before the switch.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • 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 (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred) (pnpm check:changed passes on fresh main; CI covers the rest)

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Emulator operations now resolve and use the runtime associated with a workspace. Remote attachment checks backend compatibility and can forward loopback stream URLs through session-owned paired ports. Port-forward sessions end when explicitly closed or when their renderer disappears. The emulator pane also receives server-specific labels, handles stream-loss events, and uses runtime-aware device, shutdown, and keyboard operations.

Severity of issue fixed: Medium

Merge Risk: Moderate · up to 7f274

With an older paired server, closing the emulator pane could stop a simulator that another client switched the workspace to. Gate the shutdown on server support, or skip it when the server cannot confirm the active device, before merging. Several smaller cleanup edge cases and one rarely flaky test remain open.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the Mobile Emulator pane now lists and streams a paired server's simulators in that server's workspaces. It uses the conventional fix(emulator) prefix and stays within…
Description check Passed The description follows the repository template and covers ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, and Risk with substantive content. It explains the before and afte…
Linked Issues check Passed Requirements from both direct linked issues are coding requirements. No non-coding task applies.

[#47447, #45687] Objective: in a workspace on a paired server, the Mobile Emulator pane lists, control…
Out of Scope Changes check Passed Each changed area supports an objective of #47447 or #45687:
- Routing and renderer hooks: emulator-* hooks, open-mobile-emulator-tab.ts, emulator-runtime-target.ts, pane session and controls. T…
Full details: Title check

Explanation

The title names the main change: the Mobile Emulator pane now lists and streams a paired server's simulators in that server's workspaces. It uses the conventional fix(emulator) prefix and stays within the 72-character guidance. The changeset routes emulator RPCs to the workspace owner, carries the stream over a paired port forward, and adds server-aware copy, which the title covers at a high level.

Full details: Description check

Explanation

The description follows the repository template and covers ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, and Risk with substantive content. It explains the before and after behavior, the mechanism, the alternative it supersedes, and the back-out path. Minor gaps remain: the AI Disclosure section is empty, and the Review and Notes sections carry no content. The template's Linked Issue, Performance, and Risk sections are filled in.

Full details: Linked Issues check

Explanation

Requirements from both direct linked issues are coding requirements. No non-coding task applies.

[#47447, #45687] Objective: in a workspace on a paired server, the Mobile Emulator pane lists, controls, attaches, and streams the server's simulators.

  • Routing: emulatorRuntimeTarget(worktreeId) replaces the hardcoded { kind: 'local' } in device listing (use-emulator-device-inventory.ts), input check (use-emulator-input-check.ts), pane controls (use-emulator-pane-controls.ts), shutdown (use-emulator-pane-shutdown.ts), and openMobileEmulatorTab. The tab is stamped with the execution host. An ambiguous owner is refused.
  • Attach (#45687): attachEmulatorOnRuntime (emulator-runtime-attach.ts) runs attach on the owner runtime. assertEmulatorDeviceShownHere checks the device on that runtime first. This addresses the selector_not_found path.
  • Stream (#47447): pairedForwardAvccUrl accepts only loopback URLs that match a live paired forward. The stream runs over a session-scoped network.portForward, so the desktop no longer dials serve-sim loopback directly.
  • Lifetime: paired-port-forward-session-end.ts and paired-port-forward-sessions.ts end forwards on session end, shutdown, reload, and disconnect.
  • Tests: paired-port-forward-sessions.test.ts covers forward ownership, unsaved state, queued-ensure races, adoption, and reload cleanup. runtime-emulator-attach.test.ts covers backend-limited attach races. The test bodies were not opened, so assertions are not independently verified.

Limits: Android on paired servers is not delivered. Both issues concern iOS simulators, so this does not leave a stated requirement unmet. The PR lists the Ports-listing gap for SSH-deployed servers and the workspace-owner fallback as follow-ups. Neither is an acceptance criterion of #47447 or #45687. Issue #40723 is a possibly related note, not an acceptance criterion.

Full details: Out of Scope Changes check

Explanation

Each changed area supports an objective of #47447 or #45687:

  • Routing and renderer hooks: emulator-* hooks, open-mobile-emulator-tab.ts, emulator-runtime-target.ts, pane session and controls. These implement the routing objective.
  • Stream forwarding: paired-port-forward-*, paired-emulator-video-url.ts, emulator-video-stream.ts, lazy-emulator-handlers.ts, the endPortForwardSession IPC channel, and the preload port-forward API. These carry the server stream to the pane.
  • Forward port choice: forward-local-port-choice.ts (port 0 requests an OS-picked port). Its effect is limited to callers that pass 0, and the paired forward uses it.
  • Backend-limited attach and Android refusal: runtime-emulator-attach.ts, emulator-params.ts (backend), emulator-errors.ts (emulator_backend_unsupported). These keep a paired attach on iOS and avoid switching another backend's session.
  • Shutdown ownership: runtime-emulator-commands.ts (activeDevice) and simulator-pane-shutdown-scheduler.ts. These limit server-side stop to the session this desktop started, which is needed for correct routing.
  • Keyboard handling: emulator-keyboard-runtime.ts, simulator-keyboard-input.ts, use-emulator-screen-keyboard.ts. On a server, printable keys go as text, which avoids applying the server's keyboard layout. This follows from routing input to the server.
  • Copy and i18n: en.json, picker, and opening-message changes. These name the server for paired workspaces, as the routing change requires.
  • The docs(ports) commit explains the OS-picked port choice and supports the forward code.

Limits: test file bodies were not opened. The claims that these changes are in scope rest on the whole-PR summary and the PR description, not on a line-by-line read.

  • 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Minor comments: 1

src/main/ports/paired-forwards/paired-port-forward-sessions.ts: 1

47-48: Minor · Stability & Availability · Poor tradeoff

Keep ended-session records while an ensure for that session is still pending.

endedSessions evicts its oldest entry after 256 endings, and nothing else tracks pending ensures. If session S ends while its ensure waits in the per-environment queue, and 256 other sessions end before that ensure resumes, S is evicted. ownPairedPortForward then accepts the ensure. The forward stays open with no owner. endPairedForwardSession already ran for S and removed its lifetime, so window closure cannot clean it up. The forward remains listed under Mobile Emulator until the user closes it.

The wait is bounded per attach by ATTACH_TIMEOUT_MS, but queue depth behind serializePortForwardChange is not bounded. The 256-entry cap therefore rests on an assumption that the code does not enforce.

Track pending ensures per session. Keep each session's cancellation record until its pending ensures settle, and keep the current removal path for an ensure whose session ends during allocation.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d8be6a69-2e3f-481e-b1e2-d44a2531722b
Commits

Reviewing files that changed from the base of the PR and between 7ba2b2c and 2c240fb.

Files selected for processing: 42

  • src/main/emulator/emulator-errors.ts
  • src/main/emulator/paired-emulator-video-url.ts
  • src/main/ipc/emulator/emulator-video-stream.ts
  • src/main/ipc/register-core-handlers/register-core-handlers.ts
  • src/main/ipc/runtime-environments/port-forwarding/runtime-environment-port-forward-handlers.ts
  • src/main/ipc/runtime-environments/runtime-environment-handler-channels.ts
  • src/main/ports/paired-forwards/paired-port-forward-free-port.ts
  • src/main/ports/paired-forwards/paired-port-forward-saved.ts
  • src/main/ports/paired-forwards/paired-port-forward-session-end.ts
  • src/main/ports/paired-forwards/paired-port-forward-sessions.test.ts
  • src/main/ports/paired-forwards/paired-port-forward-sessions.ts
  • src/main/ports/paired-forwards/paired-port-forwards.ts
  • src/main/runtime/emulator/runtime-emulator-attach.test.ts
  • src/main/runtime/emulator/runtime-emulator-attach.ts
  • src/main/runtime/emulator/runtime-emulator-commands.ts
  • src/main/ssh/port-forwarding/forward-local-port-choice.ts
  • src/preload/api/emulator/emulator-api.ts
  • src/preload/api/emulator/emulator-bridge.ts
  • src/preload/api/runtime/runtime-port-forwards-api.ts
  • src/renderer/src/components/emulator-pane/EmulatorPane.tsx
  • src/renderer/src/components/emulator-pane/devices/emulator-device-picker.tsx
  • src/renderer/src/components/emulator-pane/devices/emulator-pane-toolbar.tsx
  • src/renderer/src/components/emulator-pane/devices/use-emulator-device-inventory.ts
  • src/renderer/src/components/emulator-pane/input/emulator-keyboard-runtime.ts
  • src/renderer/src/components/emulator-pane/input/simulator-keyboard-input.ts
  • src/renderer/src/components/emulator-pane/input/use-emulator-input-check.ts
  • src/renderer/src/components/emulator-pane/input/use-emulator-screen-keyboard.ts
  • src/renderer/src/components/emulator-pane/session/emulator-opening-message.ts
  • src/renderer/src/components/emulator-pane/session/emulator-pane-types.ts
  • src/renderer/src/components/emulator-pane/session/use-configured-default-emulator-udid.ts
  • src/renderer/src/components/emulator-pane/session/use-emulator-pane-controls.ts
  • src/renderer/src/components/emulator-pane/session/use-emulator-pane-session.ts
  • src/renderer/src/components/emulator-pane/session/use-emulator-pane-shutdown.ts
  • src/renderer/src/components/emulator-pane/streaming/emulator-screen-stream-content.tsx
  • src/renderer/src/components/emulator-pane/streaming/use-emulator-video-stream.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/simulator/launch/emulator-opening-preferences-capability.ts
  • src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.ts
  • src/renderer/src/lib/simulator/runtime/emulator-runtime-attach.ts
  • src/renderer/src/lib/simulator/runtime/emulator-runtime-target.ts
  • src/renderer/src/lib/simulator/tabs/simulator-pane-shutdown-scheduler.ts
  • src/shared/rpc-contract/emulator/emulator-params.ts

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

Comment on lines +186 to +194
attachEmulatorOnRuntime<EmulatorPaneAttachResult>(
worktreeId,
{
...(device ? { device } : {}),
...(supportsPreferences ? { userInitiated: true } : {}),
focus: false
},
runtimeTarget
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Stability & Availability · Quick win

Stop a device started by a failed attach after its pane has closed.

When the pane closes during a server attach, the deferred shutdown can run before the attach records startedHere. Then it stops nothing. If the attach later fails while forwarding the stream, the server device that the attach started stays booted. The hook's failure path does not run the unmount-aware shutdown that the success path runs. The leaked simulator is not tracked for shutdown until the pane is reopened and closed again.

Make a failed attach that already started a device follow the same unmount-aware shutdown path as a successful attach. Do this when the pane is no longer mounted.

Comment on lines +259 to +261
if (!scrcpyDeviceIdFromStreamUrl(result.info.streamUrl)) {
// The server now runs this desktop's session, whether or not its stream reaches here.
stream.startedHere = result.info.deviceUdid ?? result.info.device ?? ''

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Guard the startedHere write with the attach generation.

The iOS branch writes stream.startedHere for every attach reply. It does not check whether the reply came from the latest attach. A delayed reply from a superseded attach can therefore replace the device that this desktop started. The stale stream is discarded later, but the marker remains.

The marker then pairs the superseded device with the current generation. On pane close, the desktop can request shutdown for the wrong device and leave the accepted simulator running. Add the same generation check that the stale-result path uses.

Suggested fix

--- "a/src/renderer/src/lib/simulator/runtime/emulator-runtime-attach.ts"
+++ "b/src/renderer/src/lib/simulator/runtime/emulator-runtime-attach.ts"
@@ -256,9 +256,9 @@
     }
     return result
   }
-  if (!scrcpyDeviceIdFromStreamUrl(result.info.streamUrl)) {
+  if (!scrcpyDeviceIdFromStreamUrl(result.info.streamUrl) && stream.generation === generation) {
     // The server now runs this desktop's session, whether or not its stream reaches here.
     stream.startedHere = result.info.deviceUdid ?? result.info.device ?? ''
   }
   if (scrcpyDeviceIdFromStreamUrl(result.info.streamUrl)) {
     // A server older than the backend filter handed back Android. It may be an agent's session, so
Committable suggestion

IMPORTANT
Review the replacement and indentation, then test before committing.

Suggested change
if (!scrcpyDeviceIdFromStreamUrl(result.info.streamUrl)) {
// The server now runs this desktop's session, whether or not its stream reaches here.
stream.startedHere = result.info.deviceUdid ?? result.info.device ?? ''
if (!scrcpyDeviceIdFromStreamUrl(result.info.streamUrl) && stream.generation === generation) {
// The server now runs this desktop's session, whether or not its stream reaches here.
stream.startedHere = result.info.deviceUdid ?? result.info.device ?? ''

managedOnly: true
})
async function shutdownManagedSimulator(worktreeId: string): Promise<void> {
const target = emulatorRuntimeTarget(worktreeId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Stability & Availability · Quick win

Release the stream when workspace ownership is ambiguous.

If a second host claims the workspace after attachment, emulatorRuntimeTarget throws before the try. The finally does not release the accepted forward. shutdownManagedSimulatorIfNoPane then suppresses the error.

Capture the accepted session first. Resolve the target inside the try, so ownership refusal still releases that session. Keep the shutdown RPC for an unambiguous owner.

@AmoabaKelvin
AmoabaKelvin force-pushed the emulator-paired-server branch 2 times, most recently from 948c499 to 4b4182a Compare November 25, 2026 09:21
@AmoabaKelvin
AmoabaKelvin force-pushed the emulator-paired-server branch from 4b4182a to 7f274c2 Compare November 27, 2026 21:57

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e889000b-571b-4c4c-9146-123a32620069
Commits

Reviewing files that changed from the base of the PR and between 4b4182a and 7f274c2.

Files selected for processing: 8

  • src/main/ipc/emulator/emulator-video-stream.ts
  • src/main/ipc/emulator/lazy-emulator-handlers.ts
  • src/main/ipc/runtime-environments/port-forwarding/runtime-environment-port-forward-handlers.ts
  • src/main/ports/paired-forwards/paired-port-forward-sessions.test.ts
  • src/main/ports/paired-forwards/paired-port-forwards.ts
  • src/main/runtime/emulator/runtime-emulator-commands.ts
  • src/renderer/src/i18n/locales/en.json
  • src/shared/rpc-contract/emulator/emulator-params.ts
Files skipped from review as they are similar to previous changes: 1

  • src/renderer/src/i18n/locales/en.json

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


const a = await ensurePairedPortForward({ environmentId: 'env-1', remotePort, session: 's1' })
const person = await ensurePairedPortForward({ environmentId: 'env-1', remotePort })
expect(a.entry.localPort).not.toBe(remotePort)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Exclude the server port number from OS-picked session forwards, or the assertion can fail.

The session branch in ensurePairedPortForward asks the OS for a port with localPort: 0. addOnFreeOsPort then accepts whatever port the OS returns, unless that port is reserved or held on [::1]. It never compares the result with remotePort. The test at paired-port-forward-sessions.test.ts:64-68 frees remotePort first, so the OS can return that same number. When it does, expect(a.entry.localPort).not.toBe(remotePort) fails. The failure is rare and nondeterministic, but the test checks the documented rule that session forwards stay off the server port number.

Make the OS-picked session path reject a result equal to remotePort and pick again, as the test already assumes. Limit the change to session forwards, or confirm that the shared SSH fallback should also skip remotePort. Do not change only the test: the assertion states the intended contract.

…Device

An older server would stop whichever session another client switched the workspace to.
@AmoabaKelvin
AmoabaKelvin merged commit aabafbe into main Nov 27, 2026
63 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant