Skip to content

fix: targeted extract not allowing xpath= #887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

seanmcguire12
Copy link
Member

@seanmcguire12 seanmcguire12 commented Jul 16, 2025

why

  • we were passing the wrong variable to getAccessibilityTree which broke targeted extract for selectors with the xpath= prefix

what changed

  • pass the parsed xpath instead of the raw selector

test plan

  • targeted extract evals

Copy link

changeset-bot bot commented Jul 16, 2025

🦋 Changeset detected

Latest commit: e1a8d98

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@seanmcguire12 seanmcguire12 added extract These changes pertain to the extract function targeted-extract These changes pertain to targeted extract and removed extract These changes pertain to the extract function labels Jul 16, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR fixes a critical bug in the targeted extract functionality where XPath selectors were not working correctly. The issue was caused by passing the raw selector string (including the xpath= prefix) to getAccessibilityTree instead of the parsed XPath expression. The fix is a simple but important change that properly strips the xpath= prefix before passing the selector to the tree generation function.

This change is important for maintaining the library's XPath-based extraction capabilities, which are documented in the changelog as being introduced in version 1.14.0. The fix ensures that users can continue to use XPath selectors for targeted extraction as intended.

Confidence score: 5/5

  1. This PR is extremely safe to merge
  2. The change is minimal, well-isolated, and fixes a clear bug with an obvious solution
  3. No files need special attention - the change is straightforward and well-tested

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
targeted-extract These changes pertain to targeted extract
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant