Repository navigation
Fix remote terminal focus snapping during agent runs - #5435
Conversation
|
Ready to review this PR? Stage has broken it down into 3 individual chapters for you:
Chapters generated by Stage for commit abd4869 on Jun 16, 2026 5:52am UTC. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 352ce6dbaba6ea903e119c98bd0fb6342b70ef6c and 85938562ec26b777008bfbac3bc7f4f292abac4e. 📒 Files selected for processing (8)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe change addresses two independent concerns. First, 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Co-authored-by: Orca <help@stably.ai>
8593856 to
abd4869
Compare
A newly created remote terminal/browser tab did not get focus: #5435 made the session-tab reconcile keep the CURRENT active tab over the snapshot's active tab (to stop agent-run status echoes from stealing focus), which also blocked genuine create/activate from taking focus. A transient 'is this tab new' signal couldn't fix it because racing/duplicate snapshots re-applied and snapped focus back. Root cause: the snapshot's activeTabId is overloaded — it means both user-intended focus (on create/activate) and server-side active surface (echoed during agent runs). The client can't tell them apart from the snapshot alone. Fix — client-initiated focus intent (the durable version of what mobile already does with pendingActiveSessionTabIdRef): - web-session-focus-intent.ts: a small per-worktree store of the host tab id the client expects to focus, persisting until a snapshot matches it. - createWebRuntimeSessionTerminal / createWebRuntimeSessionBrowserTab record the intent when they create with activate. - applyWebSessionTabsSnapshot honors the snapshot's active tab over sticky-current ONLY when it matches a pending intent (then consumes it); otherwise keeps current focus, so unsolicited server-active (agent echoes) still never steals focus — #5435 preserved. Tests: new 'focuses a brand-new remote terminal' test (intent set) passes; both #5435 'does not let repeated snapshots steal focus' tests (no intent) stay green. Verified live via the electron skill against a headless serve: creating a terminal (or a second/back-to-back terminal, or a browser tab) on a remote worktree focuses the new tab immediately AND it stays focused after snapshots settle (no snap-back); opening a new terminal still focuses the terminal. Co-authored-by: Orca <help@stably.ai>
|
thanks for reporting. looking into it |
Co-authored-by: Orca <help@stably.ai>
…0828) `orca agent launch --focus` and `worktree create --agent --activate` left a chat launch unselected: main marked the chat active only in its tab listing, which the window follows solely on its own focus intent (#5435). Send the existing focusEditorTab for that chat; when its tab is not listed yet, record the focus intent so the listing selects it unless the user moved on. Co-authored-by: Manuel Meurer <manuel@meurer.io>
Summary
Fixes #5418
Testing
Note: typecheck passed with the existing local Node engine warning because this shell is on Node v26 while the repo requests Node 24.
Made with Orca 🐋