Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(preview): let agents open tabs in a specific browser profile #9704

Closedamitrockach-legion(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/9704/headopened View on GitHub

What 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 profileId on preview_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.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d33b6eecc6c0a7946f000f94742d57b4f59de532. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add profileId support to PreviewAutomationOpenInput for opening tabs in specific browser profiles

  • Adds optional profileId field to the PreviewAutomationOpenInput contract, validated against known browser profile IDs, and rejects combining it with tabId or reuseExistingTab=true
  • Extends PreviewAutomationHost registration 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 PreviewAutomationProfileNotFoundError for unknown profiles
  • normalizePreviewOpenInput now defaults reuseExistingTab to false when profileId is present, creating a new tab instead of reusing
  • PreviewAutomationStatus includes the tab's profileId, 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
Macroscope summarized d33b6ee.
    1. chatgpt-codex-connector[bot](GitHub profile, opens in a new tab)commented

      Codex Review Summary

      This comment shows the latest Codex review activity on this pull request.

      ReviewStatusCommitReview trigger
      📝 Code Review✅ Completed 2026-09-04T15:30:19.239924Zd33b6eePR opened
      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review" or "@codex security review".

      Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. 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).
    4. 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.

    5. juliusmarminge closed this

Sign in to join this conversation.