diff --git a/.changeset/late-parks-taste.md b/.changeset/late-parks-taste.md new file mode 100644 index 000000000..a0741eb54 --- /dev/null +++ b/.changeset/late-parks-taste.md @@ -0,0 +1,5 @@ +--- +"@browserbasehq/stagehand": patch +--- + +Add warning when incorrect models are used with agents hybrid mode diff --git a/packages/core/lib/v3/handlers/v3AgentHandler.ts b/packages/core/lib/v3/handlers/v3AgentHandler.ts index 47457dd41..8f80ed743 100644 --- a/packages/core/lib/v3/handlers/v3AgentHandler.ts +++ b/packages/core/lib/v3/handlers/v3AgentHandler.ts @@ -113,6 +113,18 @@ export class V3AgentHandler { }, }); + if ( + this.mode === "hybrid" && + !baseModel.modelId.includes("gemini-3-flash") && + !baseModel.modelId.includes("claude") + ) { + this.logger({ + category: "agent", + message: `Warning: "${baseModel.modelId}" may not perform well in hybrid mode. See recommended models: https://docs.stagehand.dev/v3/basics/agent#hybrid-mode`, + level: 0, + }); + } + return { options, maxSteps, diff --git a/packages/docs/v3/basics/agent.mdx b/packages/docs/v3/basics/agent.mdx index aa0362074..275f27843 100644 --- a/packages/docs/v3/basics/agent.mdx +++ b/packages/docs/v3/basics/agent.mdx @@ -140,7 +140,6 @@ Both DOM and CUA modes have their strengths and weaknesses. Hybrid mode combines Other models may not reliably produce accurate coordinates for clicking and typing. -**Our recommendation:** `google/gemini-3-flash-preview` for the best balance of reliability, speed, and cost. Hybrid mode requires `experimental: true` in your Stagehand constructor.