From 489a1122d5a0275c4569d1e3ac13739cd13cbe96 Mon Sep 17 00:00:00 2001 From: Pavel Anni Date: Mon, 16 Mar 2026 10:57:32 -0400 Subject: [PATCH] test(provider/anthropic): add test for dotted model ID normalization Cover the dot-to-dash normalization in anthropic_messages.buildRequestBody with a regression test, as suggested in PR review. Assisted-By: Claude (Anthropic AI) Signed-off-by: Pavel Anni --- .../anthropic_messages/provider_test.go | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkg/providers/anthropic_messages/provider_test.go b/pkg/providers/anthropic_messages/provider_test.go index da4213e92..b64940957 100644 --- a/pkg/providers/anthropic_messages/provider_test.go +++ b/pkg/providers/anthropic_messages/provider_test.go @@ -179,6 +179,26 @@ func TestBuildRequestBody(t *testing.T) { }, }, }, + { + name: "dotted model ID is normalized to dashes", + messages: []Message{ + {Role: "user", Content: "Hi"}, + }, + model: "claude-sonnet-4.6", + options: map[string]any{ + "max_tokens": 1024, + }, + want: map[string]any{ + "model": "claude-sonnet-4-6", + "max_tokens": int64(1024), + "messages": []any{ + map[string]any{ + "role": "user", + "content": "Hi", + }, + }, + }, + }, } for _, tt := range tests {