You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Selected element is not reported if the selected element is not part of the a11y snapshot #586
Selected elements are ommited if they are not relevant for interacting with the page.
Reproduction
Repro:
1.) Open page that has a lot of divs and a few controls
2.) Select one of the divs in DevTools
3.) Reference in your prompt the selected element
4.) take_snapshot does not include the div
Expectation
a selected element should always be added to take_snapshot - no matter what type it is.
Can we filter it down to the non-verbose screenshot afterwards before passing it on to the LLM?
Code architecture would not allow to re-use the exact same code right now. Definitely possible but a larger change. Do you prefer this option? The other option is possible right now (next days).
Another option could be to use verbose by default? In general, for styling debugging we need to rework the snapshots to be a mix of DOM and a11y but that requires some thinking.
I worry that makign verbose will just burn more tokens. The verbose snapshot is big compared to the normal one. Alternatively: How about mentioning in the tool description of take_snapshot that verbose=true should be used if the selected element is not showing up? This way an AI agent (or human) is able to figure out the problem without increasing token cost per operation massively.
How about mentioning in the tool description of take_snapshot that verbose=true should be used if the selected element is not showing up?
This is an option but I am not sure how well LLMs would be able to follow it. As a short-term solution it would be fine. I could add a line to the response output like There is a selected element in the Elements panel call take_snapshot(verbose=true) to see. It would only show up if the snapshot is not already verbose and there is actually an element selected.
How about mentioning in the tool description of take_snapshot that verbose=true should be used if the selected element is not showing up?
This is an option but I am not sure how well LLMs would be able to follow it. As a short-term solution it would be fine. I could add a line to the response output like There is a selected element in the Elements panel call take_snapshot(verbose=true) to see. It would only show up if the snapshot is not already verbose and there is actually an element selected.
Activity
OrKoN commentedon Nov 20, 2025
Have you tried requesting verbose snapshots?
natorion commentedon Nov 20, 2025
It works with that. A human would not know that, and an AI agent does not know either. So two options:
OrKoN commentedon Nov 20, 2025
this would not be doable right now since filtering is on the puppeteer side.
This can be done.
Thanks for providing the feedback.
natorion commentedon Nov 20, 2025
Can we filter it down to the non-verbose screenshot afterwards before passing it on to the LLM?
OrKoN commentedon Nov 20, 2025
Code architecture would not allow to re-use the exact same code right now. Definitely possible but a larger change. Do you prefer this option? The other option is possible right now (next days).
Another option could be to use verbose by default? In general, for styling debugging we need to rework the snapshots to be a mix of DOM and a11y but that requires some thinking.
natorion commentedon Nov 20, 2025
I worry that makign verbose will just burn more tokens. The verbose snapshot is big compared to the normal one. Alternatively: How about mentioning in the tool description of take_snapshot that verbose=true should be used if the selected element is not showing up? This way an AI agent (or human) is able to figure out the problem without increasing token cost per operation massively.
OrKoN commentedon Nov 20, 2025
This is an option but I am not sure how well LLMs would be able to follow it. As a short-term solution it would be fine. I could add a line to the response output like
There is a selected element in the Elements panel call take_snapshot(verbose=true) to see. It would only show up if the snapshot is not already verbose and there is actually an element selected.natorion commentedon Nov 20, 2025
I like it.
fix: include a note about selected elements missing from the snapshot (…
fix: include a note about selected elements missing from the snapshot…