Skip to content

feat: adding Opus 4.6 to model list for computer use#1665

Open
Kylejeong2 wants to merge 1 commit intomainfrom
kylejeong/stg-1319-add-opus-46-to-computer-use-model-list
Open

feat: adding Opus 4.6 to model list for computer use#1665
Kylejeong2 wants to merge 1 commit intomainfrom
kylejeong/stg-1319-add-opus-46-to-computer-use-model-list

Conversation

@Kylejeong2
Copy link
Member

@Kylejeong2 Kylejeong2 commented Feb 5, 2026

why

opus 4.6 is sota on os world for computer use

what changed

enabled it on list of models

test plan


Summary by cubic

Added Claude Opus 4.6 to the computer use model list to make it available for agents. Mapped it to the Anthropic provider and updated public API types and tests.

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

@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2026

⚠️ No Changeset found

Latest commit: cf0ff38

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

Copy link
Contributor

@shrey150 shrey150 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
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.

3 issues found across 3 files

Confidence score: 3/5

  • There is a concrete policy violation: hardcoded allow-lists of LLM model names were extended, which can block valid provider/model combinations and cause user-facing failures.
  • Severity is medium-high (7/10) across multiple files, so there is some risk until the model-acceptance logic is made more flexible per the rule.
  • Pay close attention to packages/core/lib/v3/agent/AgentProvider.ts, packages/core/lib/v3/types/public/agent.ts, packages/core/tests/public-api/llm-and-agents.test.ts - hardcoded model allow-list expansion.
Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/core/tests/public-api/llm-and-agents.test.ts">

<violation number="1" location="packages/core/tests/public-api/llm-and-agents.test.ts:29">
P1: Rule violated: **Ensure we never check against hardcoded lists of allowed LLM model names**

This change extends a hardcoded allow-list of LLM model names. The rule (“Ensure we never check against hardcoded lists of allowed LLM model names”) forbids adding or updating such lists, even in tests. Please refactor the test to avoid asserting against a fixed model-name list (e.g., validate provider/model-name format or defer to provider validation) instead of enumerating specific models.</violation>
</file>

<file name="packages/core/lib/v3/types/public/agent.ts">

<violation number="1" location="packages/core/lib/v3/types/public/agent.ts:374">
P1: Rule violated: **Ensure we never check against hardcoded lists of allowed LLM model names**

Avoid extending hardcoded allowlists of LLM model names. The rule requires accepting any provider/model-name instead of adding more entries to lists like AVAILABLE_CUA_MODELS; please replace this allowlist-based check with validation that does not hardcode model names (unless explicitly blocking known-bad models).</violation>
</file>

<file name="packages/core/lib/v3/agent/AgentProvider.ts">

<violation number="1" location="packages/core/lib/v3/agent/AgentProvider.ts:23">
P1: Rule violated: **Ensure we never check against hardcoded lists of allowed LLM model names**

This change adds a hardcoded allowed model name to the model-to-provider map, violating the rule to avoid hardcoded lists of allowed LLM models. Update the logic to accept any model name (preferably provider/model-name) and let the provider validate availability instead.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant User as Client/Test
    participant API as Public API (AVAILABLE_CUA_MODELS)
    participant Map as AgentProvider (modelToAgentProviderMap)
    participant Anthropic as Anthropic Provider
    participant LLM as Claude Opus 4.6 (External)

    Note over User,LLM: Runtime Model Resolution Flow

    User->>API: Initialize Agent with model: "anthropic/claude-opus-4-6"
    
    API->>API: Validate against AVAILABLE_CUA_MODELS
    
    alt NEW: Model exists in list
        API-->>User: Validation Success
    else Model not in list
        API-->>User: Throw Error
    end

    User->>Map: Get Provider for "claude-opus-4-6"
    
    Note right of Map: NEW: Map "claude-opus-4-6" -> "anthropic"
    Map-->>User: Return AgentProviderType.anthropic

    User->>Anthropic: Request Computer Use action
    Anthropic->>LLM: POST /v1/messages (model: "claude-opus-4-6")
    
    Note over Anthropic,LLM: Includes computer-use tool definitions
    
    LLM-->>Anthropic: Action (mouse/keyboard/click)
    Anthropic-->>User: Execute Action in Browser

    Note over User,Map: Tests verify model presence in both list and map class definitions.
