diff --git a/.changeset/dragon-of-fabulous-persistence.md b/.changeset/dragon-of-fabulous-persistence.md new file mode 100644 index 00000000..a988f895 --- /dev/null +++ b/.changeset/dragon-of-fabulous-persistence.md @@ -0,0 +1,5 @@ +--- +"stagehand": patch +--- + +Fix max_steps parsing for agent execute options diff --git a/stagehand/agent/agent.py b/stagehand/agent/agent.py index c5bd429e..d455c1d5 100644 --- a/stagehand/agent/agent.py +++ b/stagehand/agent/agent.py @@ -132,7 +132,7 @@ async def execute( try: agent_result = await self.client.run_task( instruction=instruction, - max_steps=self.config.max_steps, + max_steps=options.max_steps or self.config.max_steps, options=options, ) except Exception as e: