Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,56 @@ import { Usage } from '@anthropic-ai/sdk/resources'
import { proxyConfig } from '../../proxyConfig'
import { ProxyAgent } from 'undici'

const OAUTH_MODEL_LIST = {
data: [
{
created_at: '2025-09-29T00:00:00Z',
display_name: 'Claude Sonnet 4.5',
id: 'claude-sonnet-4-5-20250929',
type: 'model'
},
{
created_at: '2025-05-14T00:00:00Z',
display_name: 'Claude Sonnet 4',
id: 'claude-sonnet-4-20250514',
type: 'model'
},
{
created_at: '2025-05-14T00:00:00Z',
display_name: 'Claude Opus 4',
id: 'claude-opus-4-20250514',
type: 'model'
},
{
created_at: '2025-02-19T00:00:00Z',
display_name: 'Claude 3.7 Sonnet',
id: 'claude-3-7-sonnet-20250219',
type: 'model'
},
{
created_at: '2024-10-22T00:00:00Z',
display_name: 'Claude 3.5 Sonnet',
id: 'claude-3-5-sonnet-20241022',
type: 'model'
},
{
created_at: '2024-10-22T00:00:00Z',
display_name: 'Claude 3.5 Haiku',
id: 'claude-3-5-haiku-20241022',
type: 'model'
},
{
created_at: '2024-06-20T00:00:00Z',
display_name: 'Claude 3.5 Sonnet (Legacy)',
id: 'claude-3-5-sonnet-20240620',
type: 'model'
}
],
first_id: 'claude-sonnet-4-5-20250929',
has_more: false,
last_id: 'claude-3-5-sonnet-20240620'
}
Comment on lines +19 to +67
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Add documentation and consider staleness of hardcoded model list.

The static OAUTH_MODEL_LIST introduces a maintenance burden as it requires manual updates when Anthropic releases new models or deprecates old ones. Consider:

  1. Add a comment explaining why OAuth mode uses a static list (e.g., API limitations, OAuth token restrictions)
  2. Add a comment with the last update date
  3. Document the process for keeping this list current

Apply this diff to add documentation:

+// Static model list for OAuth mode to avoid calling /v1/models API
+// OAuth tokens may have restricted access to the models endpoint
+// Last updated: 2025-10-14
+// TODO: Establish a process to keep this list synchronized with Anthropic's latest models
 const OAUTH_MODEL_LIST = {
   data: [

To verify the current model list is accurate and complete, please run:


🌐 Web query:

What are the latest Claude models available from Anthropic as of October 2025? Include model IDs and release dates.

💡 Result:

Here are Anthropic’s latest Claude models available as of October 14, 2025 (model ID — release date). Sources: Anthropic docs and Anthropic announcements. [1][2]

  • Claude Sonnet 4.5 — claude-sonnet-4-5-20250929 — September 29, 2025. [1][2]
  • Claude Opus 4.1 — claude-opus-4-1-20250805 — August 5, 2025. [1]
  • Claude Sonnet 4 — claude-sonnet-4-20250514 — May 14, 2025. [1]
  • Claude Opus 4 — claude-opus-4-20250514 — May 14, 2025. [1]
  • Claude Sonnet 3.7 — claude-3-7-sonnet-20250219 — February 19, 2025. [1]
  • Claude Haiku 3.5 — claude-3-5-haiku-20241022 — October 22, 2024. [1]

If you’d like, I can also list which of these are active vs. deprecated/retired per Anthropic’s deprecation schedule. [1][2]


Update static model list to reflect current Anthropic offerings.

  • Add claude-opus-4-1-20250805 /* Claude Opus 4.1 — Aug 5, 2025 */
  • Remove deprecated claude-3-5-sonnet-20240620 /* Legacy */
  • Add comment:
    // Static OAuth model list – last updated 2025-10-14
    // TODO: establish process to sync with Anthropic’s /v1/models endpoint
🤖 Prompt for AI Agents
In src/main/presenter/llmProviderPresenter/providers/anthropicProvider.ts around
lines 19 to 67, update the static OAUTH_MODEL_LIST: add a new model entry for
claude-opus-4-1-20250805 with created_at '2025-08-05T00:00:00Z', display_name
'Claude Opus 4.1' and type 'model'; remove the deprecated legacy entry with id
'claude-3-5-sonnet-20240620'; update first_id to the newest model id (e.g.,
'claude-sonnet-4-5-20250929' remains or set to the actual newest if you insert a
newer one) and set last_id to the new last model id (e.g.,
'claude-3-5-haiku-20241022'); and add the two comment lines at the top of the
block: "// Static OAuth model list – last updated 2025-10-14" and "// TODO:
establish process to sync with Anthropic’s /v1/models endpoint".


export class AnthropicProvider extends BaseLLMProvider {
private anthropic!: Anthropic
private oauthToken?: string
Expand Down Expand Up @@ -121,8 +171,8 @@ export class AnthropicProvider extends BaseLLMProvider {
let models: any

if (this.isOAuthMode) {
// OAuth mode: use direct HTTP request
models = await this.makeOAuthRequest('/v1/models', 'GET')
// OAuth mode: use predefined model list to avoid API calls
models = OAUTH_MODEL_LIST
} else {
// API Key mode: use SDK
models = await this.anthropic.models.list()
Expand Down