Repository navigation
fix(browser): make snapshot refs work with quoted labels and frames - #130623
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 27, 2026 02:50
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #130622
Additional instructions
This is a same-repository branch, so maintainers can edit it through their repository access. GitHub's fork-collaboration toggle applies only to cross-repository pull requests.
What Problem This Solves
Fixes an issue where users following browser snapshot refs could not click ordinary buttons when labels contained quotes, backslashes, or YAML punctuation. It also restores current frame-qualified Playwright refs in default AI metadata and interactive ARIA snapshots, so the snapshot actually supplies the identities needed for the next action.
Why This Change Was Made
The snapshot owner had three separate parsers that treated serialized names as plain quoted text. A single lexical parser now follows the pinned Playwright JSON-name/YAML-key format, preserves native frame-qualified refs, and keeps formatter-owned refs separate from ref-looking page text. Playwright builders decode names once for exact locators; the shared finalizer does not reinterpret native MCP/CDP metadata. Duplicate-label identity remains intact, and interactive AI formatting no longer repeats the same ref.
This repairs snapshot identity at its producer instead of adding locator fallbacks or longer timeouts. No action routing, navigation security, authorization, dependency, production configuration, persistence, or protocol changes. Production LOC: +57/-69 (net −12); tests: +149/-0; documentation: +7/-6.
Provenance: the original plain-quote role parser is present in
fadad6e0613aa9108db1a497bf1e33b37e29967a(2026-01-12, Peter Steinberger); no associated PR was established. Current frame-ref grammar was verified directly against Playwright 1.62.1. No unverified last-known-good release is claimed.User Impact
Browser snapshots retain actionable punctuation-containing labels and current native refs. Users can copy refs unchanged, including frame prefixes, and act on the intended element. The browser documentation now describes the three snapshot styles and the current ref format.
Evidence
OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_BROWSER_SNAPSHOT_E2E=1 node scripts/run-vitest.mjs extensions/browser/src/browser/pw-role-snapshot.chromium.test.ts. Ordinary browser Vitest CI does not install Chromium; a default skip is not claimed as native proof.Observed limitation/follow-up: the long independent browser matrix emitted a Node
MaxListenersExceededWarningfor 11 Socketdrainlisteners. Its 88 cases and 160 real actions passed, and all owned processes, ports, and temporary credentials were cleaned up. The warning's owner and baseline behavior are not established; it is recorded for separate investigation, not asserted to be a regression or suppressed here.