remove experimental requirement on agent variables (#2079)#2080
remove experimental requirement on agent variables (#2079)#2080miguelg719 wants to merge 3 commits intomainfrom
Conversation
# why # what changed # test plan <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Enable variables in v3 `agentExecute` without requiring experimental mode, and update API schemas to preserve both simple and rich variable shapes. CUA mode remains unsupported for variables. - **New Features** - Added `variables` to `AgentExecuteOptionsSchema` and server OpenAPI so values pass through unchanged. - Removed the experimental-feature check for variables in `validateExperimentalFeatures`; CUA-mode rejection stays. - Updated JSDoc on `AgentExecuteOptionsBase.variables` and added unit tests for validation, schema parsing, and client serialization. <sup>Written for commit 65b3c75. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 4467fe1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ stagehand-go studio · code · diff
✅ stagehand-php studio · conflict
✅ stagehand-openapi studio · code · diff
✅ stagehand-kotlin studio · code · diff
✅ stagehand-ruby studio · code · diff
✅ stagehand-typescript studio · code · diff
✅ stagehand-python studio · code · diff
✅ stagehand-java studio · code · diff
|
| 💡 Name/Renamed: 36 names were renamed due to language constraints, so fallback names will be used instead. |
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-05-05 00:06:34 UTC
There was a problem hiding this comment.
No issues found across 8 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 (SDK User)
participant API as StagehandAPI (agentExecute)
participant Validate as validateExperimentalFeatures
participant Schema as AgentExecuteOptionsSchema
participant Spec as OpenAPI Spec (server-v3)
participant Server as Backend API Service
Note over Client,Server: Agent Execute with Variables Flow (v3)
Client->>API: agentExecute({ instruction, variables })
Note over Client,API: variables now accepted without experimental:true
API->>Validate: validateExperimentalFeatures(options)
alt mode is "cua" AND variables provided
Validate-->>API: throw StagehandInvalidArgumentError
API-->>Client: Error: variables not supported in CUA mode
else all other modes (dom, etc.)
Validate-->>API: pass (no experimental check for variables)
end
API->>Schema: parse/validate executeOptions
Note over Schema: variables field defined in AgentExecuteOptionsSchema
Schema-->>API: validated options with variables
API->>Server: POST /agentExecute<br/>(agentConfig, executeOptions, variables)
Note over Server: Variables sent via API request body
alt simple variables
Server-->>API: { variables: { username: "john@example.com" } }
else rich variables (with description)
Server-->>API: { variables: { password: { value: "secret", description: "..." } } }
end
API-->>Client: success response
why
experimental: trueis no longer required for agent variable supportwhat changed
validateExperimentalFeatures.tsand the @experimental JSDoc onAgentExecuteOptionsBase.variables.packages/core/lib/v3/types/public/api.ts) and reflected it in the generatedopenapi.v3.yaml(both request and output components).experimental: truefrom the Variables Note and Basic Usage example (kept the "Non-CUA agents only" caveat).act.test.tsandagentExecute.test.ts(simple and rich { value, description } forms, verified via CDP), and updatedobserve.test.ts's existing variables tests to use the same scenario.test plan
Summary by cubic
Enable variables in v3
agentExecutewithout requiring experimental mode, with end-to-end substitution. API, types, and docs support simple and rich variables; variables remain unsupported in CUA mode.variablestoAgentExecuteOptionsSchemaand server OpenAPI (Variables).act,observe, andagentExecute.Written for commit 4467fe1. Summary will update on new commits.