feat(M3-002): implement AnthropicAdapter for Claude Sonnet 4.6, Opus 4.6, and Haiku 4.5 #309

Merged
jason.woltje merged 1 commits from feat/m3-anthropic-adapter into main 2026-03-21 21:33:56 +00:00
Owner

Summary

  • Adds implementing for the Anthropic provider
  • Installs as a gateway dependency
  • Registers claude-opus-4-6, claude-sonnet-4-6, and claude-haiku-4-5 with Pi ModelRegistry
  • Implements via lightweight call
  • Implements with full streaming via , mapping Anthropic events to format
  • Replaces the legacy inline in with the new adapter
  • Gracefully skips registration when is not set (logs warning, does not crash)

Test plan

  • All three quality gates pass: typecheck, lint, format:check (verified locally)
  • Adapter registers with set
  • Adapter skips registration and logs warning without API key
  • returns healthy/degraded/down based on API response
  • streams text_delta, tool_call, and done events

🤖 Generated with Claude Code

## Summary - Adds implementing for the Anthropic provider - Installs as a gateway dependency - Registers claude-opus-4-6, claude-sonnet-4-6, and claude-haiku-4-5 with Pi ModelRegistry - Implements via lightweight call - Implements with full streaming via , mapping Anthropic events to format - Replaces the legacy inline in with the new adapter - Gracefully skips registration when is not set (logs warning, does not crash) ## Test plan - [ ] All three quality gates pass: typecheck, lint, format:check (verified locally) - [ ] Adapter registers with set - [ ] Adapter skips registration and logs warning without API key - [ ] returns healthy/degraded/down based on API response - [ ] streams text_delta, tool_call, and done events 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jason.woltje added 1 commit 2026-03-21 21:30:53 +00:00
feat(M3-002): implement AnthropicAdapter for Claude Sonnet 4.6, Opus 4.6, and Haiku 4.5
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
63f285cc4f
Adds AnthropicAdapter implementing IProviderAdapter. Installs @anthropic-ai/sdk,
registers the three Claude models with the Pi ModelRegistry, implements healthCheck()
via client.models.list(), and createCompletion() with streaming via messages.stream().
Replaces the legacy inline registerAnthropicProvider() method in ProviderService.
Gracefully skips registration when ANTHROPIC_API_KEY is not set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jason.woltje force-pushed feat/m3-anthropic-adapter from 63f285cc4f to ca5c98cb0a 2026-03-21 21:33:44 +00:00 Compare
jason.woltje merged commit 5d4efb467c into main 2026-03-21 21:33:56 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#309