feat: add --tabname flag for per-tab isolation within a single daemon#1235
Open
halmisen wants to merge 3 commits intovercel-labs:mainfrom
Open
feat: add --tabname flag for per-tab isolation within a single daemon#1235halmisen wants to merge 3 commits intovercel-labs:mainfrom
halmisen wants to merge 3 commits intovercel-labs:mainfrom
Conversation
added 3 commits
April 13, 2026 10:22
Adds a new --tabname <name> global flag that routes any command to a named, persistent browser tab. Each named tab keeps its own element ref map, active frame context, and cross-origin iframe sessions, so multiple tabs can be driven independently through the same daemon without state bleeding between them. How it works: - --tabname creates the tab on first use; subsequent calls reuse it. - If the backing page was closed externally the tab is re-created transparently. - The daemon's shared ref_map / active_frame_id / iframe_sessions are swapped in/out around every command, so all existing action handlers work unchanged. - A new `tab_name_list` action returns all registered named tabs with URL, title, and liveness. - AGENT_BROWSER_TAB_NAME env var is an alternative to the flag. Examples: agent-browser --tabname reddit open reddit.com agent-browser --tabname hn open news.ycombinator.com agent-browser --tabname reddit snapshot # isolated from hn tab agent-browser tab_name_list This feature was originally built as a TypeScript implementation in the BUNotesAI/agent-browser-session fork and is re-implemented here natively for the Rust daemon.
Contributor
|
Someone is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--tabname <name>global flag that routes any command to a named, persistent browser tab within the same daemon instancetab_name_listaction returns all registered named tabs with URL, title, and livenessMotivation
The current
--session/--session-namemechanism provides isolation at the daemon/process level (separate Chrome instances).--tabnameprovides tab-level isolation within a single browser instance, which is useful when:How it works
ref_map/active_frame_id/iframe_sessionsare swapped in/out around every command — all existing action handlers work unchanged (zero risk of regression for non-tabname usage)AGENT_BROWSER_TAB_NAMEenv var is an alternative to the CLI flagChanges
cli/src/flags.rstab_name: Option<String>field +--tabnameparsing + env varcli/src/commands.rstab_nameinto command JSON when flag is setcli/src/native/element.rs#[derive(Clone)]toRefMap(required for per-tab state save/restore)cli/src/native/browser.rsfind_page_index_by_target_id,switch_to_target,active_target_idhelperscli/src/native/actions.rsNamedTabState,named_tabsfield inDaemonState, setup/save helpers,tab_name_listactionTest plan
--tabname foo navigate <url>creates a new named tab and navigates it--tabname fooreuses the existing tab--tabname a snapshotand--tabname b snapshotreturn independent ref mapstab_name_listreturns both tabs with correct URLs--tabnamecontinue to work exactly as beforeBackground
This feature was originally built as a TypeScript implementation in the
BUNotesAI/agent-browser-sessionfork and is re-implemented here natively for the Rust daemon.