-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
Before submitting an issue, please:
- Check the documentation for relevant information
- Search existing issues to avoid duplicates
Environment Information
Please provide the following information to help us reproduce and resolve your issue:
Stagehand:
- Language/SDK: Python
- Stagehand version: 0.5.4
AI Provider:
- Provider: Anthropic
- Model: claude-haiku-4-5-20251001
Issue Description
The code indicates that I can pass a variables argument to both act and observe so that I can keep sensitive data out of the LLM, just like with the Typescript SDK (docs).
When I pass a variables dict:
page.act(Enter %employer_legal_name% in the 'Contract name' field, variables={"employer_legal_name": "foo"})
The prompt correctly tells the LLM that the variables are available, and the observe result comes back like:
"{""selector"": ""xpath=/html/body[1]/table[2]/tbody[1]/tr[1]/td[3]/table[1]/tbody[1]/tr[6]/td[3]/table[1]/tbody[1]/tr[2]/td[2]/p[1]/input[1]"", ""description"": ""The 'Contract name' textbox field where the employer legal name should be entered"", ""backend_node_id"": null, ""method"": ""fill"", ""arguments"": [""%employer_legal_name%""]}"
where "employer_legal_name" was the name of my variable.
However, when the playwright portion runs, it uses the string literal "employer_legal_name" rather than resolving the value of that key in my variables dict.
Steps to Reproduce
- Pass
variablestoactorobserve - Observe that the variable key is used in the resulting playwright command, rather than the variable value
afanslau
Metadata
Metadata
Assignees
Labels
No labels