Repository navigation
feat(browser): browser.maxTabs — open refuses past a tab limit (default 6) - #172
Merged
Merged
Conversation
…lt 6) Every open (tool, CLI, node proxy) goes through openTab, so the limit lives there: with N page tabs already open, open fails with 409 "tab limit reached (N tabs open, browser.maxTabs=6): navigate an existing tab or close one first". Workers and iframes do not count; 0 lifts the limit; a failed tab list lets the open through. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…they are; sandbox honours maxTabs Internal review of #172 found two gaps: - fetchBrowserJson wrapped every error, a 409 "tab limit reached" or a 404 "tab not found" included, as "Can't reach the browser control service … Do NOT retry". The service answered, so the answer is now thrown as BrowserControlHttpError with the service's own message and status. - the sandbox browser built its resolved config by hand, without maxTabs, so browser.maxTabs=0 still refused at 6 there. One resolver, resolveBrowserMaxTabs, now serves both paths. Co-Authored-By: Claude Fable 5.1 <[email protected]>
cryptolir
added a commit
that referenced
this pull request
Sep 29, 2026
Co-authored-by: Liran Peretz <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
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.
An agent that opens a tab per step piles tabs up until Chrome runs out of memory (social-bob reached 9 tabs and the browser stopped answering on 2026-09-29). The Browser check on the host closes extras a minute later; this makes the pile-up impossible at the source.
browser.maxTabs(int ≥ 0, default 6, 0 = no limit), in the zod schema, labels, andresolveBrowserConfig(resolveBrowserMaxTabs, also used by the sandbox browser).openTabinserver-context.tscounts page targets (not workers/iframes) and throwsBrowserTabLimitError;mapTabErrormaps it to 409 with the messagetab limit reached (6 tabs open, browser.maxTabs=6): navigate an existing tab or close one first. Every open path (agent tool, CLI, node proxy) goes throughopenTab, so one guard covers all of them. If the tab list cannot be read, the open goes ahead.ensureTabAvailable'sopenTab("about:blank")only runs with zero tabs, so it is never blocked.fetchBrowserJsonused to wrap every error, a 409 or a 404 "tab not found" included, as "Can't reach the OpenClaw browser control service … Do NOT retry" — so the model was told the browser was down whenever the service simply said no. Error answers are now thrown asBrowserControlHttpErrorwith the service's own message and status; a real connection failure or timeout still gets the "can't reach, do not retry" wrapper. (This is the likely source of social-bob's "browser service is unreachable, restart the gateway" messages after a tab of his was closed.) And the sandbox browser's hand-built resolved config now carriesmaxTabstoo.docs/tools/browser.md,docs/gateway/configuration-reference.md.Tests:
server-context.max-tabs.test.ts(refuse at the limit without creating a tab, open under it, page-only counting, default and 0, 409 mapping, config resolution) andclient-fetch.http-error.test.ts(a 409 passes through as the service's message; a connection failure still wraps). All ofsrc/browsergreen. Mutations: guard removed, all targets counted, 409 dropped, sign flipped, rethrow dropped — all caught.tsgo: no errors insrc/browser,src/agents/sandbox,src/config(the repo baseline has pre-existing ones inextensions/andui/).Roll-out: pilot on social-bob (DevAgents) with a locally built image; the fleet only moves when the owner promotes a release.
🤖 Generated with Claude Code