feat(preview): let agents open tabs in a specific browser profile #9704
main fromrefs/pull/9704/head·opened View on GitHubWhat changed#
When agents check different app versions in parallel, they need separate browser logins. The preview UI already supports browser profiles, but preview_open cannot select one. This exposes an optional profileId so an agent can open a new tab in an existing profile without reusing another task's login.
Changes:
- Accept
profileIdonpreview_open, always creating a new tab and rejecting conflicting tab-reuse options or unknown profiles. - Include the active profile ID in preview status so agents can identify and reuse a profile deliberately.
- Route explicit profile requests only to desktops that support them, avoiding silent fallback to another cookie jar.
Why#
Changing a global default is awkward for concurrent tasks. Per-call selection uses the existing profile and tab-creation machinery, while calls without profileId retain their current behavior. This does not add profile creation or management, and opening a new tab does not clear that profile's cookies.
Related: #9402 makes agent-opened tabs honor the configured default profile. This PR adds explicit per-call selection; it does not depend on that PR.
Checklist#
- This PR is small and focused
- I explained what changed and why
- Before/after screenshots: not applicable; no UI changes
- Animation/interaction video: not applicable; no visual interaction or timing changes
Implemented with GPT-6 through the Codex harness in T3 Code.
Note
Medium Risk Changes how preview tabs are created and which desktop host handles opens, directly affecting cookie/login isolation; mitigations include explicit capability negotiation and rejecting unknown profiles instead of falling back.
Overview
Agents can pass optional profileId on preview_open to spin up a new tab in an existing desktop browser profile (default, incognito, or custom IDs), so parallel tasks can keep separate logins without changing global defaults.
Contracts and MCP behavior: PreviewAutomationOpenInput gains profileId with schema rules that forbid combining it with tabId or reuseExistingTab: true; default tab reuse is off when a profile is set. preview_status can return profileId. Desktop hosts advertise supportsOpenProfile; the automation broker only routes profile opens to capable hosts and returns no host rather than sending profile selection to legacy desktops.
Desktop: Opens honor the requested profile via previewAutomationOpenOptions (unknown profiles fail with PreviewAutomationProfileNotFoundError). Current Electron hosts register supportsOpenProfile: true. User docs describe the agent workflow for separate task logins.
Note
Add profileId support to PreviewAutomationOpenInput for opening tabs in specific browser profiles#
- Adds optional
profileIdfield to thePreviewAutomationOpenInputcontract, validated against known browser profile IDs, and rejects combining it withtabIdorreuseExistingTab=true - Extends
PreviewAutomationHostregistration with a boolean capability flag; the broker routes profile open requests only to hosts that advertise profile support - The desktop host advertises profile selection, validates requested profiles against local browser defaults, and throws
PreviewAutomationProfileNotFoundErrorfor unknown profiles normalizePreviewOpenInputnow defaultsreuseExistingTabtofalsewhenprofileIdis present, creating a new tab instead of reusingPreviewAutomationStatusincludes the tab'sprofileId, defaulting to the default profile when the snapshot lacks one- Behavioral Change: existing hosts that omit the new capability field are recorded as unable to handle profile opens; broker rejects profile open requests when no capable host is connected
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
Approvability#
Verdict: Not approved
Macroscope's review found this PR not approvable — This PR adds a new agent-facing workflow for creating preview tabs in selected browser profiles, requiring coordinated contract, server-routing, and desktop changes. Because it changes profile-specific tab-creation defaults and controls authenticated cookie isolation, the runtime and compatibility impact merits human review.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Note
This comment is posted by Julius' dot
Closing for missing verification results. The diff adds contract, broker and profile-selection tests, but neither the description nor comments report running them, and the current checks contain no test run. Please report focused commands and outcomes for selecting a profile, rejecting unknown profiles and avoiding unsupported hosts, then request reconsideration.
juliusmarminge closed this
Sign in to join this conversation.
Codex Review Summary#
This comment shows the latest Codex review activity on this pull request.
d33b6eeℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.