Tabs
Manage multi-tab workflows safely (open, switch, list, close) without dropping to backend-specific APIs.
This page covers:
- What tab management enables (search results, auth flows, downloads)
- Runtime tab methods
- A canonical multi-tab pattern
Tab control keeps multi-page workflows deterministic.
Instead of letting the browser open new tabs implicitly, manage them explicitly so each step has a known active page.
Table of Contents
Runtime methods
Tab APIs are currently available in Python AgentRuntime.
| Method | Purpose |
|---|---|
list_tabs() | List open tabs and their ids. |
open_tab(url) | Open a new tab to a URL. |
switch_tab(tab_id) | Switch active tab by id. |
close_tab(tab_id) | Close a tab by id. |
Example: open → switch → verify → close
tabs = await runtime.list_tabs()
opened = await runtime.open_tab("https://example.com")
await runtime.switch_tab(opened.tab.tab_id)
await runtime.snapshot(limit=60)
runtime.assert_(url_contains("example.com"), "on_target", required=True)
await runtime.close_tab(opened.tab.tab_id)Related topics
- Agent Runtime — verification loop
- Action API — click/type/press primitives