Skip to content

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

Closed
amitrockach-legion wants to merge 1 commit into
pingdotgg:mainfrom
amitrockach-legion:amit/preview-browser-profile
Closed

amitrockach-legion wants to merge 1 commit into
pingdotgg:mainfrom
amitrockach-legion:amit/preview-browser-profile

Conversation

@amitrockach-legion

@amitrockach-legion amitrockach-legion commented Sep 4, 2026 •

Copy link
Copy Markdown

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 for commit d33b6ee. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-04T15:30:19.239924Z d33b6ee PR 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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 4, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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.

sheehanmunim added a commit to munimtechnologies/mtcode that referenced this pull request Sep 17, 2026
…ic browser profile

preview_open accepts an optional profileId that opens a new tab in an
existing browser profile; preview_status reports the tab's profileId.
Hosts advertise supportsOpenProfile so the broker never routes a
profile-scoped open to an older desktop.

Fork adaptation: an open without profileId still resolves the user's
configured default profile via browserDefaultOpenProfileId, and the new
error class follows the fork's Schema.TaggedError convention.

(cherry picked from commit d33b6ee)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants