added default value and optimized xpath#140
Merged
sauravpanda merged 2 commits intomainfrom Nov 14, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
3 issues found across 11 files
Prompt for AI agents (all 3 issues)
Understand the root cause of the following 3 issues and fix them.
<file name="workflows/workflow_use/workflow/element_finder.py">
<violation number="1" location="workflows/workflow_use/workflow/element_finder.py:99">
Returning a hard-coded index of 0 breaks both callers—service.py will click the wrong element and semantic_executor.py will raise because it expects a selector string.</violation>
<violation number="2" location="workflows/workflow_use/workflow/element_finder.py:107">
By short-circuiting with “Strategy type … not yet supported”, every non-XPath strategy (text_exact, role_text, aria_label, etc.) now always fails, even though the selector generator and existing tests still rely on them. This regresses the core semantic matching behavior.</violation>
</file>
<file name="workflows/workflow_use/healing/xpath_optimizer.py">
<violation number="1" location="workflows/workflow_use/healing/xpath_optimizer.py:138">
Dynamic attribute and text values need escaping before embedding in XPath literals; otherwise any single quote in the value produces an invalid selector.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
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.
Summary by cubic
Adds default values for workflow inputs and prioritizes XPath-based selectorStrategies for clicks to improve reliability and meet 139-add-ai-strategy-selection. Prompts now show and use defaults, and clicking uses evaluated XPath when provided, with semantic strategies supported via the selector map.
New Features
Refactors
Written for commit 3dcf69f. Summary will update automatically on new commits.