Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gentle-beds-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@browserbasehq/stagehand": patch
---

Add haiku 4.5 computer use support
21 changes: 12 additions & 9 deletions evals/deterministic/tests/Errors/apiKeyError.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ test.describe("API key/LLMClient error", () => {
}

expect(errorThrown).toBeInstanceOf(Error);
expect(errorThrown?.message).toContain(
"No LLM API key or LLM Client configured",
);
expect(
errorThrown?.message?.includes("No LLM API key or LLM Client configured") ||
errorThrown?.message?.includes("API key is missing. Pass it using the 'apiKey' parameter")
).toBe(true);

await stagehand.close();
});
Expand All @@ -47,9 +48,10 @@ test.describe("API key/LLMClient error", () => {
}

expect(errorThrown).toBeInstanceOf(Error);
expect(errorThrown?.message).toContain(
"No LLM API key or LLM Client configured",
);
expect(
errorThrown?.message?.includes("No LLM API key or LLM Client configured") ||
errorThrown?.message?.includes("API key is missing. Pass it using the 'apiKey' parameter")
).toBe(true);

await stagehand.close();
});
Expand All @@ -68,9 +70,10 @@ test.describe("API key/LLMClient error", () => {
}

expect(errorThrown).toBeInstanceOf(Error);
expect(errorThrown?.message).toContain(
"No LLM API key or LLM Client configured",
);
expect(
errorThrown?.message?.includes("No LLM API key or LLM Client configured") ||
errorThrown?.message?.includes("API key is missing. Pass it using the 'apiKey' parameter")
).toBe(true);

await stagehand.close();
});
Expand Down
1 change: 1 addition & 0 deletions lib/agent/AgentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const modelToAgentProviderMap: Record<string, AgentType> = {
"computer-use-preview": "openai",
"computer-use-preview-2025-03-11": "openai",
"claude-3-7-sonnet-latest": "anthropic",
"claude-haiku-4-5-20251001": "anthropic",
"claude-sonnet-4-20250514": "anthropic",
"claude-sonnet-4-5-20250929": "anthropic",
"gemini-2.5-computer-use-preview-10-2025": "google",
Expand Down
2 changes: 1 addition & 1 deletion stagehand.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const StagehandConfig: ConstructorParams = {
domSettleTimeoutMs: 30_000 /* Timeout for DOM to settle in milliseconds */,

// LLM configuration
modelName: "gpt-4o" /* Name of the model to use */,
modelName: "openai/gpt-4.1-mini" /* Name of the model to use */,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: unrelated change - reverting default model from gpt-4o to openai/gpt-4.1-mini shouldn't be part of this PR

Suggested change
modelName: "openai/gpt-4.1-mini" /* Name of the model to use */,
modelName: "gpt-4o" /* Name of the model to use */,
Prompt To Fix With AI
This is a comment left during a code review.
Path: stagehand.config.ts
Line: 10:10

Comment:
**logic:** unrelated change - reverting default model from `gpt-4o` to `openai/gpt-4.1-mini` shouldn't be part of this PR

```suggestion
  modelName: "gpt-4o" /* Name of the model to use */,
```

How can I resolve this? If you propose a fix, please make it concise.

modelClientOptions: {
apiKey: process.env.OPENAI_API_KEY,
} /* Configuration options for the model client */,
Expand Down