Skip to content

feat: support simultaneous browser profiles with pinned sessions - #72

Open
R44VC0RP wants to merge 3 commits into
mainfrom
feat/simultaneous-browser-profiles
Open

R44VC0RP wants to merge 3 commits into
mainfrom
feat/simultaneous-browser-profiles

Conversation

@R44VC0RP

@R44VC0RP R44VC0RP commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Allow multiple Chromium browser profiles to stay connected to one Browser Control relay simultaneously, with explicit profile selection and persistent session pinning.

  • Give each extension installation a persistent local profile ID and optional user-assigned label; no identity/email permission.
  • Isolate extension RPC, target registries, CDP routing, handoffs, recording, and reconnect generations per profile.
  • Add profile list, profile name, CLI --profile / BROWSER_CONTROL_PROFILE, and MCP profileId selection.
  • Reject ambiguous requests and attempts to route an existing session to another profile.
  • Persist profile ownership and migrate old sessions only using exact target evidence or explicit targetless selection.

Upstream integration

Merged current upstream main (e0f6176, 0.6.0) without rewriting history. The integration preserves the lifecycle, root-health, and reconciliation safeguards from #69 and #70 and the exactly pinned Effect dependency cohort from #71.

One shared RelayShutdown coordinates every profile's session drain, native work, raw-CDP/recording blockers, root reconciliation, and final catalog persistence. Each profile retains upstream RootTargetLifecycle, CdpRuntime, and private CDP pool transitions. Cancellation resumes admission across profiles.

The branch deliberately excludes unrelated local recording changes, investigation notes, and uncommitted files. Those remain local only.

Verification

  • Integrated branch: pnpm check:locals, pnpm check:unused, and all 749 tests across 55 files passed.
  • pnpm runtime:prepare passed: CLI/extension builds, packaged SDK checks, pnpm consumer dependency validation, CLI validation, and MCP handshake/tool/skill validation.
  • pnpm runtime:check-lifecycle passed against standalone upstream 0.6.0 and integrated candidate artifacts, including explicit restart attribution and exact-target legacy session restoration.
  • Static review found no lost upstream shutdown safeguards; new multi-profile tests cover raw-CDP and recording blockers in either profile plus timeout/cancellation admission recovery.
  • Live Helium verification: two real browser profiles connected simultaneously; parallel executes returned distinct page titles and independent session state.
  • Conflicting session/profile selectors and ambiguous bare executes were rejected before browser code ran.
  • Profile naming survived a relay restart; temporary verification tabs/sessions were removed.
  • Navigated Wikipedia through several article links in the explicitly selected second profile.
  • Repeated live checks on the integrated 0.6.0 runtime: both real Helium profiles executed concurrently with distinct titles/state, and the exact pre-upgrade Wikipedia session resumed at its original article after activation.
  • Chrome Web Store packaging passed after including the required storage permission in its strict reviewed allowlist; all four package tests passed.
  • GitHub CI is green on 986ba95, including all 749 tests, both builds, Chrome Web Store packaging, and standalone runtime validation.
  • The local CLI and reconnected OpenCode MCP server both run 0.6.0; the MCP execute check resumed the preserved Wikipedia session in the selected profile.
  • Full browser smoke suite has not been run.

Known follow-up

Immediately after a relay restart, a named-profile request can return profile-not-found while that profile reconnects, because the generic readiness wait may already be satisfied by another profile. Retrying after profile list shows the connection succeeds. Add profile-specific startup waiting during integration; the current behavior fails closed and does not route commands to the wrong account.

Replace the single-extension relay restriction with isolated per-profile runtimes, persistent installation identities and labels, and explicit CLI/MCP selection. Keep target and RPC IDs, reconnect cleanup, recording, and session ownership isolated so accounts cannot be silently switched. Migrate legacy sessions only using exact target evidence or explicit targetless selection; preserve all profile catalogs on shutdown.

Verified typecheck, CLI/extension builds, all existing suite cases with failed/affected groups rerun after fixes, and added collision, migration, disconnect, and persistence cases. Live Helium checks ran parallel executes in the original and Rebase Accounts profiles with separate page titles/state, rejected ambiguous and conflicting selectors, and recovered the Rebase label after relay restart. Full browser smoke suite not run. Record transient profile-specific reconnect waiting as a follow-up. Preserve pre-existing documentation edits and untracked todos.
Preserve upstream RelayShutdown admission/draining/cancellation, RootTargetLifecycle reconciliation, CdpRuntime identity guards, and exactly pinned Effect cohort. Aggregate safe restart across all profiles while retaining isolated RPC/targets and durable session migration. Replace the old single-runtime shutdown integration rather than weakening newer root-health or raw-client protections. Make existing smoke/lifecycle drivers select the intended profile and explicitly restore legacy sessions.

Verified strict unused-locals typecheck, Knip, 749 tests across 55 files, standalone runtime preparation (CLI/extension builds, packaged SDK, CLI and MCP validation), and the installed-artifact lifecycle mechanism check against an upstream 0.6.0 baseline. Static review found no lost upstream shutdown safeguards. Live updated-browser verification follows local deployment.
Include the existing Manifest V3 storage permission in the strict Chrome Web Store packaging allowlist. Multi-profile installation IDs and labels require chrome.storage.local; keep all other permission and host-permission checks unchanged.

Reproduced GitHub CI's manifest-allowlist rejection locally, then verified pnpm package:extension succeeds and all four extension package tests pass.
@R44VC0RP
R44VC0RP marked this pull request as ready for review September 5, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant