Repository navigation
Conversation
Paired desktop clients send presentation:'focused' for agent creates. On windowless orca serve that hit getAuthoritativeWindow() and failed with "No renderer window available". Route focused creates without a BrowserWindow through the existing headless/background spawn path (fixes stablyai#10553).
📝 WalkthroughWalkthroughExpanded runtime fallback handling allows focused presentation requests to proceed through headless spawning when no renderer window or authoritative window exists. Added tests covering focused terminal creation and focused agent-session creation in a headless setup, including background surfaces, generated terminal handles, successful creation, and persistent host-session binding for PTY spawning. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
🧹 Nitpick comments (1)
src/main/runtime/orca-runtime.ts (1)
21625-21628: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten the inline rationale.
This four-line comment is more verbose than the TypeScript guideline permits. Keep only the non-obvious reason, for example:
Proposed revision
- // Why (`#10553`): paired desktop clients send presentation:'focused' for - // agent creates. Without a BrowserWindow (headless `orca serve`), fall - // through to the headless spawn path instead of getAuthoritativeWindow() - // hard-erroring with "No renderer window available". + // Paired clients may request focused presentation on headless hosts.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 94172dbc-7d1c-4a29-842b-baff5c6db184
📒 Files selected for processing (2)
src/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.ts
|
Status ping: focused headless-serve fix so |
|
Thanks for this, and for the diagnosis — it was correct, and it made the fix straightforward to confirm. We reproduced #10333 against a real headless We've opened #12791 with the fix. Two reasons we went with a separate PR rather than merging here, both about test coverage rather than your diagnosis:
One thing worth knowing that neither PR could have anticipated: the Mac UI Genuinely appreciate the work here; the fix in #12791 is the shape you both proposed. Closing these in favour of it, but the credit for finding it is yours. |
|
@Jinwoo-H appreciate the write-up. Fair call on the tests — if they go red on main for I'll close this out for #12791. Thanks for the credit on the diagnosis; that means a lot after the PR sat a while. |
|
Closing — tracked on #12791 instead. |
Summary
Fixes #10553 — agent creates from a paired desktop client against headless
orca serveno longer fail withNo renderer window available.Since
terminal.createAgentSession, clients sendpresentation: 'focused'for user-initiated agent creates. On a windowless serve host, that took the renderer-IPC path and calledgetAuthoritativeWindow(), which throws whenBrowserWindow.fromIdis null.Fix
If
presentation/focusrequires a renderer window but none is available, use the existing headless/backgroundcreateTerminalpath (same as non-focused CLI creates andrendererBackedwithout a window). The PTY still spawns; surface is returned asbackgroundwith the usual optional reveal warning when no notifier can promote a tab.Test plan
orca-runtime.test.ts— focused create without window → background surfaceorca-runtime.test.ts— focusedcreateAgentSessionwithout windoworca servecan create agents without errorELI5
Creating a focused agent from a paired client against headless
orca servefailed with "No renderer window." Focused creates now degrade gracefully to a windowless path so remote agents still start.