Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

added claude opus 4.5

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Nov 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Nov 24, 2025 8:10pm

@waleedlatif1 waleedlatif1 merged commit a5b7897 into staging Nov 24, 2025
5 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/models branch November 24, 2025 20:12
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 24, 2025

Greptile Overview

Greptile Summary

Added Claude Opus 4.5 model support with pricing and configuration. However, there is a critical model ID mismatch that will cause runtime failures.

Key Changes:

  • Added claude-opus-4-5 model definition in providers/models.ts with pricing ($5 input, $25 output per 1M tokens)
  • Added claude-4.5-opus to UI dropdown in constants.ts

Critical Issue:
The UI uses claude-4.5-opus while the provider definition uses claude-opus-4-5. The model lookup system in providers/utils.ts:188-189 normalizes model names to lowercase and looks them up in the provider map. Since these IDs don't match, the model won't be found, causing the system to fall back to ollama provider, which will result in runtime errors.

Required Fixes:

  1. Change UI constant value from claude-4.5-opus to claude-opus-4-5
  2. Add claude-opus-4-5 to the model enum in apps/sim/app/api/copilot/chat/route.ts:58
  3. Add claude-opus-4-5 to type definitions in apps/sim/lib/copilot/api.ts:87 and apps/sim/stores/panel/copilot/types.ts:81

Confidence Score: 1/5

  • This PR contains a critical bug that will cause runtime failures when users select Claude 4.5 Opus
  • The model ID mismatch between UI (claude-4.5-opus) and provider definition (claude-opus-4-5) will cause the model lookup to fail, resulting in fallback to wrong provider and runtime errors. This is a blocking issue that must be fixed before merge.
  • Pay critical attention to apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/constants.ts - the model ID must match the provider definition

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/providers/models.ts 4/5 added claude-opus-4-5 model definition with pricing ($5 input, $25 output per 1M tokens) and capabilities (temp 0-1, 200k context), but model ID doesn't match UI constant
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/constants.ts 1/5 added claude-4.5-opus to UI dropdown, but uses incorrect model ID that doesn't match provider definition

Sequence Diagram

sequenceDiagram
    participant User
    participant UI as Copilot UI
    participant API as /api/copilot/chat
    participant Provider as Provider Utils
    participant Anthropic as Anthropic Provider
    
    User->>UI: Select "Claude 4.5 Opus"
    UI->>UI: Sets model = "claude-4.5-opus"
    User->>UI: Send message
    UI->>API: POST with model="claude-4.5-opus"
    API->>API: Validate against enum
    Note over API: ❌ Missing "claude-opus-4-5" in enum
    API->>Provider: getProviderFromModel("claude-4.5-opus")
    Provider->>Provider: Normalize to lowercase
    Provider->>Provider: Lookup in getAllModelProviders()
    Note over Provider: ❌ Model ID mismatch:<br/>UI: "claude-4.5-opus"<br/>Provider: "claude-opus-4-5"
    Provider-->>API: ❌ Model not found, fallback to ollama
    API->>Anthropic: ❌ Wrong provider selected
    Anthropic-->>User: ❌ Runtime error
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.

Additional Comments (1)

  1. apps/sim/app/api/copilot/chat/route.ts, line 58 (link)

    logic: missing claude-opus-4-5 in enum (use the provider model ID, not the UI label)

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

// { value: 'claude-4-sonnet', label: 'Claude 4 Sonnet' },
{ value: 'claude-4.5-sonnet', label: 'Claude 4.5 Sonnet' },
{ value: 'claude-4.5-haiku', label: 'Claude 4.5 Haiku' },
{ value: 'claude-4.5-opus', label: 'Claude 4.5 Opus' },
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: model ID mismatch: UI uses claude-4.5-opus but provider definition uses claude-opus-4-5 (models.ts:592). This will cause model lookups to fail.

Suggested change
{ value: 'claude-4.5-opus', label: 'Claude 4.5 Opus' },
{ value: 'claude-opus-4-5', label: 'Claude 4.5 Opus' },
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/constants.ts
Line: 26:26

Comment:
**logic:** model ID mismatch: UI uses `claude-4.5-opus` but provider definition uses `claude-opus-4-5` (models.ts:592). This will cause model lookups to fail.

```suggestion
  { value: 'claude-opus-4-5', label: 'Claude 4.5 Opus' },
```

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