Repository navigation
Description
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-Qon the app's socket to the WAN client: pinned at 131072 (the full buffer) in ~100% of 1 Hz samplesSend-Qon 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
- Enable
perMessageDeflateon 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. - Send deltas rather than repeated full snapshots for the global subscription — the 29x figure is the size of the prize.
- Give interactive requests a separate channel, or priority, so they are not queued behind a saturated subscription stream.
Related
- [Bug]: spawn-left-pane-unbound leaves a remote pane silently unable to accept input, with no surfaced state #20159 —
spawn-left-pane-unboundrecovery remounts. On this deployment they fire spontaneously (6 remounts and 12terminal_replay_guard_wedged_releasein 45 minutes with no user interaction), and each recovery re-replays that pane's scrollback, up toTERMINAL_SCROLLBACK_REPLAY_BYTE_LIMIT(512 KB). On a constrained link that is a large repeated cost on top of the above. - [Bug]: Desktop subscribe to a remote-runtime terminal delivers zero scrollback rows (mobile gets 1000) #20158 — desktop vs mobile scrollback delivery difference.
How can we reproduce it
- Pair a desktop client to a runtime across a link limited to roughly 1 Mbps in the host-to-client direction.
- Keep ~15–20 terminals open on the host, agents mostly idle.
- Observe continuous 60–190 KB/s host-to-client traffic while actual terminal output is ~2 KB/s, and
Send-Qpinned at the socket buffer limit. - Compare against a second client on the LAN: same protocol, same host, no perceptible latency.
Activity
AmethystLiang commentedon Sep 22, 2026
very valid... working on some improvements
feat(runtime): negotiate permessage-deflate for encrypted text frames (…
fix(runtime): send only the latest session.tabs state while a link is…
fix(runtime): pace session.tabs on end-to-end delivery receipts (stab…
perf(remote): send one changed tab instead of the whole worktree on s…