Repository navigation
Conversation
The 30s idle timeout destroyed CLI sockets whose request took longer than 30s, so the CLI reported 'Orca is not running' while the work still landed. Pause the idle timer while any request is in flight on the connection and re-arm it when the last one replies.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThis change updates Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to Long-running runtime RPC requests retain their socket until they reply, while idle connections continue to be reaped. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
ℹ️ No blocking issues — one stale-comment cleanup for the follow-up queue.
Reviewed changes
- Pauses the per-connection idle reap during a request.
dispatchMessagenow callssocket.setTimeout(0)while a dispatch is registered ininflight, andcleanupDispatchre-armssocket.setTimeout(this.idleTimeoutMs)once the last in-flight dispatch settles, so a handler that runs past 30 s no longer has its reply written to a destroyed socket. - Adds an injectable
idleTimeoutMsoption. Defaults to the existing 30 s constant; the tests use 100 ms to exercise the reap on a real Unix socket without waiting 30 s. - Expands test coverage.
FakeSocketnow models Node'ssetTimeoutsemantics (0 disables, activity restarts), and there are five fake-timer tests (never-sends reap, slow reply surviving the timeout, re-arm after the last in-flight reply, abort + timer-free on client disconnect) plus two real-socket tests. Ran the file locally: 11/11 pass.
ℹ️ Stale comments still describe the removed 30 s server-side backstop
The change removes the only unconditional 30 s reap on the server side, but three "Why" comments still justify their design against it. They should be refreshed so a future debugger does not chase a safety net that no longer exists.
Technical details
# Stale 30 s idle-backstop references
## Affected sites
- `src/main/runtime/runtime-rpc/runtime-rpc-long-poll-transport.test.ts:797-799` — "Without the `.catch` on handleMessage's promise, a throw would leave the client hanging until the 30s idle timer and leak the dispatch's AbortController in the transport's in-flight set." With the timer paused during dispatch, the client hangs until its own timeout, not 30 s.
- `src/main/runtime/runtime-rpc/runtime-rpc-long-poll.ts:45-49` — "...it needs the same keepalive as check --wait or the 30 s socket idle timer tears it down." Keepalive is still required, but now to refresh the *client* 60 s timer (`src/cli/runtime/transport.ts:98`/`:137`), not the server's.
- `src/main/runtime/runtime-rpc/runtime-rpc-pairing-types.ts:128` — "keepalive frames count as socket activity, resetting both idle timers so long-polls outlive the 30s/60s idle caps." The server idle timer is disabled while a dispatch is in flight, so there is nothing to reset on that side.
## Required outcome
- The comments should state the current mechanism: keepalive still refreshes the client-side ceiling; the server no longer reaps during an in-flight request (nor during a never-settling one).
## Notes
- Sites are outside this PR's diff, so they cannot be anchored inline. Non-blocking.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
When you run an
orcacommand that takes more than 30 seconds (for example, creating a worktree while setup runs), Orca hung up on the command halfway through. The command then said Orca wasn't running, even though Orca kept going and finished the job. Now Orca stays on the line until it has answered.What Changed
Before: Any CLI request that ran longer than 30 seconds, and was not one of the few "wait" commands, failed at exactly 30 seconds with "The Orca runtime closed the connection before responding. Restart Orca and try again.", followed by "Orca is not running". The work kept running in the app and usually finished, which left worktrees nobody asked for and actions that were reported as failed but had actually happened.
After: The request gets its real result, whether it succeeded or failed, however long it takes. The CLI's own timeout (60 seconds by default, or whatever the caller passes) is still what limits a request that never finishes.
Mechanism: The local runtime socket (
src/main/runtime/rpc/unix-socket-transport.ts, used for Unix sockets on macOS/Linux and named pipes on Windows) closed any connection that went quiet for 30 seconds. That rule is meant to clean up clients that connect and then go silent, but it also applied while the server was still working on a request, because nothing is written to the socket during that time. The idle timer now pauses while a request is running on the connection and starts again when the last running request replies. The transport already tracked running requests per connection for its abort handling, so the pause and restart hook into that existing tracking.Unchanged:
Why
The 30-second timer was closing the connection on the server side, so the fix goes there.
check --wait).One side effect: a connection with a request that never finishes is no longer closed after 30 seconds. The CLI times out and disconnects on its own, which frees the connection. Only same-user local clients can reach this socket (it is mode 0600 on Unix).
This also stops the 30-second socket cutoff from racing the daemon client's 30-second request timeout (
src/main/daemon/client.ts). A daemon timeout error now reaches the CLI as a real error instead of a dropped connection.Linked Issue
STA-4989, STA-7258, STA-1346
Fixes #
Visual Proof
N/A. No UI changes. What changes is the CLI's result for requests longer than 30 seconds, and the tests below cover it.
Testing
New tests in
src/main/runtime/rpc/unix-socket-transport.test.ts:Fails before, passes after: on
origin/main, the 35-second and re-arm tests fail, because the socket is destroyed at 30 seconds. With only the timeout made injectable onmain, the real-socket test fails with "closed before responding". With this change, all 11 tests pass.runtime-rpc-long-poll-transport.test.tsand all 18src/main/runtime/runtime-rpc*test files pass (139 tests), andpnpm tc:node, oxlint, oxfmt andcheck:code-quality:changedare clean.Platforms: tested on macOS. The Windows named-pipe path uses the same class and code path, and the fake-socket tests use the named-pipe kind. The real-socket tests skip on Windows.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Security: the socket is local and restricted to the same user. Cross-platform: Unix sockets and named pipes share one implementation. SSH/remote: remote clients use the WebSocket/relay transports, which this change does not touch. Mobile: not affected. Backwards compatibility: no wire change. Performance: one extra
setTimeoutcall per request.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)