BrowserOS icon indicating copy to clipboard operation
BrowserOS copied to clipboard

`close_page` fails with "Unknown page" error even when using page IDs from `list_pages`

Open Avngrstark62 opened this issue 8 months ago • 5 comments

Issue Type

Both / Not sure

Operating System

Linux, Windows

Description of the bug

When asking the BrowserOS assistant to close tabs, the action consistently fails with the error:

Internal error in close_page: Unknown page

This happens even when the tab IDs are retrieved directly from list_pages. The assistant repeatedly tries to refresh the tab list and retry the action, but close_page continues to fail.

Expected behavior: The assistant should be able to close tabs using the IDs returned by list_pages.

Actual behavior: The browser reports that the page does not exist, even though it was just listed as open.

Steps to Reproduce

  1. Open BrowserOS and open several tabs (e.g., multiple YouTube tabs).
  2. Open Assistant mode.
  3. Ask the assistant to close tabs (e.g., “close all tabs except this one” or “close the first tab”).
  4. The assistant calls list_pages and then attempts close_page.
  5. close_page fails with Internal error in close_page: Unknown page.

Screenshots / Videos

Image Image

BrowserOS Version

146.0.7818.31

Additional Context

This issue occurs consistently on both Ubuntu and Windows. It randomly worked once but started failing again afterward.

Avngrstark62 avatar Mar 14 '26 09:03 Avngrstark62

Happy to investigate this further and submit a fix if that would be helpful.

Avngrstark62 avatar Mar 14 '26 09:03 Avngrstark62

Hey @Avngrstark62 — thanks for the report! Logged this as a bug and added it to our backlog. We'll take a look soon.

shadowfax92 avatar Mar 16 '26 15:03 shadowfax92

The "Unknown page" error from close_page typically indicates a page identifier mismatch — the ID being passed doesn't correspond to what the browser's internal registry expects at the time of the call. A likely root cause is that list_pages and close_page are operating on different ID namespaces (e.g., targetId vs. sessionId in the Chrome DevTools Protocol), so the IDs returned by list_pages are technically valid but not the correct type for the lookup close_page performs. This would also explain why it "randomly worked once" — a transient alignment between the two ID types. Worth checking the implementation of both tools to confirm they're using a consistent page identifier throughout the call chain.

JiwaniZakir avatar Apr 02 '26 21:04 JiwaniZakir

Thanks @Avngrstark62 — close_page failing with "Unknown page" even when using IDs straight from list_pages is a real bug (likely a page-ID/handle mismatch, as @JiwaniZakir notes). Adding to my list and assigning to me. And yes — if you want to investigate and open a fix, that'd be very welcome.

shadowfax92 avatar Jun 15 '26 21:06 shadowfax92

This should be fixed in v0.46.0.

Please upgrade and try it there. Closing this as completed, but if close_page still fails with IDs returned by list_pages on v0.46.0, comment with the updated repro and I’ll look into it again.

shadowfax92 avatar Jun 19 '26 21:06 shadowfax92