feat(cli): add tab profile controls and automation primitives#1396
Merged
Jinwoo-H merged 7 commits intostablyai:mainfrom May 5, 2026
Merged
feat(cli): add tab profile controls and automation primitives#1396Jinwoo-H merged 7 commits intostablyai:mainfrom
Jinwoo-H merged 7 commits intostablyai:mainfrom
Conversation
d6a5630 to
2b7ce36
Compare
Contributor
|
Nice! Rebased onto main (one tiny conflict in couple of real fixes:
|
4d9803c to
e690b85
Compare
- Wait for tab re-registration after browser.tabSetProfile so a follow-up tab list --show-profile reads the new sessionProfileId from BrowserManager instead of the stale one from the previous webview - Wait for tab registration after browser.tabProfileClone, matching browser.tabCreate, so the cloned browserPageId is operable when the CLI returns - Short-circuit browser.tabSetProfile when the tab is already on the requested profile so we do not tear down and remount the webview for a no-op switch - Switch TabShow.worktree from OptionalPlainString to OptionalString to match every other tab schema; empty --worktree should fall back to the active worktree, not pass through as the empty string - Add max-lines disable to browser.test.ts (file grew past 300 lines after adding the new tab-profile and tab-show tests)
CI failure: useIpcEvents.test.ts threw at module load with TypeError: window.addEventListener is not a function. The chain: the rebased useIpcEvents.ts imports destroyPersistentWebview from webview-registry, which calls window.addEventListener at module load. The test stubs window via vi.stubGlobal as a plain object without addEventListener, so the typeof window check passes but the call throws. - webview-registry.ts: tighten the module-load guard to also check that window.addEventListener is callable, so importing this module from a non-DOM-ish test env (vitest node env with stubbed window) does not throw at module load - useIpcEvents.test.ts: add the new onRequestTabSetProfile and replyTabSetProfile stubs to all 8 window.api.ui mocks so the new IPC subscription registered by useIpcEvents resolves
The rebase brought commit 3242aa2 (refactor: narrow tab profile automation scope) onto a main that already had the lifecycle CRUD from 1397. The refactor commit removes BrowserProfileList/Create/Delete types, runtime methods, RPC registrations and schemas, plus the help/specs entries, because those were the precursor versions in commit 1 of this branch. Post-rebase those removals land on the hardened versions inherited from main, breaking 1397. Restore: - runtime-types.ts: BrowserSessionProfile import; ProfileList/Create/Delete result types - orca-runtime.ts: ProfileList/Create/Delete result type imports; browserProfileList/Create/Delete methods - browser-core.ts: ProfileCreate, ProfileDelete schema imports; browser.profileList/profileCreate/profileDelete RPC registrations - browser-schemas.ts: ProfileCreate, ProfileDelete zod schemas - help.ts: list/create/delete subcommand lines under Browser Automation - specs/browser-basic.ts: list/create/delete spec entries
e690b85 to
d9e5cc8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tab/tab profileWhat changed
orca tab create --profile <id>orca tab list --show-profileorca tab profile set --page <id> --profile <id>orca tab show --page <id>orca tab current [--worktree <selector|all>]orca tab profile show --page <id>orca tab profile use-default --page <id>orca tab profile clone --profile <id> [--page <id>] [--worktree <selector>]sessionProfileIdthrough guest registration so tab profile state is visible to CLI automationWhy
Orca already has browser session profile support in the UI and runtime state, but the CLI could not reliably control or inspect that state.
This PR focuses on the tab-scoped controls that automation needs:
It intentionally does not add profile lifecycle commands or any round-robin policy layer.
Tests
./node_modules/.bin/vitest run src/cli/browser.test.ts src/cli/index.test.ts src/main/browser/browser-manager.test.ts src/main/browser/agent-browser-bridge.test.ts./node_modules/.bin/tsc --noEmit -p config/tsconfig.cli.json --composite false./node_modules/.bin/tsc --noEmit -p config/tsconfig.node.json --composite false