Skip to content

fix(ai-orchestrator): migrate from retired Claude 3.5 to active Claude 4.6 models#137

Merged
SteveJRobertson merged 2 commits into
mainfrom
136-migrate-claude-models
Jun 3, 2026
Merged

fix(ai-orchestrator): migrate from retired Claude 3.5 to active Claude 4.6 models#137
SteveJRobertson merged 2 commits into
mainfrom
136-migrate-claude-models

Conversation

@SteveJRobertson

Copy link
Copy Markdown
Owner

Summary

The Anthropic API retired all Claude 3.5 models (Sonnet, Haiku) in February 2026. This PR migrates the @isolate-a11y persona from the deprecated claude-3-5-sonnet-20241022 model to the active Claude 4.x model family, specifically claude-sonnet-4-6, resolving persistent 404 errors.

Closes #136

Changes

  • Type System: Updated AgentPersona.model type union from 'gpt-4o' | 'claude-3-5-sonnet' to 'gpt-4o' | 'claude-sonnet-4-6' | 'claude-sonnet-4-5' to support the new Claude 4.x model family
  • A11y Persona: Configured @isolate-a11y persona to use claude-sonnet-4-6 as the primary Anthropic model
  • Anthropic Client: Updated getAnthropicClient() initialization to use the stable claude-sonnet-4-6 identifier instead of the deprecated claude-3-5-sonnet-20241022
  • Model Routing: Fixed model switching logic in llm-persona-node.ts to correctly route both new Claude 4.x models to the Anthropic client
  • Unit Tests: Updated all test assertions in clients.spec.ts, personas.spec.ts, and llm-persona-node.spec.ts to expect claude-sonnet-4-6 instead of the retired model
  • Documentation: Updated .env.example and libs/ai-orchestrator/README.md to reference Claude 4.6 instead of Claude 3.5 Sonnet

Verification

✅ TypeScript compilation passes (pnpm nx typecheck ai-orchestrator)
✅ All 275 unit tests pass across 18 test files (pnpm nx test ai-orchestrator -- --run)
✅ Conventional commit format validated by commitlint
✅ Prettier code formatting applied

Copilot Review Triage

  • Blocker — No security/correctness issues; model type is safely scoped to Anthropic clients only
  • Major — All code paths updated; no edge cases introduced; type union handles both Claude 4.6 and 4.5
  • Minor — Full test coverage for new model identifiers; no missing error paths
  • Nit — Documentation synchronized with code; all references to Claude 3.5 removed

Deferred follow-ups

None. This is a minimal, surgical migration with no scope creep.

…e 4.6 models

- Update AgentPersona.model type union to 'claude-sonnet-4-6' | 'claude-sonnet-4-5'
- Set @isolate-a11y persona to use claude-sonnet-4-6 (primary model)
- Update Anthropic client initialization with stable 'claude-sonnet-4-6' identifier
- Fix model routing logic in llm-persona-node to handle both new Claude 4.x models
- Update all unit tests to expect claude-sonnet-4-6 instead of retired claude-3-5-sonnet
- Update documentation (.env.example, README.md) to reflect Claude 4.6 migration

Fixes #136: Resolves 404 errors from retired Claude 3.5 Sonnet model family (EOL Feb 2026)
Copilot AI review requested due to automatic review settings June 3, 2026 19:29
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
isolate-ui Ignored Ignored Preview Jun 3, 2026 7:38pm

Copilot AI left a comment

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.

Pull request overview

Migrates the ai-orchestrator Anthropic integration away from retired Claude 3.5 identifiers to the active Claude 4.x model family so the @isolate-a11y persona can successfully invoke Anthropic without 404s.

Changes:

  • Updated persona model typing and a11y persona configuration to use claude-sonnet-4-6 (and allow claude-sonnet-4-5 in the union).
  • Updated Anthropic client initialization to use claude-sonnet-4-6.
  • Updated orchestrator routing, unit tests, and docs/env examples to reflect the new Claude 4.6 identifiers.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
libs/ai-orchestrator/src/orchestrator/llm-persona-node.ts Routes Claude Sonnet 4.6/4.5 personas to the Anthropic client instead of the retired 3.5 model.
libs/ai-orchestrator/src/orchestrator/llm-persona-node.spec.ts Updates the routing test naming/expectations for the new Claude 4.6 model ID.
libs/ai-orchestrator/src/llm/clients.ts Switches the Anthropic client’s configured model to claude-sonnet-4-6.
libs/ai-orchestrator/src/agents/personas.ts Expands AgentPersona.model union for Claude 4.x and updates the a11y persona to 4.6.
libs/ai-orchestrator/src/tests/personas.spec.ts Updates persona model assertions to accept the new model strings and verifies a11y uses 4.6.
libs/ai-orchestrator/src/tests/clients.spec.ts Updates Anthropic client factory test to expect claude-sonnet-4-6.
libs/ai-orchestrator/README.md Updates documentation wording from Claude 3.5 to Claude 4.6.
.env.example Updates Anthropic env comment to reference Claude 4.6.

Comment thread libs/ai-orchestrator/src/llm/clients.ts
Comment thread libs/ai-orchestrator/src/orchestrator/llm-persona-node.ts Outdated
Comment thread libs/ai-orchestrator/src/orchestrator/llm-persona-node.spec.ts
… test coverage

- Replace chained || condition with ANTHROPIC_MODELS.includes() for better
  readability and extensibility when adding new Claude models
- Add explanatory comment in clients.ts documenting the current limitation:
  only claude-sonnet-4-6 is instantiated, but the type union allows both 4-6
  and 4-5 for future flexibility
- Add regression test for claude-sonnet-4-5 routing to ensure the ANTHROPIC_MODELS
  list is correctly checked, preventing breakage when personas use 4-5
@SteveJRobertson SteveJRobertson merged commit a9702aa into main Jun 3, 2026
6 checks passed
@SteveJRobertson SteveJRobertson deleted the 136-migrate-claude-models branch June 3, 2026 19:41
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.

fix: migrate from retired Claude 3.5 to active Claude 4.x models (resolve 404)

2 participants