Repository navigation
Conversation
📝 WalkthroughWalkthroughThe runtime now classifies Merge Risk: 🔵 Low · up to Browser snapshot, screenshot, and wait requests now remain connected through the long-poll path. The implementation is covered for routing and keepalives, with a low residual risk that a terminal snapshot response regression would not be caught by the new transport test. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the problem, change, rationale, testing, compatibility, and platform limits. However, it does not follow the required template and omits the required Linked Issue, Visual Proof or an explicit N/A statement, Testing checklist, Review, Agent skill upstream boundary, Notes, and Checklist sections. Resolution Restructure the description using the repository template. Add a linked issue after “Fixes #”. Add visual proof or write exactly “N/A” with a reason if no visual or interaction change applies. Add the required Testing, Review, Agent skill upstream boundary, Notes, and Checklist sections, and mark each applicable item.
✨ Finishing Touches📝 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.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 98ae6b27-d9df-48c7-abb3-b733b805ef8d
📒 Files selected for processing (2)
src/main/runtime/runtime-rpc-long-poll-transport.test.tssrc/main/runtime/runtime-rpc/runtime-rpc-long-poll.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| expect( | ||
| session.frames.filter((frame) => frame._keepalive === true).length | ||
| ).toBeGreaterThanOrEqual(2) | ||
| expect(session.frames.filter((frame) => frame.ok !== undefined)).toHaveLength(1) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert the terminal response payload.
The current assertion only checks that one frame has an ok field. It does not verify ok === true, browserPageId, or snapshot. A transport regression that drops or rewrites the result can pass this test.
Suggested assertion
- expect(session.frames.filter((frame) => frame.ok !== undefined)).toHaveLength(1)
+ const terminalFrames = session.frames.filter((frame) => frame._keepalive !== true)
+ expect(terminalFrames).toHaveLength(1)
+ expect(terminalFrames[0]).toMatchObject({
+ ok: true,
+ result: { browserPageId: 'page-1', snapshot: 'tree' }
+ })📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| expect(session.frames.filter((frame) => frame.ok !== undefined)).toHaveLength(1) | |
| const terminalFrames = session.frames.filter((frame) => frame._keepalive !== true) | |
| expect(terminalFrames).toHaveLength(1) | |
| expect(terminalFrames[0]).toMatchObject({ | |
| ok: true, | |
| result: { browserPageId: 'page-1', snapshot: 'tree' } | |
| }) |
There was a problem hiding this comment.
ℹ️ No critical issues — one scope question inline.
Reviewed changes
browser.snapshot/browser.screenshot/browser.waitclassified aswaitlong-polls —classifyRuntimeLongPollnow returns'wait'for the three browser methods that block on helper startup/paint/condition waits, arming the existing keepalive frames so the 30s socket/named-pipe idle timer no longer tears down a healthy in-flight WSL CLI request.- Regression coverage — a classifier
it.eachoracle pins the three methods to'wait'(andbrowser.eval/browser.click/browser.tabSwitchto the short path), plus a real newline-framed session test that blocks the dispatcher for 120ms and asserts ≥2 keepalives with exactly one terminal frame.
The change is correctly scoped: keepalive arming (context?.startKeepalive()), slot accounting, and the (unused-by-browser-handlers) abort signal are all shared wiring already exercised by terminal.wait and orchestration.check --wait. Slot contention under saturation returns runtime_busy, which the body acknowledges.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| if ( | ||
| request.method === 'browser.snapshot' || | ||
| request.method === 'browser.screenshot' || | ||
| request.method === 'browser.wait' |
There was a problem hiding this comment.
browser.goto and browser.reload share this same exposure: the CLI already grants them a 60s timeout (src/cli/handlers/browser-nav.ts) because navigation waits for network idle past the 15s default, and the embedded bridge's navigation budget alone is 30s (EMBEDDED_NAVIGATION_TIMEOUT_MS) — so a cold goto still risks the 30s idle teardown this PR fixes. Worth confirming whether they should join this set or are deliberately out of scope for the STA-6407 repro.
|
Native-Windows evidence that this PR covers more than WSL (Orca 1.4.215, 2026-09-27, native The bundled helper is still agent-browser 0.27.0 ( orca tab create --url http://localhost:8000/ui/ --json # ok, 0.7s
orca wait --text "<text on page>" --page <id> --json # 30.2s -> runtime_unavailable, _meta.runtimeId: null
orca screenshot --page <id> --json # 30.2s -> runtime_unavailable
Timeline on one fresh tab. It shows the request is healthy but slow, which is what this keepalive change targets:
So on native Windows the 30s named-pipe idle close is what turns a slow-but-successful helper call into Related: #18093 |

Summary
The WSL CLI reaches a Windows Orca host through the local runtime RPC transport (a Windows named pipe).
browser.snapshot,browser.screenshot, andbrowser.waitcan block in agent-browser startup/paint/condition waits, but the runtime long-poll classifier treated them as short RPCs. The 30s socket/named-pipe idle timer could therefore close a healthy request before the browser helper replied; the CLI surfacedruntime_unavailable.eval,click, and tab commands remain on the short path.This patch classifies those three browser methods as the existing
waitlong-poll class. That enables the existing keepalive frames and abort/slot accounting for both Unix sockets and Windows named pipes. No new wire fields, opcodes, retries, polling, or fallback routing are introduced.Deterministic evidence
src/main/runtime/runtime-rpc-long-poll-transport.test.tsbrowser.snapshot,browser.screenshot,browser.wait) and controls (browser.eval,browser.click,browser.tabSwitch). On the base revision those new assertions are red because the methods classify as short RPCs.browser.snapshotfor 120ms, observes >=2 keepalives, and receives exactly one terminal response on the candidate.pnpm test src/main/runtime/runtime-rpc-long-poll-transport.test.ts src/cli/browser.test.ts— 57 passed.pnpm tc:nodepassed.pnpm run check:code-quality:changedpassed with 0 new findings.Compatibility and limits
The keepalive frame is already part of the existing RPC envelope and is understood by current/legacy clients; this changes only host-side classification. The existing long-poll cap still bounds concurrency and returns
runtime_busyunder saturation.This workspace is macOS. Windows 2, WSL2, ConPTY, and the physical Windows named-pipe path were not available, so no physical Windows/WSL reproduction is claimed. The oracle exercises the same classifier and real local framed transport used by that path, but it does not prove WSL interop, PowerShell argv forwarding, or Windows kernel named-pipe behavior. A >30s end-to-end timeout was not run in CI because it would make the regression suite unnecessarily slow; the causal boundary is the host idle timer plus the missing classifier entry.
Linear was not mutated; the session's
orca-ideLinear CLI was unavailable.