Repository navigation
Conversation
Greptile SummaryCmd+J browser-page activation now resolves the unified browser tab through execution-host ownership before changing active host state.
Confidence Score: 5/5The PR appears safe to merge, with the changed activation path preserving host ownership and failing before partial host switching when the backing tab is unavailable. The resolver uses the repository’s existing execution-host alias and ambiguous-worktree ownership rules, validates the target before host activation, and the final scoped tab activation produces the expected visible group and browser state.
|
| Filename | Overview |
|---|---|
| src/renderer/src/lib/browser-page-palette-activation.ts | Adds worktree-qualified record validation and resolves the host-owned unified tab before switching active host state. |
| src/renderer/src/lib/browser-workspace-tab-activation.ts | Introduces execution-host-aware browser-tab resolution and scopes host-qualified tab activation to the target worktree. |
| src/renderer/src/lib/browser-page-palette-activation.test.ts | Covers local-to-remote and remote-to-local activation when paired hosts share worktree and browser workspace identities. |
Sequence Diagram
sequenceDiagram
participant P as Cmd+J palette
participant A as Browser page activation
participant R as Host-aware tab resolver
participant S as Renderer store
P->>A: Activate page target with executionHostId
A->>S: Validate worktree, workspace, and page
A->>R: Resolve host-owned unified browser tab
R->>S: Apply worktree host-alias ownership rules
R-->>A: Matching tab or null
alt Matching tab exists
A->>S: Reveal owning worktree and host
A->>S: Activate browser page and scoped tab
A-->>P: activated
else Missing or stale ownership
A-->>P: failed without switching host
end
Reviews (1): Last reviewed commit: "fix(cmd-j): preserve browser tab host ow..." | Re-trigger Greptile
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughBrowser page palette activation now validates the page and workspace against the requested worktree. It resolves unified browser tabs by execution host and returns Merge Risk: ⚪ Minimal · up to This localized change preserves execution-host ownership during browser-tab activation and prevents incorrect tab or host selection for paired runtimes. No actionable merge-blocking risk remains beyond normal checks. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the change, root cause, linked issue, validation, and scope. However, it omits most required template sections, including ELI5, What Changed, Why, Visual Proof or an explicit N/A reason, Testing checklist details, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. Resolution Rewrite the description using the repository template. Add each required section, provide visual proof or state N/A with a reason, record manual and automated testing details, complete the required checkboxes, and retain the existing root cause and validation information.
✨ 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.
ℹ️ Minor suggestion only — the fix is correct, well-scoped, and its regression test is a real oracle.
Reviewed changes
browser-workspace-tab-activation.ts— new host-awareresolveBrowserWorkspaceUnifiedTabandexecutionHostIdthreading throughactivateBrowserWorkspaceTab, including a load-bearing reorder of the activation sequence.browser-page-palette-activation.ts— page/workspace lookups now also scope byworktreeId; unified-tab ownership is validated before worktree activation, andexecutionHostIdis threaded through.browser-page-palette-activation.test.ts— a host-collision regression test asserting the correct group and host win for local vs paired-runtime activation.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| if (params.pageId) { | ||
| state.setActiveBrowserPage(params.workspaceId, params.pageId) | ||
| } | ||
| state.focusGroup(params.worktreeId, unifiedTab.groupId) |
There was a problem hiding this comment.
This reorder is load-bearing: setActiveBrowserTab internally calls activateTab on the first browser tab matching the workspace id (browser.ts setActiveBrowserTab), unscoped to any host. In a host collision that would focus the wrong group; running the host-scoped activateTab last is what corrects it. A short Why: comment would stop a future cleanup from reordering it back.
| state.focusGroup(params.worktreeId, unifiedTab.groupId) | |
| // Why: setActiveBrowserTab re-activates the first workspace-matching tab unscoped | |
| // (browser.ts setActiveBrowserTab), so this host-scoped activation must run last. | |
| state.focusGroup(params.worktreeId, unifiedTab.groupId) |
|
Run failed. View the logs →
|
|
Superseded by #19005, which shipped host-scoped tab validation before Cmd+J browser activation. Closing. |

Summary
Fixes STA-5290. Cmd+J browser-page activation now preserves the result's execution-host ownership when paired local and remote runtimes share worktree IDs.
The canonical browser activation boundary now:
Root cause
PR #15686 host-qualified palette candidates, but browser activation still resolved unified tabs and browser records by bare IDs. With same-ID local/remote candidates, activation could leave the remote host selected or focus the wrong group.
Validation
pnpm test src/renderer/src/lib/browser-page-palette-activation.test.ts src/renderer/src/lib/browser-palette-page-entries.test.ts src/renderer/src/lib/cmd-j-host-qualified-candidate-ownership.test.tspnpm test src/renderer/src/lib/browser-page-palette-activation.test.ts src/renderer/src/lib/file-preview.test.tspnpm tc:webpnpm run check:code-quality:changedSKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-cmd-j-host-qualified-tabs.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1The deterministic collision oracle fails when the host-aware resolver is disabled and passes with this change, including remote-to-local repeated activation and visible active-tab assertions.
Notes
No Linear status/comment changes were made in this PR creation step.