Skip to content

[Bug]: Remote-runtime WebSocket is never compressed and the desktop subscription sends ~29x the underlying change rate — paired clients unusable on sub-1 Mbps links #22151

Closed

Description

@tian2-ai

Operating system

macOS

Orca version

1.4.206 desktop client paired to a 1.4.205 macOS runtime (direct ws:// over a WireGuard-based mesh VPN, no relay)

Details

Short summary

The remote-runtime WebSocket never negotiates compression, and the desktop subscription stream sends roughly 29x more bytes than the underlying content actually changes. On a LAN this is invisible. On a link whose single-TCP-flow ceiling is ~0.8 Mbps, the subscription alone consumes ~90% of it, the host's send buffer stays pinned at its 128 KB limit, and every interactive UI action queues behind it — file tree and file open take minutes.

A paired desktop client is currently more bandwidth-hungry than a compressed remote-desktop stream, while carrying orders of magnitude less information.

Measurement 1 — the connection is uncompressed

Raw upgrade against the runtime's WebSocket port, offering the extension:

> Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

< HTTP/1.1 101 Switching Protocols
< Upgrade: websocket
< Connection: Upgrade
< Sec-WebSocket-Accept: ...

No Sec-WebSocket-Extensions in the response — negotiation fails, so the stream is uncompressed for the life of the connection. src/main/runtime/rpc/ws-transport.ts never sets perMessageDeflate, and the ws server default is off.

This is not a missing capability: perMessageDeflate?: boolean already exists in src/shared/remote-runtime-subscription-contract.ts. It is simply never enabled on the server side. The direct path is already encrypted by the underlying VPN, so there is no compress-then-encrypt conflict here.

Measurement 2 — ~29x amplification over actual content

30-second window, 17 live terminals on the host, client idle (no user interaction):

quantity value
new terminal output produced on the host 2.1 KB/s
bytes actually sent host to client 60.8 KB/s
ratio ~29x

Per-second sampling over 40 s: median 71 KB/s, range 14–192 KB/s, with sustained bursts at 150–192 KB/s. This is continuous, not triggered by user actions.

Measurement 3 — LAN vs WAN control, same protocol, same host

Two paired desktop clients against the same runtime at the same time:

client RTT status (4 KB) terminal list (13.6 KB)
LAN 2 ms 332 ms 342 ms
WAN 74 ms 430 ms 542 ms

The request/response RPC path is healthy on both — the WAN client is only 100–200 ms slower, which is what the added RTT predicts. The slowness users experience is not in this path.

Measurement 4 — a fresh connection is fast while the app's connection is jammed

Those RPC numbers come from the CLI, which opens its own connection per invocation. The desktop app multiplexes the subscription stream and interactive requests over one long-lived connection. On the host:

  • Send-Q on the app's socket to the WAN client: pinned at 131072 (the full buffer) in ~100% of 1 Hz samples
  • Send-Q on the app's socket to the LAN client: 0–1 KB
  • draining 128 KB at that link's single-flow rate takes ~1.4 s, and it refills continuously

So a fresh connection to the same host over the same link is fast, while the app's connection is permanently backed up. That is head-of-line blocking behind the subscription stream, not a slow link.

Link characteristics for reference: single TCP flow ~0.8 Mbps, 4 parallel flows ~1.6 Mbps aggregate, RTT 74 ms, 1–5% loss. Reverse direction (client to host) measured 19.7 Mbps, so this is specific to the host's upstream.

Why this matters

Orca ships structured state. It should need far less bandwidth than a remote-desktop stream, which ships pixels. Today it needs more, because it (a) does not compress, (b) re-sends full state rather than deltas, and (c) re-replays scrollback on every pane recovery remount (see below). A remote-desktop protocol does the opposite of all three.

Suggested fix, in order of effort

  1. Enable perMessageDeflate on the runtime WebSocket server. The option already exists in the contract. JSON state typically compresses 5–10x. This alone would likely move this deployment from unusable to usable, and would help every bandwidth-constrained remote user.
  2. Send deltas rather than repeated full snapshots for the global subscription — the 29x figure is the size of the prize.
  3. Give interactive requests a separate channel, or priority, so they are not queued behind a saturated subscription stream.

Related

How can we reproduce it

  1. Pair a desktop client to a runtime across a link limited to roughly 1 Mbps in the host-to-client direction.
  2. Keep ~15–20 terminals open on the host, agents mostly idle.
  3. Observe continuous 60–190 KB/s host-to-client traffic while actual terminal output is ~2 KB/s, and Send-Q pinned at the socket buffer limit.
  4. Compare against a second client on the LAN: same protocol, same host, no perceptible latency.

Activity

  1. added
    os:macos
    on Sep 22, 2026
  2. AmethystLiang commented on Sep 22, 2026

    @AmethystLiang
    Contributor

    very valid... working on some improvements

  3. added a commit that references this issue on Oct 16, 2026
    2e510c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

os:macos

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions