Skip to content

fix(provider): normalize dotted Anthropic model IDs for API-key paths#1732

Open
Alix-007 wants to merge 1 commit intosipeed:mainfrom
Alix-007:fix/anthropic-model-dot-normalization
Open

fix(provider): normalize dotted Anthropic model IDs for API-key paths#1732
Alix-007 wants to merge 1 commit intosipeed:mainfrom
Alix-007:fix/anthropic-model-dot-normalization

Conversation

@Alix-007
Copy link
Contributor

📝 Description

Normalize dotted Anthropic model IDs like claude-sonnet-4.6 to the API-accepted dashed form claude-sonnet-4-6 in the two API-key paths that were still forwarding the dotted value.

This fixes the API-key anthropic provider path and the native anthropic-messages request builder, and adds regression tests for both.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

Fixes #1624

📚 Technical Context (Skip for Docs)

🧪 Test Environment

  • Hardware: x86_64 PC
  • OS: NewStartOS V4.4.2-ZTE
  • Model/Provider: N/A (unit tests only)
  • Channels: N/A

📸 Evidence (Optional)

Click to view Logs/Screenshots
$ go test ./pkg/providers/...
ok   github.com/sipeed/picoclaw/pkg/providers
ok   github.com/sipeed/picoclaw/pkg/providers/anthropic
ok   github.com/sipeed/picoclaw/pkg/providers/anthropic_messages
ok   github.com/sipeed/picoclaw/pkg/providers/azure
ok   github.com/sipeed/picoclaw/pkg/providers/common
ok   github.com/sipeed/picoclaw/pkg/providers/openai_compat
$ go test ./pkg/providers/anthropic_messages
ok   github.com/sipeed/picoclaw/pkg/providers/anthropic_messages

go test ./... still fails in unrelated existing/environment-dependent areas (cmd/picoclaw, cmd/picoclaw/internal, cmd/picoclaw/internal/model, pkg/agent, pkg/auth, pkg/migrate/internal, pkg/tools) and was not changed in this PR.

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

@Alix-007 Alix-007 force-pushed the fix/anthropic-model-dot-normalization branch from fa25158 to a4f2201 Compare March 19, 2026 02: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(provider/anthropic): model ID dots not normalized to dashes in API-key and anthropic-messages paths

1 participant