remove experimental requirement on agent variables (#2079)#2080
remove experimental requirement on agent variables (#2079)#2080miguelg719 merged 6 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: a6e9d62 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
|
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 experimental mode, with end-to-end substitution acrossact,observe, and agent tools. TightenedfillFormVisionso secrets are only substituted at type-time and never leak via logs, replays, or tool outputs.New Features
variablestoAgentExecuteOptionsSchemaand server OpenAPI (Variables).act,observe, andagentExecute(simple and rich forms).Bug Fixes
fillFormVisionto substitute variables only when typing and keep placeholders in action logs, replays, and returned arguments.Written for commit a6e9d62. Summary will update on new commits.