Repository navigation
feat(extension): integrate role/text waits and snapshots - #3189
supremeboxlogos wants to merge 5 commits into
Conversation
🦋 Changeset detectedLatest commit: 2c50dc8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
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 |
…ocators-integration # Conflicts: # packages/sdk-go/internal/extensionassets/stagehand-extension.zip
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Confidence score: 3/5
- In
waitForSelector.ts, semantic waits withpierceShadow: truecan miss matches inside closed shadow roots. UpdatequerySemanticSelectorto traverse closed roots as well as open ones.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/extension/dom/locatorScripts/waitForSelector.ts">
<violation number="1" location="packages/extension/dom/locatorScripts/waitForSelector.ts:204">
P2: With `pierceShadow: true`, semantic waits cannot find matches inside closed shadow roots: `querySemanticSelector` traverses only `.shadowRoot`, while the previous wait path uses `getOpenOrClosedShadowRoot`. Extend semantic traversal to use the extension's closed-root resolver; otherwise attached waits time out and detached waits can succeed prematurely.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| const pierceShadow = pierceShadowRaw !== false; | ||
| const steps = typeof selectorRaw === "string" ? undefined : selectorRaw; | ||
| const query = steps | ||
| ? () => querySemanticSelector(steps, document, { pierceShadow })[0] ?? null |
There was a problem hiding this comment.
P2: With pierceShadow: true, semantic waits cannot find matches inside closed shadow roots: querySemanticSelector traverses only .shadowRoot, while the previous wait path uses getOpenOrClosedShadowRoot. Extend semantic traversal to use the extension's closed-root resolver; otherwise attached waits time out and detached waits can succeed prematurely.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/extension/dom/locatorScripts/waitForSelector.ts, line 204:
<comment>With `pierceShadow: true`, semantic waits cannot find matches inside closed shadow roots: `querySemanticSelector` traverses only `.shadowRoot`, while the previous wait path uses `getOpenOrClosedShadowRoot`. Extend semantic traversal to use the extension's closed-root resolver; otherwise attached waits time out and detached waits can succeed prematurely.</comment>
<file context>
@@ -191,21 +189,34 @@ const setupShadowObservers = (
const pierceShadow = pierceShadowRaw !== false;
+ const steps = typeof selectorRaw === "string" ? undefined : selectorRaw;
+ const query = steps
+ ? () => querySemanticSelector(steps, document, { pierceShadow })[0] ?? null
+ : () => findElement(selector, pierceShadow);
+ const observationOptions: MutationObserverInit = {
</file context>
why
Complete extension integration for role and text query plans without exposing SDK builders. Stacked on #3188.
what changed
test plan