[chore] update supported CUA models#2064
[chore] update supported CUA models#2064miguelg719 merged 2 commits intobrowserbase:contrib/2064from
Conversation
|
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 3/5
- There is a concrete regression risk in
packages/core/lib/v3/agent/AgentProvider.ts: expanding a hardcoded LLM allowlist can cause valid runtime models to be rejected, which is user-facing behavior. - The issue is medium severity (6/10) with fairly high confidence (8/10), so this looks like a meaningful correctness concern rather than a minor housekeeping note.
- Pay close attention to
packages/core/lib/v3/agent/AgentProvider.ts- hardcoded model-name gating may violate the custom-agent rule and block supported models at runtime.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/core/lib/v3/agent/AgentProvider.ts">
<violation number="1" location="packages/core/lib/v3/agent/AgentProvider.ts:19">
P2: Custom agent: **Ensure we never check against hardcoded lists of allowed LLM model names**
Newly added model-name entries expand a hardcoded allowlist that is used for runtime model rejection, violating the rule requiring model-name-agnostic acceptance.</violation>
</file>
Architecture diagram
sequenceDiagram
participant App as Application Code
participant Resolve as resolveModel() (agent.ts)
participant Provider as AgentProvider.ts
participant Ext as LLM Provider (OpenAI/Anthropic)
Note over App,Ext: Runtime Model Resolution & Provider Mapping
App->>Resolve: Pass model identifier (e.g. "openai/gpt-5.5")
rect rgb(240, 240, 240)
Note over Resolve: Validation Layer
Resolve->>Resolve: NEW: Validate against AVAILABLE_CUA_MODELS
Note right of Resolve: Includes: gpt-5.4-mini, gpt-5.5,<br/>and claude-haiku-4-5
end
Resolve-->>App: Valid AvailableCuaModel
App->>Provider: getAgentProvider(modelName)
rect rgb(240, 240, 240)
Note over Provider: Provider Routing Layer
Provider->>Provider: NEW: Lookup in modelToAgentProviderMap
Note right of Provider: Maps gpt-5.x -> "openai"<br/>Maps haiku-4-5 -> "anthropic"
end
Provider-->>App: Provider Implementation Instance
App->>Ext: Dispatch CUA Request
Ext-->>App: Action/Observation Result
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
## What Changed Adds three new models to the list of supported CUA (Computer Use Agent) models: - `openai/gpt-5.4-mini` - `openai/gpt-5.5` - `anthropic/claude-haiku-4-5` --- ## Files Changed ### `packages/core/lib/v3/types/public/agent.ts` - Added the three models to the `AVAILABLE_CUA_MODELS` const array - This drives: - The `AvailableCuaModel` type - The runtime CUA model check in `resolveModel()` ### `packages/core/lib/v3/agent/AgentProvider.ts` - Added model → provider mappings in `modelToAgentProviderMap`: - `gpt-5.4-mini` → `openai` - `gpt-5.5` → `openai` - `claude-haiku-4-5` → `anthropic` - Ensures `AgentProvider.getAgentProvider()` resolves them correctly ### `packages/core/tests/unit/public-api/llm-and-agents.test.ts` - Updated the `expectedModels` list in the type-level test to stay in sync with the source of truth --- ## How It Was Tested - ✅ Build passes (`pnpm turbo run build`) - ✅ All **204 public-api unit tests** pass - ✅ All **608 unit tests** pass -⚠️ 4 pre-existing failures in `flowlogger-eventstore.test.js` (confirmed on base branch) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds support for three new Computer Use Agent models and maps them to the right providers. Apps can now use `openai/gpt-5.4-mini`, `openai/gpt-5.5`, and `anthropic/claude-haiku-4-5` via the public API. - **New Features** - Registered the models in `AVAILABLE_CUA_MODELS` and mapped providers: `gpt-5.4-mini` → `openai`, `gpt-5.5` → `openai`, `claude-haiku-4-5` → `anthropic`. - Updated public API tests to include the new models. - Added a changeset to release these additions as a patch in `@browserbasehq/stagehand`. <sup>Written for commit ec5b691. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/2065?utm_source=github">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: Chromie <miguel@browserbase.com> Co-authored-by: Claude <noreply@anthropic.com>
What Changed
Adds three new models to the list of supported CUA (Computer Use Agent) models:
openai/gpt-5.4-miniopenai/gpt-5.5anthropic/claude-haiku-4-5Files Changed
packages/core/lib/v3/types/public/agent.tsAVAILABLE_CUA_MODELSconst arrayAvailableCuaModeltyperesolveModel()packages/core/lib/v3/agent/AgentProvider.tsmodelToAgentProviderMap:gpt-5.4-mini→openaigpt-5.5→openaiclaude-haiku-4-5→anthropicAgentProvider.getAgentProvider()resolves them correctlypackages/core/tests/unit/public-api/llm-and-agents.test.tsexpectedModelslist in the type-level test to stay in sync with the source of truthHow It Was Tested
pnpm turbo run build)flowlogger-eventstore.test.js(confirmed on base branch)Summary by cubic
Adds support for three new Computer Use Agent (CUA) models and maps them to the correct providers for proper runtime resolution.
openai/gpt-5.4-mini,openai/gpt-5.5, andanthropic/claude-haiku-4-5toAVAILABLE_CUA_MODELS.gpt-5.4-miniandgpt-5.5toopenai, andclaude-haiku-4-5toanthropicinmodelToAgentProviderMap.Written for commit 6905175. Summary will update on new commits. Review in cubic