Skip to content

feat(providers): add Claude Opus 4.8 model#4771

Merged
waleedlatif1 merged 2 commits into
stagingfrom
waleedlatif1/add-opus-4-8-model
May 28, 2026
Merged

feat(providers): add Claude Opus 4.8 model#4771
waleedlatif1 merged 2 commits into
stagingfrom
waleedlatif1/add-opus-4-8-model

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Add claude-opus-4-8 to Anthropic provider models with $5/$0.50/$25 pricing, 1M context, 128k max output, adaptive thinking (effort: low/medium/high/xhigh/max, default high), and nativeStructuredOutputs
  • Swap recommended: true from Opus 4.7 to Opus 4.8 (new flagship per Anthropic docs)
  • Extend supportsAdaptiveThinking() in anthropic/core.ts to match opus-4-8 — without this the request would route to budget_tokens, which the Opus 4.8 API rejects with a 400

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
Copy Markdown

vercel Bot commented May 28, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 28, 2026 6:13pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 28, 2026

PR Summary

Medium Risk
Incorrect thinking payload routing would cause 400s for Opus 4.8 runs; the change is small but sits on the Anthropic request path.

Overview
Adds claude-opus-4-8 to the Anthropic model catalog (pricing, 1M context, 128k max output, adaptive thinking levels including xhigh/max, native structured outputs) and marks it as the recommended Opus flagship instead of 4.7.

Updates supportsAdaptiveThinking() in anthropic/core.ts so Opus 4.8 uses adaptive thinking with effort—not budget_tokens extended thinking, which the API rejects with a 400.

Reviewed by Cursor Bugbot for commit 1183424. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Greptile Summary

This PR adds claude-opus-4-8 as a new Anthropic provider model and promotes it to recommended, replacing Opus 4.7. It also extends supportsAdaptiveThinking() in core.ts to recognise the new model so it routes to adaptive thinking rather than the unsupported budget_tokens path.

  • models.ts: New claude-opus-4-8 entry with $5/$0.5/$25 pricing, 1M context window, 128k max output, adaptive thinking levels [low, medium, high, xhigh, max], and recommended: true; recommended removed from Opus 4.7.
  • core.ts: Two new includes checks (opus-4-8 and opus-4.8) added to supportsAdaptiveThinking(), matching the dual-pattern convention used for every other model in the function; JSDoc updated to list Opus 4.8 alongside Opus 4.7.

Confidence Score: 5/5

Safe to merge — adds a new model entry and a two-line guard in a routing function, with no changes to existing paths.

Both changed files are purely additive: the model definition in models.ts follows the exact same shape as Opus 4.7, and the two new pattern checks in supportsAdaptiveThinking() mirror the dual-format convention already used for every other model. No existing behaviour is altered.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/providers/anthropic/core.ts Extends supportsAdaptiveThinking() with dual-pattern checks for opus-4-8/opus-4.8, consistent with existing patterns for other models; JSDoc updated to match.
apps/sim/providers/models.ts Adds claude-opus-4-8 model entry with $5/$0.5/$25 pricing, 1M context, 128k max output, adaptive thinking levels, and recommended:true; removes recommended from Opus 4.7.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[API Request with modelId] --> B{supportsAdaptiveThinking?}
    B -- "includes opus-4-8 / opus-4.8\nincludes opus-4-7 / opus-4.7\nincludes opus-4-6 / opus-4.6\nincludes sonnet-4-6 / sonnet-4.6" --> C[thinking: adaptive\noutputConfig: effort=level]
    B -- other models --> D{budgetTokens defined?}
    D -- yes --> E[thinking: enabled\nbudget_tokens: N]
    D -- no --> F[return null / no thinking]
Loading

Reviews (2): Last reviewed commit: "chore(providers): update buildThinkingCo..." | Re-trigger Greptile

Comment thread apps/sim/providers/anthropic/core.ts
@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/add-opus-4-8-model branch from 7cae182 to 1183424 Compare May 28, 2026 18:12
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 1183424. Configure here.

@waleedlatif1 waleedlatif1 merged commit a693a1e into staging May 28, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/add-opus-4-8-model branch May 28, 2026 18:24
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.

1 participant