Loading

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

"openai/computer-use-preview-2025-03-11",
"anthropic/claude-3-7-sonnet-latest",
"anthropic/claude-opus-4-5-20251101",
"anthropic/claude-opus-4-6",
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 5, 2026

Choose a reason for hiding this comment

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

P1: Rule violated: Ensure we never check against hardcoded lists of allowed LLM model names

This change extends a hardcoded allow-list of LLM model names. The rule (“Ensure we never check against hardcoded lists of allowed LLM model names”) forbids adding or updating such lists, even in tests. Please refactor the test to avoid asserting against a fixed model-name list (e.g., validate provider/model-name format or defer to provider validation) instead of enumerating specific models.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/core/tests/public-api/llm-and-agents.test.ts, line 29:

<comment>This change extends a hardcoded allow-list of LLM model names. The rule (“Ensure we never check against hardcoded lists of allowed LLM model names”) forbids adding or updating such lists, even in tests. Please refactor the test to avoid asserting against a fixed model-name list (e.g., validate provider/model-name format or defer to provider validation) instead of enumerating specific models.</comment>

<file context>
@@ -26,6 +26,7 @@ describe("LLM and Agents public API types", () => {
       "openai/computer-use-preview-2025-03-11",
       "anthropic/claude-3-7-sonnet-latest",
       "anthropic/claude-opus-4-5-20251101",
+      "anthropic/claude-opus-4-6",
       "anthropic/claude-haiku-4-5-20251001",
       "anthropic/claude-sonnet-4-20250514",
</file context>
Fix with Cubic

"openai/computer-use-preview-2025-03-11",
"anthropic/claude-3-7-sonnet-latest",
"anthropic/claude-opus-4-5-20251101",
"anthropic/claude-opus-4-6",
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 5, 2026

Choose a reason for hiding this comment

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

P1: Rule violated: Ensure we never check against hardcoded lists of allowed LLM model names

Avoid extending hardcoded allowlists of LLM model names. The rule requires accepting any provider/model-name instead of adding more entries to lists like AVAILABLE_CUA_MODELS; please replace this allowlist-based check with validation that does not hardcode model names (unless explicitly blocking known-bad models).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/core/lib/v3/types/public/agent.ts, line 374:

<comment>Avoid extending hardcoded allowlists of LLM model names. The rule requires accepting any provider/model-name instead of adding more entries to lists like AVAILABLE_CUA_MODELS; please replace this allowlist-based check with validation that does not hardcode model names (unless explicitly blocking known-bad models).</comment>

<file context>
@@ -371,6 +371,7 @@ export const AVAILABLE_CUA_MODELS = [
   "openai/computer-use-preview-2025-03-11",
   "anthropic/claude-3-7-sonnet-latest",
   "anthropic/claude-opus-4-5-20251101",
+  "anthropic/claude-opus-4-6",
   "anthropic/claude-haiku-4-5-20251001",
   "anthropic/claude-sonnet-4-20250514",
</file context>
Fix with Cubic

"claude-sonnet-4-20250514": "anthropic",
"claude-sonnet-4-5-20250929": "anthropic",
"claude-opus-4-5-20251101": "anthropic",
"claude-opus-4-6": "anthropic",
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 5, 2026

Choose a reason for hiding this comment

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

P1: Rule violated: Ensure we never check against hardcoded lists of allowed LLM model names

This change adds a hardcoded allowed model name to the model-to-provider map, violating the rule to avoid hardcoded lists of allowed LLM models. Update the logic to accept any model name (preferably provider/model-name) and let the provider validate availability instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/core/lib/v3/agent/AgentProvider.ts, line 23:

<comment>This change adds a hardcoded allowed model name to the model-to-provider map, violating the rule to avoid hardcoded lists of allowed LLM models. Update the logic to accept any model name (preferably provider/model-name) and let the provider validate availability instead.</comment>

<file context>
@@ -20,6 +20,7 @@ export const modelToAgentProviderMap: Record<string, AgentProviderType> = {
   "claude-sonnet-4-20250514": "anthropic",
   "claude-sonnet-4-5-20250929": "anthropic",
   "claude-opus-4-5-20251101": "anthropic",
+  "claude-opus-4-6": "anthropic",
   "claude-haiku-4-5-20251001": "anthropic",
   "gemini-2.5-computer-use-preview-10-2025": "google",
</file context>
Fix with Cubic

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

This PR adds support for Anthropic's Claude Opus 4.6 model to the computer use agent functionality.

Changes:

  • Added claude-opus-4-6 to modelToAgentProviderMap in AgentProvider.ts:23
  • Added anthropic/claude-opus-4-6 to the AVAILABLE_CUA_MODELS array in agent.ts:374
  • Updated test expectations in llm-and-agents.test.ts:29 to include the new model

Notes:

  • The model naming pattern claude-opus-4-6 differs from other Anthropic models which include date suffixes (e.g., claude-opus-4-5-20251101). Verify this is the official model identifier from Anthropic.

Confidence Score: 4/5

  • This PR is safe to merge pending verification of the model identifier.
  • The changes are straightforward and consistent across all required files. The only concern is the model naming inconsistency compared to other Anthropic models, which should be verified against Anthropic's official documentation.
  • Verify that claude-opus-4-6 is the correct model identifier in packages/core/lib/v3/agent/AgentProvider.ts:23

Sequence Diagram

sequenceDiagram
    participant User
    participant Stagehand
    participant AgentProvider
    participant AnthropicCUAClient
    participant Anthropic API

    User->>Stagehand: agent({mode: "cua", model: "anthropic/claude-opus-4-6"})
    Stagehand->>AgentProvider: getClient("claude-opus-4-6")
    AgentProvider->>AgentProvider: getAgentProvider("claude-opus-4-6")
    Note over AgentProvider: Looks up "claude-opus-4-6" in<br/>modelToAgentProviderMap
    AgentProvider->>AgentProvider: Returns "anthropic"
    AgentProvider->>AnthropicCUAClient: new AnthropicCUAClient(...)
    AnthropicCUAClient-->>AgentProvider: client instance
    AgentProvider-->>Stagehand: agent client
    Stagehand-->>User: agent instance
    
    User->>Stagehand: agent.execute({instruction: "..."})
    Stagehand->>AnthropicCUAClient: execute(...)
    AnthropicCUAClient->>Anthropic API: API call with claude-opus-4-6
    Anthropic API-->>AnthropicCUAClient: response
    AnthropicCUAClient-->>Stagehand: AgentResult
    Stagehand-->>User: result
Loading

Copy link
Contributor

@greptile-apps greptile-apps 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 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

"claude-sonnet-4-20250514": "anthropic",
"claude-sonnet-4-5-20250929": "anthropic",
"claude-opus-4-5-20251101": "anthropic",
"claude-opus-4-6": "anthropic",
Copy link
Contributor

Choose a reason for hiding this comment

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

Check that claude-opus-4-6 is the official model identifier from Anthropic's API. All other Claude models include date suffixes (e.g., claude-opus-4-5-20251101), but this one doesn't follow the pattern.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/core/lib/v3/agent/AgentProvider.ts
Line: 23:23

Comment:
Check that `claude-opus-4-6` is the official model identifier from Anthropic's API. All other Claude models include date suffixes (e.g., `claude-opus-4-5-20251101`), but this one doesn't follow the pattern.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants