stagehand icon indicating copy to clipboard operation
stagehand copied to clipboard

Warning messages about OpenAI Zod args with Agent

Open alexkreidler opened this issue 7 months ago • 0 comments

I'm running a simple Agent task like this example:

await stagehand.page.goto("https://github.com/browserbase/stagehand");

// Open Operator will use the default LLM from Stagehand config
const operator = stagehand.agent();
const { message, actions } = await operator.execute(
	"Extract the top contributor's username"
);

console.log(message);

And it is working but I'm getting these warning messages on every step:

 Zod field at `#/definitions/operatorResponseSchema/properties/parameters` uses `.optional()` without `.nullable()` which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required
This will become an error in a future version of the SDK.

Also, is there a way to get access to the agent actions as they occur? (e.g. if I want to show progress or interact with the DOM to record the Agent's steps). Thanks for a great project!

alexkreidler avatar Apr 26 '25 23:04 alexkreidler