Repository navigation
Conversation
`tab list` returns every open tab, which is noisy when attached to a daily browser with dozens of tabs. `--filter <text>` keeps tabs whose title or URL contains the text (ASCII case-insensitive) and `--limit <n>` caps the result after filtering, in tab order. Both also work after a bare `tab` and accept the attached `--opt=value` form. Unknown options and stray arguments are now rejected instead of silently ignored. The active flag is computed from each tab's real position, so it stays correct when earlier tabs are filtered out. `tab list` also refreshes titles and URLs from Target.getTargets (2s best-effort timeout) because Chrome does not reliably emit Target.targetInfoChanged when a background tab sets its title, which left background tabs listed with their loading-time title. Refs vercel-labs#2095 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tool forwards both as attached CLI options, so a filter such as "--json" stays literal text. Empty filters and non-positive limits are rejected as invalid params. The sandbox tool catalog is regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Serves pages whose titles are set by script and never appear in their URLs, so the title match is exercised on background tabs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
@RebelCorp-Official is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Rutvij97
force-pushed
the
feat/tab-list-filter-limit
branch
from
November 10, 2026 07:46
a3f421b to
c5d2688
Compare
This branch has not been deployed
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.
Fixes #2095.
tab listreturns every open tab. When agent-browser is attached to a daily browser over--cdpor--auto-connect, that can be dozens of rows, and an agent pays for all of them in tokens when it only wants one or two. This adds two optional, composable controls from the issue's first suggestion.What changes
tab list --filter <text>keeps tabs whose title or URL contains<text>, ignoring ASCII case (the same foldingread --filteruses). It is a literal substring, not a glob or regex.--filter=<text>also works, and is how you filter on text that starts with--.tab list --limit <n>returns at mostntabs in tab order, applied after the filter.nmust be 1 or more.tabortab list, combine in any order, and leave the JSON shape unchanged. A filter that matches nothing returns[]; text output printsNo matching tabs.agent_browser_tab_listaccepts optionalfilter(string) andlimit(integer, minimum 1). The handler goes through the normal CLI parser using the attached--filter=/--limit=form, so a filter value that looks like a flag is passed through as text.packages/@agent-browser/sandbox/mcp-tools.jsonwas regenerated withpnpm mcp-tools:sync.--helpinoutput.rs,docs/content/docs/commands.mdx(with the matchingdocs-edits.jsonfixture entry), andskill-data/core/references/commands.md.Stale titles in background tabs
While writing the e2e test I found that background tabs kept the title they had while loading (usually the URL), so a title filter missed them. Chrome does not reliably send
Target.targetInfoChangedwhen a background tab setsdocument.title, butTarget.getTargetsreturns the current titles.tab listnow calls a newBrowserManager::refresh_page_target_infos, which runsTarget.getTargetswith a 2 second timeout and updates the tracked pages only. If the call fails or times out, the cached values are used as before. This also fixes stale titles in plaintab listoutput.Behavior change to review
tab listpreviously ignored arguments it did not recognize. It now rejects unknown options and extra positional arguments with an error, the same wayreaddoes.tab,tab list,tab new,tab close,tab <n>andtab <id>route exactly as before (covered by parser tests).Tests
cargo test --locked: 2136 passed, 0 failed, 213 ignored. New unit tests cover the parser (both forms, order,=values, flag-like text, missing values, empty filter, limit 0 / negative / fractional / non-numeric / overflow, unknown flags, extra positionals, routing of the othertabsubcommands), filtering inbrowser.rs(URL and title match, case, filter before limit, no match, rows keep every field andactive), the target refresh (updates tracked pages only, keeps the cache when the browser does not answer), and the MCP tool (schema, argument mapping, invalidlimitvalues rejected).cargo fmt --checkandcargo clippy -- -D warnings: clean.cargo test e2e_tab -- --ignored --test-threads=1): all 13 tab tests pass, including the newe2e_tab_list_filter_and_limit. Other e2e tests that calltab list(pin, wedge diagnostics, externally opened tab, a11y) also pass. The recording e2e tests need ffmpeg, which was not installed on my machine; they fail identically on unmodifiedmain.pnpm --filter docs test(54/54),type-check,buildandtest:routes(439/439) pass. Package tests: launcher 4/4, sandbox 27/27, eve 37/37.=form, limit, empty result,--limit 0error, extra argument rejected, missing value, help text, and an MCP stdio call withfilterandlimit(limit: 0returns -32602).Notes
tab list --profiles#2089 (--profiles) touches nearby tab and help code but is a separate feature; whichever lands second should rebase cleanly.🤖 Generated with Claude Code