Skip to content

Update Claude model lineup#1

Merged
anubissbe merged 1 commit intomainfrom
codex/update-code-to-use-specified-models
Oct 26, 2025
Merged

Update Claude model lineup#1
anubissbe merged 1 commit intomainfrom
codex/update-code-to-use-specified-models

Conversation

@anubissbe
Copy link
Owner

@anubissbe anubissbe commented Oct 26, 2025

Summary

  • replace the Anthropic model constants with the new Sonnet 4.5, Opus 4.1, Haiku 4.5, and Opus Plan Mode identifiers
  • update allowed model handling across the agent registry, CLI, pricing defaults, and analytics scripts to match the refreshed lineup
  • refresh dashboard chart colour mappings so the new model short names render consistently

Testing

  • bun run lint (fails: 403 when downloading biome)
  • bun run typecheck (fails: missing bun-types definitions in the environment)
  • bun run format (fails: 403 when downloading biome)

https://chatgpt.com/codex/tasks/task_e_68fe20204f0c833190165685c1a0c0da

Summary by Sourcery

Replace existing Claude model constants and defaults with the new Sonnet 4.5, Haiku 4.5, Opus 4.1 and Opus Plan Mode across the codebase

Enhancements:

  • Update pricing fallback configuration to use new Claude model identifiers
  • Extend CLI and TUI to validate and set new model short names
  • Introduce model alias mapping in AgentRegistry for shorthand names
  • Refresh analytics SQL and dashboard chart color mappings with updated model IDs

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 26, 2025

Reviewer's Guide

This PR replaces legacy Claude model constants (Haiku/Sonnet/Opus v3.5 and v4) with the new Sonnet 4.5, Haiku 4.5, Opus 4.1, and Opus Plan Mode identifiers across core configs, pricing, CLI, analytics, dashboard visuals, and agent registry to ensure consistent handling and display.

Entity relationship diagram for updated model pricing structure

erDiagram
    CLAUDE_MODEL_IDS {
        string HAIKU_4_5
        string SONNET_4_5
        string OPUS_4_1
        string OPUS_PLAN_MODE
    }
    BUNDLED_PRICING {
        string id
        string name
        float input
        float output
        float cache_read
        float cache_write
    }
    CLAUDE_MODEL_IDS ||--o| BUNDLED_PRICING : provides
    BUNDLED_PRICING {
        string model_id
    }
    CLAUDE_MODEL_IDS ||--o| BUNDLED_PRICING : "model_id"
Loading

Class diagram for updated Claude model constants and usage

classDiagram
    class CLAUDE_MODEL_IDS {
        +HAIKU_4_5: string
        +SONNET_4_5: string
        +OPUS_4_1: string
        +OPUS_PLAN_MODE: string
    }
    class MODEL_DISPLAY_NAMES {
        +"claude-4-5-haiku-20250107": "Claude Haiku 4.5"
        +"claude-sonnet-4-5-20250107": "Claude Sonnet 4.5"
        +"claude-opus-4-1-20250805": "Claude Opus 4.1"
        +"claude-opus-plan-mode-20250805": "Claude Opus Plan Mode"
    }
    class MODEL_SHORT_NAMES {
        +"claude-4.5-haiku": string
        +"claude-4.5-sonnet": string
        +"claude-opus-4.1": string
        +"claude-opus-plan": string
    }
    class ALLOWED_MODELS {
        +SONNET_4_5
        +OPUS_4_1
        +HAIKU_4_5
        +OPUS_PLAN_MODE
    }
    CLAUDE_MODEL_IDS <|-- MODEL_DISPLAY_NAMES
    CLAUDE_MODEL_IDS <|-- MODEL_SHORT_NAMES
    CLAUDE_MODEL_IDS <|-- ALLOWED_MODELS
Loading

Class diagram for AgentRegistry model alias handling

classDiagram
    class AgentRegistry {
        -cache: AgentCache | null
        -workspaces: Map<string, AgentWorkspace>
        +loadAgentFile(filePath: string): void
    }
    class MODEL_ALIASES {
        +opus: AllowedModel
        +"opus-plan": AllowedModel
        +sonnet: AllowedModel
        +haiku: AllowedModel
    }
    AgentRegistry --> MODEL_ALIASES : uses
Loading

File-Level Changes

Change Details Files
Revise Claude model constants, display names, short names, and defaults to the new lineup
  • Remove old Claude 3.5 and v4 identifiers
  • Add HAIKU_4_5, SONNET_4_5, and OPUS_PLAN_MODE constants
  • Update MODEL_DISPLAY_NAMES and MODEL_SHORT_NAMES entries
  • Set DEFAULT_MODEL and DEFAULT_AGENT_MODEL to SONNET_4_5
packages/core/src/models.ts
Update bundled fallback pricing to reflect new model IDs
  • Remove pricing entries for retired models
  • Add cost mappings for HAIKU_4_5, SONNET_4_5, OPUS_4_1, and OPUS_PLAN_MODE
packages/core/src/pricing.ts
Adjust CLI TUI command to validate and map new model shorthands
  • Replace modelMap keys with sonnet-4.5, haiku-4.5, opus-4.1, opus-plan
  • Dynamically list valid models in error output
apps/tui/src/main.ts
Introduce alias-based shorthand handling in AgentRegistry for new models
  • Define MODEL_ALIASES for opus, sonnet, haiku, opus-plan
  • Replace manual if/else with alias lookup
packages/agents/src/discovery.ts
Refresh analytics script to query P95 for the updated model
  • Update SQL params to use new claude-sonnet-4-5 identifier
packages/database/src/analyze-performance.ts
Refresh dashboard chart color mappings for new short names
  • Replace old short-name keys with new ones in MODEL_COLORS across charts
packages/dashboard-web/src/components/charts/ModelTokenSpeedChart.tsx
packages/dashboard-web/src/components/charts/ModelPerformanceComparison.tsx
packages/dashboard-web/src/components/charts/MultiModelChart.tsx
Update allowed model list in type definitions
  • Replace OPUS_4 and SONNET_4 with SONNET_4_5, HAIKU_4_5, OPUS_PLAN_MODE in ALLOWED_MODELS
packages/types/src/agent.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-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.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@anubissbe anubissbe merged commit 8052c0e into main Oct 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant