Skip to content

fix: track active browser tabs - #502

Open
naliazheli wants to merge 1 commit into
andrewyng:mainfrom
naliazheli:agent/browser-active-tabs
Open

fix: track active browser tabs#502
naliazheli wants to merge 1 commit into
andrewyng:mainfrom
naliazheli:agent/browser-active-tabs

Conversation

@naliazheli

Copy link
Copy Markdown

Summary

  • make newly opened Playwright pages the active target for subsequent browser tools
  • add browser_list_tabs and browser_switch_tab for explicit multi-tab control
  • fall back to the most recent open tab when the active tab closes
  • clarify that snapshot, text, and screenshot tools operate on the active tab

Root cause

The browser controller stored only the first Page created for its context. Popups opened successfully in Chromium, but screenshots, snapshots, clicks, waits, and text reads continued using that original page. The tool schema also had no way for the model to list or select tabs.

User impact

Browser agents now follow popup/new-tab navigation automatically and can explicitly inspect or switch tabs when a workflow spans multiple pages.

Validation

  • 1176 passed, 1 skipped
  • real headless Chrome smoke test: popup becomes active and closing it restores the prior tab
  • git diff --check

@naliazheli
naliazheli marked this pull request as ready for review August 14, 2026 07:59
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