GeezerVison is showing github.com — desktop(browser): default snapshot depth 8 and find hide most element refs on real pages · Issue #64217 · anomalyco/opencode
desktop(browser): default snapshot depth 8 and find hide most element refs on real pages #64217DescriptionSummary
browser.snapshot defaults to depth 8, so on any real page the accessibility snapshot stops before most interactive elements and returns almost no element refs. browser.find uses the same shallow tree and silently returns nothing for text that is visibly on the page. Since browser.click, fill, select and check only accept refs, most controls on a normal site are unreachable, and the default workflow ("snapshot, then click") fails on exactly the pages the tool is meant for.
Environment
- opencode version: desktop app 2.3.0 (process file version), CLI
opencode --version reports 1.18.5
- OS: Windows 11,
Microsoft Windows NT 10.0.26300.0 (win32 x64)
- Terminal:
xterm-256color (desktop app Review pane, no external terminal)
- Shell: cmd / PowerShell 7.7
- Install/channel: desktop release build
- Active plugins: none in
opencode.json (MCP entries only: genoffice, attio, railway)
Reproduction
Minimal, self-contained page (depth only affects nesting, nothing else):
<!doctype html>
<html><body>
<h1>snapshot depth repro</h1>
<div><button>depth-marker-02</button>
<div><div><button>depth-marker-04</button>
<div><div><button>depth-marker-06</button>
<div><div><button>depth-marker-08</button>
<div><div><button>depth-marker-10</button>
<div><div><button>depth-marker-12</button>
<div><div><button>depth-marker-14</button>
<div><div><button aria-label="depth-marker-16">deepest</button>
</div></div></div></div></div></div></div></div>
</div></div></div></div></div></div></div></div>
</body></html>
- Serve it (e.g.
python -m http.server 8155) and browser.tabs.open({ url: "http://127.0.0.1:8155/repro.html" }).
browser.snapshot({ tabID }) → only depth-marker-02, -04, -06 get refs; truncated: true.
browser.snapshot({ tabID, depth: 12 }) → -08, -10 appear as well.
browser.snapshot({ tabID, depth: 20 }) → all eight buttons, truncated: false.
browser.find({ tabID, text: "depth-marker-16" }) → empty result, no error, although the button exists and is exposed at depth 20.
Same on real pages:
| Page |
interactive elements |
snapshot(tabID) |
snapshot(tabID, depth: 12) |
https://github.com/anomalyco/opencode |
189 |
2 refs, 1672 chars |
22 refs, 4660 chars |
| a public marketing site (React, cookie banner, footer) |
69 |
8 refs, 2493 chars |
65 refs, 20317 chars |
| the repro page above |
8 |
3 refs |
5 refs |
find on the GitHub page returns nothing for Issues and Contributors, both visible in the DOM and rendered.
Expected Behavior
- A snapshot that the tools can act on: every interactive element reachable, or at least an explicit, discoverable indication that the tree was truncated and how to get the rest.
find should search the same tree that snapshot({ depth }) can expose, or accept a depth.
- The default depth should either be configurable (config or tool parameter default) or documented in the tool description; right now the tool descriptions only mention
depth as a number, not that the default cuts real pages in half.
Actual Behavior
- Default depth is 8 (
snapshot({ depth: 8 }) is byte-identical to snapshot({ tabID })), which puts almost every control of a normal marketing or app page below the cut.
truncated: true stays true up to depth: 20 on real pages, and nothing in the response says which subtree was dropped.
find is bound to the shallow tree: it returns an empty string with no error for existing, visible text.
- Refs obtained from
snapshot({ depth: 12 | 20 }) work correctly for click, so the deeper tree is usable once requested — it is only the default that is unusable.
Additional Context
- Workaround used here: take
snapshot({ tabID, depth: 12 }) first and match text locally instead of find, or re-snapshot a container with a small depth to keep tokens down. That works, but costs ~20 KB for a single page and has to be re-learned per session because the default looks fine on small test pages.
- Two related observations from the same session, happy to file separately:
browser.click returns success when the click hits a fixed/sticky overlay or a pointer-events: none element, so the action silently does nothing. Verified with a sticky footer at 624×424 and with pointer-events: none.
- The first
browser.click after navigate/reload often fails with [browser.operation_failed] … UnknownVizError; repeating the same call with the same ref succeeds. Seen in 5 of 5 consecutive runs, then not reproduced once.
- Not affected: clicking inside iframes (refs from
snapshot({ frameID }) work) and inside open shadow roots (exposed as refs).
- All numbers above were measured with the desktop app's Review pane at a 624×424 viewport.
Activityopencodejr commented on Nov 16, 2026 Thanks for the detailed write-up and the minimal test page, it makes the problem very clear.
As I read it, the request is that the desktop browser tools reach the interactive elements of real pages by default. That means a deeper or configurable default snapshot depth, a way for browser.find to search deeper (or the full tree), and a clearer signal when a snapshot is cut, with a hint on how to get the rest.
The code matches what you measured, and the limits are deliberate rather than a malfunction:
browser.snapshot uses a depth of 8 when none is given, and browser.find always uses depth 8.
depth can be set from 1 to 20 on browser.snapshot.
browser.find takes only tabID, frameID and text, so it can't be told to go deeper.
So I've filed this as a feature request for the maintainers to consider. I can't promise when or whether it will change. Until then, your workaround (snapshot({ tabID, depth: 12 }), or a small depth on a container's ref) is the way to reach deeper elements.
About your two side observations:
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|