Skip to content

feat(tools): store selector candidates for browser clicks - #1

Merged
Matt-patto merged 1 commit into
mainfrom
feat/click-selector-candidates
Sep 23, 2026
Merged

Matt-patto merged 1 commit into
mainfrom
feat/click-selector-candidates

Conversation

@Matt-patto

Copy link
Copy Markdown
Owner

Summary

  • Snapshot refs (browser tool, action: "snapshot") now also record an xpath and a testId selector per element, alongside the existing selector CSS path.
  • resolveLocator surfaces the candidate set, and action: "click" returns it in the tool result details (action, targetId, target, selectors) so session traces store every way to re-find the clicked element instead of just the one selector that was used.
  • Applies to clicks through both the managed Playwright browser and the Chrome/Edge extension relay, since both resolve via the same snapshot refs.

Upstream PR: understudy-ai#26

Test plan

  • pnpm build — all packages compile
  • pnpm typecheck (packages/tools) — clean
  • pnpm lint (changed files) — clean
  • vitest packages/tools/src/__tests__/browser-tool.test.ts — 11/11 pass
  • Manual: browser tool snapshot → click on a real page, inspect details.selectors

Generated with Devin

Snapshot refs and click results previously kept a single CSS path per
element, leaving replay nothing to fall back on when the DOM shifts.
Each snapshot ref now also records an xpath and test-id selector, and
the click action returns the resolved candidate set in its details so
downstream traces have alternatives to retry with.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@Matt-patto
Matt-patto merged commit f31bd0d into main Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant