Skip to content

[chore] update supported CUA models#2064

Merged
miguelg719 merged 2 commits intobrowserbase:contrib/2064from
chromiebot:chromie/chore-can-you-update-the-list-of-sup
Apr 29, 2026
Merged

[chore] update supported CUA models#2064
miguelg719 merged 2 commits intobrowserbase:contrib/2064from
chromiebot:chromie/chore-can-you-update-the-list-of-sup

Conversation

@chromiebot
Copy link
Copy Markdown
Contributor

@chromiebot chromiebot commented Apr 29, 2026

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-miniopenai
    • gpt-5.5openai
    • claude-haiku-4-5anthropic
  • 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)

Summary by cubic

Adds support for three new Computer Use Agent (CUA) models and maps them to the correct providers for proper runtime resolution.

  • New Features
    • Added openai/gpt-5.4-mini, openai/gpt-5.5, and anthropic/claude-haiku-4-5 to AVAILABLE_CUA_MODELS.
    • Mapped gpt-5.4-mini and gpt-5.5 to openai, and claude-haiku-4-5 to anthropic in modelToAgentProviderMap.
    • Updated public API tests to include the new models.

Written for commit 6905175. Summary will update on new commits. Review in cubic

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2026

⚠️ No Changeset found

Latest commit: 6905175

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Apr 29, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

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
Loading

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread packages/core/lib/v3/agent/AgentProvider.ts
@miguelg719 miguelg719 changed the title Chromie/chore can you update the list of sup [chore] update supported CUA models Apr 29, 2026
@miguelg719 miguelg719 changed the base branch from main to contrib/2064 April 29, 2026 18:20
@miguelg719 miguelg719 merged commit 19d5368 into browserbase:contrib/2064 Apr 29, 2026
4 checks passed
miguelg719 added a commit that referenced this pull request Apr 29, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants