Skip to content

Commit 2dbac99

Browse files
authored
Add Haiku 4.5 computer use support (#1137)
# why New model dropped # what changed Added support for haiku 4.5 # test plan
1 parent b419fc3 commit 2dbac99

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

.changeset/gentle-beds-enjoy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@browserbasehq/stagehand": patch
3+
---
4+
5+
Add haiku 4.5 computer use support

evals/deterministic/tests/Errors/apiKeyError.test.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ test.describe("API key/LLMClient error", () => {
2424
}
2525

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

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

4950
expect(errorThrown).toBeInstanceOf(Error);
50-
expect(errorThrown?.message).toContain(
51-
"No LLM API key or LLM Client configured",
52-
);
51+
expect(
52+
errorThrown?.message?.includes("No LLM API key or LLM Client configured") ||
53+
errorThrown?.message?.includes("API key is missing. Pass it using the 'apiKey' parameter")
54+
).toBe(true);
5355

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

7072
expect(errorThrown).toBeInstanceOf(Error);
71-
expect(errorThrown?.message).toContain(
72-
"No LLM API key or LLM Client configured",
73-
);
73+
expect(
74+
errorThrown?.message?.includes("No LLM API key or LLM Client configured") ||
75+
errorThrown?.message?.includes("API key is missing. Pass it using the 'apiKey' parameter")
76+
).toBe(true);
7477

7578
await stagehand.close();
7679
});

lib/agent/AgentProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const modelToAgentProviderMap: Record<string, AgentType> = {
1515
"computer-use-preview": "openai",
1616
"computer-use-preview-2025-03-11": "openai",
1717
"claude-3-7-sonnet-latest": "anthropic",
18+
"claude-haiku-4-5-20251001": "anthropic",
1819
"claude-sonnet-4-20250514": "anthropic",
1920
"claude-sonnet-4-5-20250929": "anthropic",
2021
"gemini-2.5-computer-use-preview-10-2025": "google",

stagehand.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const StagehandConfig: ConstructorParams = {
77
domSettleTimeoutMs: 30_000 /* Timeout for DOM to settle in milliseconds */,
88

99
// LLM configuration
10-
modelName: "gpt-4o" /* Name of the model to use */,
10+
modelName: "openai/gpt-4.1-mini" /* Name of the model to use */,
1111
modelClientOptions: {
1212
apiKey: process.env.OPENAI_API_KEY,
1313
} /* Configuration options for the model client */,

0 commit comments

Comments
 (0)