Repository navigation
fix(browser): show profiles changed outside the window in the profile menu without a reload - #32723
Conversation
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ad212a8f-eb4a-4ea1-96eb-dcb5eabafb2d
📒 Files selected for processing: 32
src/main/browser/browser-session-registry.test.tssrc/main/browser/browser-session-registry.tssrc/main/runtime/runtime-notifier-contract.tssrc/main/runtime/workspaces/workspace-host-notifications.tssrc/main/startup/main-process-quit-pending-writer.test.tssrc/main/startup/main-process-quit-update-veto.test.tssrc/main/startup/main-process-runtime-service.tssrc/main/window/runtime-window-lifecycle.tssrc/preload/api/browser-api.tssrc/preload/api/browser-bridge-page-interaction-and-sessions.tssrc/renderer/src/components/browser-pane/host-guest/use-browser-page-webview-partition.test.tssrc/renderer/src/components/browser-pane/host-guest/use-browser-page-webview-partition.tssrc/renderer/src/hooks/ipc-events-agent-status-window-test-fixtures.tssrc/renderer/src/hooks/ipc-events-close-routing-test-harness.tssrc/renderer/src/hooks/ipc-events-terminal-create-window-test-fixtures.tssrc/renderer/src/hooks/ipc-events/browser-state-capture-paint-hold.test.tssrc/renderer/src/hooks/ipc-events/browser-state-ipc-bridge.tssrc/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge-ownership.test.tssrc/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge.tssrc/renderer/src/hooks/useIpcEvents-browser-tab-create.test.tssrc/renderer/src/hooks/useIpcEvents-cli-worktree-activation.test.tssrc/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.tssrc/renderer/src/hooks/useIpcEvents-ssh-disconnect-cleanup.test.tssrc/renderer/src/hooks/useIpcEvents-updater-status.test.tssrc/renderer/src/runtime/runtime-client-events.tssrc/renderer/src/store/slices/browser-session-profiles.test.tssrc/renderer/src/store/slices/browser/browser-host-state.tssrc/renderer/src/store/slices/browser/browser-managed-profile-actions.tssrc/renderer/src/store/slices/browser/browser-profile-list-actions.tssrc/renderer/src/web/preload-api/web-browser-api.tssrc/shared/browser-profile-scope.tssrc/shared/runtime-client-events.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
4bde6af to
98e5ab1
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Use the unadmitted partition until local profiles… · use-browser-page-webview-partition.ts:28-31
src/renderer/src/components/browser-pane/host-guest/use-browser-page-webview-partition.ts:28-31
🔒 Security & Privacy | 🟠 Major | ⚡ Quick winUse the unadmitted partition until local profiles are loaded.
When a named tab has no stored partition, the initial
browserSessionProfilesByHostIdentry is undefined. Because the guard also requireslocalProfiles, it skipsunadmittedBrowserPartition(sessionProfileId)during asynchronous hydration. The resolver then selectsORCA_BROWSER_PARTITIONor another fallback partition, so the tab can read or write cookies in the fallback jar instead of its isolated profile partition.Suggested fix
- if (sessionProfileId && !sessionProfile && localProfiles) { + if (sessionProfileId && !sessionProfile) { return unadmittedBrowserPartition(sessionProfileId) }
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
94b3ad4f-cf49-4028-baec-ca0150bfc843
📒 Files selected for processing: 3
src/main/browser/browser-session-registry.tssrc/main/startup/main-process-quit-pending-writer.test.tssrc/main/startup/main-process-quit-update-veto.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
The registry now announces every profile change, so a profile made by `orca tab profile create` shows in open windows and paired clients. Fixes #29081
A refreshed profile list no longer moves such a tab onto Default's cookies.
New tabs would otherwise open on a profile deleted outside this window.
98e5ab1 to
a37243c
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Forward sidecar profile changes to paired clients. · workspace-host-notifications.ts:193-196
src/main/runtime/workspaces/workspace-host-notifications.ts:193-196
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winForward sidecar profile changes to paired clients.
startOrcadBrowserProvider()installs the sidecar command factory for runtime browser RPCs. Profile create, delete, and import therefore run in the sidecar registry.browserProfilesChangedis emitted only from the main-processbrowserSessionRegistry.onProfilesChangedcallback. The unary sidecar transport has no event subscription or forwarding path.As a result,
runtime-client-ipc-bridge.tsdoes not callfetchBrowserSessionProfiles()for paired clients after a sidecar mutation. Their cached profile lists can remain stale until a reload or explicit refetch. Emit the same client event after successful sidecar-originated profile mutations, including import, at the main runtime boundary.

Minor · Isolate unresolved named profiles before the local… · use-browser-page-webview-partition.ts:31-39
src/renderer/src/components/browser-pane/host-guest/use-browser-page-webview-partition.ts:31-39
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick winIsolate unresolved named profiles before the local list loads.
A reachable profile tab can have
sessionProfileIdset andsessionPartitionunset before the local profile list is written. In that state,localProfilesis undefined, so this guard is skipped. The fallback can return the sharedORCA_BROWSER_PARTITION, andensureBrowserPageWebviewassigns it to the Electron<webview>partition. The tab can therefore load with Default’s cookies instead of an isolated partition.Remove the
localProfilescondition. Resolved profiles and tabs with an explicit partition keep their existing behavior.Suggested fix
- if (sessionProfileId && !sessionProfile && localProfiles) { + if (sessionProfileId && !sessionProfile) {

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ee4769f4-2c83-4566-ac76-9292f81a79f2
Files selected for processing: 1-
src/renderer/src/hooks/ipc-events/browser-state-ipc-bridge.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-
Summary
A browser profile made with
orca tab profile createdidn't show up in an open window's profile menu until something reloaded the list (a restart, opening Settings). The same went for profiles deleted from the CLI, re-sourced by a CLI cookie import, or created and removed by per-repo and per-workspace profiles. Paired clients missed them too.Root cause. Main's session registry owns the profile list, but it never said when the list changed. The renderer loaded the list only at startup, from the Settings panes, and after its own actions.
Fix.
BrowserSessionRegistrynow firesonProfilesChangedafter every create, delete and source change. The runtime forwards it the same way it forwards repo and automation changes: the window notifier sendsbrowser:session:profilesChangedto the local renderer, and abrowserProfilesChangedclient event goes to paired clients. Each side refetches only that host's list. The new event type needs no negotiation, because older clients drop unknown event types and older servers just never send it.Known gaps (not changed here):
Linked Issue
Fixes #29081
Linear: STA-10664
Testing
browser-session-registry.test.ts: the registry announces create, managed create, source change and delete after the list reflects each one, and stays quiet on refused calls. Fails without the fix.runtime-client-ipc-bridge-ownership.test.ts: a host'sbrowserProfilesChangedframe goes through the real stream decoding and lands that host's new list in the store, leaving the local list alone. Fails if the event type is missing from the client allowlist.use-browser-page-webview-partition.test.ts: a tab whose profile disappears from the loaded list no longer resolves to Default's partition. Fails on main withpersist:default.browser-session-profiles.test.ts: a full listing drops a stale default pick, and a failed server fetch keeps it. Each fails without its fix.check:code-quality:changed,check:react-doctor:changedand the focus-read, max-lines and runtime-electron ratchets.orca tab profile createagainst each.Visual Proof
Before (main): after the CLI call, main lists "Made by CLI" but the open window's menu still shows only Default.
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
After (this branch): the menu lists "Made by CLI" right after the CLI call, with no reload.
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)