feat(core): context-aware element resolver scoring (#991)#1111
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86ba0722f9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| properties: props, | ||
| contextText: typeof props['description'] === 'string' ? String(props['description']).slice(0, 240) : undefined, | ||
| }); |
There was a problem hiding this comment.
Set
inViewport before applying context tie-breaks
scoreNodeContext adds a viewport bonus, but flattened AX nodes never set inViewport, so every candidate gets the same viewport signal. In context-qualified queries with repeated labels, this lets hidden/offscreen matches outrank visible ones purely by text; because cascadeFilter trims to maxResults before DOM.getBoxModel drops zero-size nodes, visible elements can be excluded and the action can fail with ELEMENT_NOT_FOUND even when a valid on-screen target exists.
Useful? React with 👍 / 👎.
Constraint: Context scoring must be deterministic, local-only, and must not outrank the existing AX cascade match levels. Rejected: Add a semantic selector language or cloud/LLM resolver | too broad for #991 and risks changing OpenChrome action semantics. Confidence: high Scope-risk: narrow Directive: Keep act.context as a tie-breaker; do not let context override exact role/name matching without a separate design issue. Tested: npx jest tests/utils/ax-element-resolver.test.ts --runInBand; npm run build; npm run lint:changed Not-tested: Real OpenChrome repeated-card fixture verification is documented in the PR for merge-time/manual validation. Co-authored-by: OmX <omx@oh-my-codex.dev>
86ba072 to
3326d2e
Compare
Progress / Review status
Auto-refreshed 2026-05-13 — owner comments cleaned up to reduce review noise.
feat/991-context-aware-resolver→develop3326d2e— Improve repeated-label action targeting with local contextOwner comment cleanup: 0 issue + 0 inline review comments deleted. Outstanding feedback from automated/external reviewers above is unchanged.
Summary
act.contextinto AX element resolutionRepo-fit / duplicate check
Tests
npx jest tests/utils/ax-element-resolver.test.ts --runInBandnpm run buildnpm run lint:changedMerge-time real OpenChrome verification
Use a local fixture with header/main/footer or product-card repeated controls:
navigateto the fixture page with threeAdd to cartbuttons.act({ tabId, instruction: "click Add to cart", context: "Noise Cancelling Headphones" }).read_page/oc_assertthat only the headphones cart state changed.Closes #991