From f666dc601cd83fbdde0f2f8fdc61114509d0a0cf Mon Sep 17 00:00:00 2001 From: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Date: Tue, 28 Jul 2026 16:23:27 +0200 Subject: [PATCH] fix(ai): replace retired Claude model defaults - providers.py: claude-sonnet-4-20250514 (deprecated, retires Jun 2026) -> claude-sonnet-5 - constants.ts: anthropic/claude-3.5-sonnet (retired Oct 2025 on OpenRouter) -> anthropic/claude-sonnet-5 (verified against OpenRouter's live model list) - test fixtures updated to match Co-Authored-By: Claude Fable 5 --- agents/research-agent/src/providers.py | 2 +- lib/constants.ts | 2 +- tests/__tests__/lib/llm-client.test.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/agents/research-agent/src/providers.py b/agents/research-agent/src/providers.py index 5c81c7e2..10a760cf 100644 --- a/agents/research-agent/src/providers.py +++ b/agents/research-agent/src/providers.py @@ -30,7 +30,7 @@ class ProviderConfig: # Default models per provider DEFAULT_MODELS = { - Provider.ANTHROPIC: "claude-sonnet-4-20250514", + Provider.ANTHROPIC: "claude-sonnet-5", Provider.GROQ: "llama-3.1-70b-versatile", Provider.OLLAMA: "phi3", # Small, fast, works on most machines } diff --git a/lib/constants.ts b/lib/constants.ts index 2ada6b55..a6012d40 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -55,7 +55,7 @@ export const API_CONFIG = { // OpenRouter OPENROUTER_API_URL: 'https://openrouter.ai/api/v1/chat/completions', - OPENROUTER_DEFAULT_MODEL: 'anthropic/claude-3.5-sonnet', + OPENROUTER_DEFAULT_MODEL: 'anthropic/claude-sonnet-5', // Token limits MAX_CONTEXT_CHARS: 8000, diff --git a/tests/__tests__/lib/llm-client.test.ts b/tests/__tests__/lib/llm-client.test.ts index 21b15578..1fb2afc1 100644 --- a/tests/__tests__/lib/llm-client.test.ts +++ b/tests/__tests__/lib/llm-client.test.ts @@ -6,7 +6,7 @@ jest.mock('@/lib/constants', () => ({ GROQ_API_URL: 'https://api.groq.com/openai/v1/chat/completions', GROQ_MODEL: 'llama-3.1-8b-instant', OPENROUTER_API_URL: 'https://openrouter.ai/api/v1/chat/completions', - OPENROUTER_DEFAULT_MODEL: 'anthropic/claude-3.5-sonnet', + OPENROUTER_DEFAULT_MODEL: 'anthropic/claude-sonnet-5', }, })); @@ -162,10 +162,10 @@ describe('generateLLMResponse', () => { expect(mockFetch).toHaveBeenCalledWith( 'https://openrouter.ai/api/v1/chat/completions', expect.objectContaining({ - body: expect.stringContaining('"model":"anthropic/claude-3.5-sonnet"'), + body: expect.stringContaining('"model":"anthropic/claude-sonnet-5"'), }), ); - expect(result.model).toBe('anthropic/claude-3.5-sonnet'); + expect(result.model).toBe('anthropic/claude-sonnet-5'); }); it('uses custom model when specified', async () => {