GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #64217

New issue
Copy link
New issue
Copy link
Closed
#63002
Closed
desktop(browser): default snapshot depth 8 and find hide most element refs on real pages#64217
#63002
Copy link
Labels
area/desktopDesktop appplatform/windowsWindowstype/featureNew behaviour or an improvementversion/v2OpenCode 2.x

Description

@G5317
G5317
opened on Nov 16, 2026
Issue body actions

Summary

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>
  1. Serve it (e.g. python -m http.server 8155) and browser.tabs.open({ url: "http://127.0.0.1:8155/repro.html" }).
  2. browser.snapshot({ tabID }) → only depth-marker-02, -04, -06 get refs; truncated: true.
  3. browser.snapshot({ tabID, depth: 12 }) → -08, -10 appear as well.
  4. browser.snapshot({ tabID, depth: 20 }) → all eight buttons, truncated: false.
  5. 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.

Activity

  1. opencodejr commented on Nov 16, 2026

    @opencodejr
    opencodejrBot
    on Nov 16, 2026
    Contributor
    More actions

    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:

    • feat(desktop): signed-in browser pane with extensions, previews, prompts and agent safeguards #63002 (an open PR reworking the desktop browser tools) lists the first-click UnknownVizError as fixed. It isn't merged yet.
    • I didn't find an existing issue for browser.click reporting success when it hits a sticky overlay or a pointer-events: none element. A separate issue with your sticky-footer test case would be welcome.
  2. opencodejr
    added
    area/desktopDesktop app
    platform/windowsWindows
    type/featureNew behaviour or an improvement
    version/v2OpenCode 2.x
    on Nov 16, 2026
  3. Hona
    closed this as completedin #63002on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/desktopDesktop appplatform/windowsWindowstype/featureNew behaviour or an improvementversion/v2OpenCode 2.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.