Skip to content

1.34: browser_get_new_tab returns the tab your click opened (#89) - #94

Draft
GLouv wants to merge 5 commits into
feat/1.32-partitionerfrom
fix/1.34-get-new-tab
Draft

GLouv wants to merge 5 commits into
feat/1.32-partitionerfrom
fix/1.34-get-new-tab

Conversation

@GLouv

@GLouv GLouv commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Fixes #89. Stacked on #77 (1.33.0); retarget to main once #77 is merged.

Before. browser_get_new_tab answered with the most recent tab anywhere in Chrome, with no link to the agent's input. When a page opened its tab a moment after the click, the agent got an older tab whose fields looked like success, or "Tab no longer exists" if that older tab had closed - and a user's tab produced a not-ours answer naming that tab.

Now.

  • New tabs are kept per session, tagged with the session's input number (click, click_xy, double_click, press_key, execute_script, select_option).
  • Only a tab that one of the session's own tabs opened since its last input counts. Without one, the call waits up to wait_ms (default 3000, max 10000) and answers no-new-tab-yet, with earlier_new_tabs from the session; tab_id takes one of those.
  • New tabs belong to the session object, not the port, so a chat on a reused port never inherits another chat's tabs, and an adopted session keeps its own popups (R184).
  • Only tabs opened from the session's tabs count; a Ctrl/Cmd+T tab (chrome://newtab) never does. An address the user types into the agent tab's address bar and opens with Alt+Enter still counts as the agent's, as Chrome makes the agent tab its opener (R185; to be measured in real Chrome).

Reviews. R184 (three holes found and fixed: port reuse, adoption, Ctrl/Cmd+T) and R185 (texts narrowed), both approved with corrections, all applied.

Tests. test/ny-fane-efter-input.test.mjs: 8 tests, all red on #77's head. ny-fane-kaploeb and ejerskab now expect no-new-tab-yet and keep their never-adopt checks. 7 of 7 meaningful mutants killed. Docs gate green (41 tools); the server starts and lists the new fields.

Thanks to the reporter of #89 for the report and the direction of the fix.

🤖 Generated with Claude Code

Gustav Louv and others added 3 commits October 29, 2026 21:51
…no-new-tab-yet (#89)

It looked up the most recent tab anywhere in Chrome. A page that opened its tab a moment after the click gave the agent an
older tab with success-looking fields, or "Tab no longer exists". Now new tabs are kept per session with the session's input
number; only a tab one of the session's own tabs opened since its last click, key press, script or list choice counts. Without
one, the call waits up to wait_ms (default 3 s, max 10 s) and answers no-new-tab-yet with earlier_new_tabs; tab_id takes one.
The user's tabs and other sessions' tabs are never answers, so no not-ours answer names someone else's tab (point 3 of #89).

Tests: test/ny-fane-efter-input.test.mjs (8, red before), ny-fane-kaploeb and ejerskab updated to the new answer with the
never-adopt checks kept. Mutants: 7 of 7 meaningful ones killed. Docs: tools.js, README (both), docs tools page, instructions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…md+T tabs never count, texts made true

Opus R184 (GODKENDT MED RETTELSER) measured three holes in e36a65d: a new chat on a reused port inherited the previous chat's
unclaimed tabs, an adopted session lost its own popup, and the user's Ctrl/Cmd+T tab on the agent's active tab became "your new
tab" (Chrome makes the active tab its opener). Fixed as proposed: nyeFaner keyed on the session object with the input count on
the session, chrome://newtab never recorded, select_frame and set_combobox count as input. Also: tab_id on a closed tab answers
tab-closed; the write-only openerForFane/ejerForFane maps and the race test's dead scaffold are gone.

Tests: R184's four counterexamples and two gap tests added (red on e36a65d), one for tab-closed; 1515/1515 in the extension
harness and the text/docs guards. Mutants for all four fixes killed. Not measured in real Chrome: the chrome://newtab pendingUrl
(read in Chromium's tab_strip_model.cc).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… to count

Opus R185 (GODKENDT MED RETTELSER): an address the user types into the agent tab's address bar and opens with Alt+Enter also
gets the agent tab as opener (Chromium tab_strip_model.cc), so README's "the user's own new tabs are never returned" said more
than the code holds. README, CHANGELOG and the docs page now say "with Ctrl/Cmd+T"; tools.js names the Alt+Enter case as the
agent's; the not-a-new-tab note says the tab must still be open. 1515/1515, docs gate green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nto 1.34

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GLouv pushed a commit that referenced this pull request Oct 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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