Before: Sign in button was in the header After: Sign in now requires: Click account menu → Click “Sign in” optionA single act("click sign in") can’t handle this change. The agent fallback can discover and execute both steps.
Copy
Ask AI
import { Stagehand } from "@browserbasehq/stagehand";try { await page.act("click the 'Sign In' button");} catch (err) { console.log("Agent fallback triggered"); const agent = stagehand.agent({ provider: "anthropic", model: "claude-sonnet-4-20250514", instructions: "You are a helpful assistant that can use a web browser.", }); const result = await agent.execute({ instruction: "Find and click Sign In button", maxSteps: 10, }); console.log(result.success ? "Agent fallback success" : "Agent fallback failed"); if (!result.success) throw err;}