Repository navigation
[fix]: variable substitution in act() - #3383
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 32e7744 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 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 |
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant Client as Client (Test/Caller)
participant ActSvc as actService.act()
participant DetAct as takeDeterministicAction()
participant VarSub as substituteVariablesInArguments()
participant PerfAct as performAction()
participant LLM as LLM Generation
Note over Client,PerfAct: act() flow for dragAndDrop with variables
Client->>ActSvc: act({ instruction, variables, selfHeal })
ActSvc->>ActSvc: Resolve action (inferred/supplied/self-heal)
alt Supplied action
ActSvc-->>ActSvc: Use action as provided
else Inferred or self-heal action
ActSvc->>LLM: Generate action from instruction
LLM-->>ActSvc: Action with method + arguments
end
ActSvc->>DetAct: takeDeterministicAction(action, variables)
DetAct->>DetAct: Copy action.arguments to placeholderArgs
alt Method is DRAG_AND_DROP
DetAct->>DetAct: NEW: Skip variable substitution - use placeholderArgs as-is
else Other methods
DetAct->>VarSub: substituteVariablesInArguments(arguments, variables)
VarSub-->>DetAct: Resolved arguments (variables replaced)
end
DetAct->>PerfAct: performAction(method, selector, resolvedArgs)
alt Self-heal with initial failure
PerfAct-->>DetAct: Error (element detached)
DetAct->>LLM: Re-generate action (self-heal)
LLM-->>DetAct: Updated action
DetAct->>DetAct: Copy new arguments to placeholderArgs
alt Drag and drop again
DetAct->>DetAct: Skip variable substitution again
end
DetAct->>PerfAct: performAction(method, selector, resolvedArgs)
PerfAct-->>DetAct: Success
else Happy path
PerfAct-->>DetAct: Success
end
DetAct-->>ActSvc: Action result
ActSvc-->>Client: Success with literal drag targets preserved
AzamAbdul
approved these changes
Nov 4, 2026
This was referenced Nov 4, 2026
miguelg719
pushed a commit
that referenced
this pull request
Nov 4, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @browserbasehq/[email protected] ### Minor Changes - [#3305](#3305) [`aeb1ba0`](aeb1ba0) Thanks [@miguelg719](https://github.com/miguelg719)! - add `browser.disconnect()`, which closes an attached Stagehand instance and the connection to a browser without closing the browser or releasing its Browserbase session (Browserbase still ends sessions without `keepAlive` on disconnect). `browser.close()` after `disconnect()` now throws (connect again to close the browser), a launched local browser receives `Browser.close` before it is terminated, browser handles expose `cdpUrl` (`cdp_url` in Python) for local browsers, and `connected` reports whether the handle still has a live connection - [#3325](#3325) [`d59afde`](d59afde) Thanks [@miguelg719](https://github.com/miguelg719)! - Add an extension watchdog for lost SDK clients ### Patch Changes - [#3339](#3339) [`44d99df`](44d99df) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Adopt cross-origin iframes that were already loaded when Stagehand attached, or that are nested inside another cross-origin iframe, so snapshots and actions can reach them. - [#3330](#3330) [`dc8eb40`](dc8eb40) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - bump zod to 4.6.6 - [#3340](#3340) [`edb76b0`](edb76b0) Thanks [@akeimach](https://github.com/akeimach)! - Fix act, observe and extract with Claude Opus 5.5 by bumping `@ai-sdk/anthropic` and `ai` in the extension. - [#3387](#3387) [`066e875`](066e875) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fixed domain policy bypasses involving URLs with credentials, background requests, and speculative page loads - [#3383](#3383) [`1e50db6`](1e50db6) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - skip variable substitution for drag-and-drop arguments in act(). - [#3388](#3388) [`18b96f2`](18b96f2) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fix issue where calling act() prevents cross-origin iframes from loading ## @browserbasehq/[email protected] ### Patch Changes - [#3330](#3330) [`dc8eb40`](dc8eb40) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - bump zod to 4.6.6 - [#3350](#3350) [`b7a4b89`](b7a4b89) Thanks [@miguelg719](https://github.com/miguelg719)! - Save run screenshots only as PNG or JPEG files, under ./stagehand-artifacts by default - Updated dependencies [[`44d99df`](44d99df), [`dc8eb40`](dc8eb40), [`edb76b0`](edb76b0), [`066e875`](066e875), [`1e50db6`](1e50db6), [`aeb1ba0`](aeb1ba0), [`18b96f2`](18b96f2), [`d59afde`](d59afde)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Minor Changes - [#3325](#3325) [`d59afde`](d59afde) Thanks [@miguelg719](https://github.com/miguelg719)! - Add an extension watchdog for lost SDK clients ### Patch Changes - [#3339](#3339) [`44d99df`](44d99df) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Adopt cross-origin iframes that were already loaded when Stagehand attached, or that are nested inside another cross-origin iframe, so snapshots and actions can reach them. - [#3330](#3330) [`dc8eb40`](dc8eb40) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - bump zod to 4.6.6 - [#3340](#3340) [`edb76b0`](edb76b0) Thanks [@akeimach](https://github.com/akeimach)! - Fix act, observe and extract with Claude Opus 5.5 by bumping `@ai-sdk/anthropic` and `ai` in the extension. - [#3387](#3387) [`066e875`](066e875) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fixed domain policy bypasses involving URLs with credentials, background requests, and speculative page loads - [#3383](#3383) [`1e50db6`](1e50db6) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - skip variable substitution for drag-and-drop arguments in act(). - [#3388](#3388) [`18b96f2`](18b96f2) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fix issue where calling act() prevents cross-origin iframes from loading ## @browserbasehq/[email protected] ### Minor Changes - [#3305](#3305) [`aeb1ba0`](aeb1ba0) Thanks [@miguelg719](https://github.com/miguelg719)! - add `browser.disconnect()`, which closes an attached Stagehand instance and the connection to a browser without closing the browser or releasing its Browserbase session (Browserbase still ends sessions without `keepAlive` on disconnect). `browser.close()` after `disconnect()` now throws (connect again to close the browser), a launched local browser receives `Browser.close` before it is terminated, browser handles expose `cdpUrl` (`cdp_url` in Python) for local browsers, and `connected` reports whether the handle still has a live connection - [#3325](#3325) [`d59afde`](d59afde) Thanks [@miguelg719](https://github.com/miguelg719)! - Add an extension watchdog for lost SDK clients ### Patch Changes - [#3339](#3339) [`44d99df`](44d99df) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Adopt cross-origin iframes that were already loaded when Stagehand attached, or that are nested inside another cross-origin iframe, so snapshots and actions can reach them. - [#3330](#3330) [`dc8eb40`](dc8eb40) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - bump zod to 4.6.6 - [#3340](#3340) [`edb76b0`](edb76b0) Thanks [@akeimach](https://github.com/akeimach)! - Fix act, observe and extract with Claude Opus 5.5 by bumping `@ai-sdk/anthropic` and `ai` in the extension. - [#3387](#3387) [`066e875`](066e875) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fixed domain policy bypasses involving URLs with credentials, background requests, and speculative page loads - [#3383](#3383) [`1e50db6`](1e50db6) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - skip variable substitution for drag-and-drop arguments in act(). - [#3388](#3388) [`18b96f2`](18b96f2) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fix issue where calling act() prevents cross-origin iframes from loading ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies [[`44d99df`](44d99df), [`dc8eb40`](dc8eb40), [`edb76b0`](edb76b0), [`066e875`](066e875), [`1e50db6`](1e50db6), [`aeb1ba0`](aeb1ba0), [`18b96f2`](18b96f2), [`d59afde`](d59afde)]: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies [[`44d99df`](44d99df), [`dc8eb40`](dc8eb40), [`edb76b0`](edb76b0), [`066e875`](066e875), [`1e50db6`](1e50db6), [`aeb1ba0`](aeb1ba0), [`18b96f2`](18b96f2), [`d59afde`](d59afde)]: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies [[`44d99df`](44d99df), [`dc8eb40`](dc8eb40), [`edb76b0`](edb76b0), [`066e875`](066e875), [`1e50db6`](1e50db6), [`aeb1ba0`](aeb1ba0), [`18b96f2`](18b96f2), [`d59afde`](d59afde)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies [[`44d99df`](44d99df), [`dc8eb40`](dc8eb40), [`edb76b0`](edb76b0), [`066e875`](066e875), [`1e50db6`](1e50db6), [`aeb1ba0`](aeb1ba0), [`18b96f2`](18b96f2), [`d59afde`](d59afde)]: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies [[`44d99df`](44d99df), [`dc8eb40`](dc8eb40), [`edb76b0`](edb76b0), [`066e875`](066e875), [`1e50db6`](1e50db6), [`aeb1ba0`](aeb1ba0), [`18b96f2`](18b96f2), [`d59afde`](d59afde)]: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - [#3330](#3330) [`dc8eb40`](dc8eb40) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - bump zod to 4.6.6 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
why
dragAndDrop()dragAndDrop()needs are selectorswhat changed
test plan
dragAndDrop()Summary by cubic
Fixes variable substitution in
act()so drag-and-drop arguments keep their literal selector values instead of being treated as text templates.substituteVariablesInArgumentsfordragAndDropactions while preserving it for other methods.Written for commit 32e7744. Summary will update on new commits.