mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
chore: update Claude model references to claude-sonnet-4.6
Replace all claude-sonnet-4 references with claude-sonnet-4.6 across codebase including documentation, tests, and configuration examples. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -350,7 +350,7 @@ type OpenAIProviderConfig struct {
|
||||
type ModelConfig struct {
|
||||
// Required fields
|
||||
ModelName string `json:"model_name"` // User-facing alias for the model
|
||||
Model string `json:"model"` // Protocol/model-identifier (e.g., "openai/gpt-4o", "anthropic/claude-sonnet-4")
|
||||
Model string `json:"model"` // Protocol/model-identifier (e.g., "openai/gpt-4o", "anthropic/claude-sonnet-4.6")
|
||||
|
||||
// HTTP-based providers
|
||||
APIBase string `json:"api_base,omitempty"` // API endpoint URL
|
||||
|
||||
@@ -113,8 +113,8 @@ func DefaultConfig() *Config {
|
||||
|
||||
// Anthropic Claude - https://console.anthropic.com/settings/keys
|
||||
{
|
||||
ModelName: "claude-sonnet-4",
|
||||
Model: "anthropic/claude-sonnet-4-20250514",
|
||||
ModelName: "claude-sonnet-4.6",
|
||||
Model: "anthropic/claude-sonnet-4.6",
|
||||
APIBase: "https://api.anthropic.com/v1",
|
||||
APIKey: "",
|
||||
},
|
||||
|
||||
@@ -78,7 +78,7 @@ func ConvertProvidersToModelList(cfg *Config) []ModelConfig {
|
||||
}
|
||||
return ModelConfig{
|
||||
ModelName: "anthropic",
|
||||
Model: "anthropic/claude-sonnet-4",
|
||||
Model: "anthropic/claude-sonnet-4.6",
|
||||
APIKey: p.Anthropic.APIKey,
|
||||
APIBase: p.Anthropic.APIBase,
|
||||
Proxy: p.Anthropic.Proxy,
|
||||
|
||||
@@ -58,8 +58,8 @@ func TestConvertProvidersToModelList_Anthropic(t *testing.T) {
|
||||
if result[0].ModelName != "anthropic" {
|
||||
t.Errorf("ModelName = %q, want %q", result[0].ModelName, "anthropic")
|
||||
}
|
||||
if result[0].Model != "anthropic/claude-sonnet-4" {
|
||||
t.Errorf("Model = %q, want %q", result[0].Model, "anthropic/claude-sonnet-4")
|
||||
if result[0].Model != "anthropic/claude-sonnet-4.6" {
|
||||
t.Errorf("Model = %q, want %q", result[0].Model, "anthropic/claude-sonnet-4.6")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,9 +513,9 @@ func TestBuildModelWithProtocol_AlreadyHasPrefix(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestBuildModelWithProtocol_DifferentPrefix(t *testing.T) {
|
||||
result := buildModelWithProtocol("anthropic", "openrouter/claude-sonnet-4")
|
||||
if result != "openrouter/claude-sonnet-4" {
|
||||
t.Errorf("buildModelWithProtocol(anthropic, openrouter/claude-sonnet-4) = %q, want %q", result, "openrouter/claude-sonnet-4")
|
||||
result := buildModelWithProtocol("anthropic", "openrouter/claude-sonnet-4.6")
|
||||
if result != "openrouter/claude-sonnet-4.6" {
|
||||
t.Errorf("buildModelWithProtocol(anthropic, openrouter/claude-sonnet-4.6) = %q, want %q", result, "openrouter/claude-sonnet-4.6")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ func (p *Provider) Chat(ctx context.Context, messages []Message, tools []ToolDef
|
||||
}
|
||||
|
||||
func (p *Provider) GetDefaultModel() string {
|
||||
return "claude-sonnet-4-5-20250929"
|
||||
return "claude-sonnet-4.6"
|
||||
}
|
||||
|
||||
func (p *Provider) BaseURL() string {
|
||||
|
||||
@@ -15,14 +15,14 @@ func TestBuildParams_BasicMessage(t *testing.T) {
|
||||
messages := []Message{
|
||||
{Role: "user", Content: "Hello"},
|
||||
}
|
||||
params, err := buildParams(messages, nil, "claude-sonnet-4-5-20250929", map[string]interface{}{
|
||||
params, err := buildParams(messages, nil, "claude-sonnet-4.6", map[string]interface{}{
|
||||
"max_tokens": 1024,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("buildParams() error: %v", err)
|
||||
}
|
||||
if string(params.Model) != "claude-sonnet-4-5-20250929" {
|
||||
t.Errorf("Model = %q, want %q", params.Model, "claude-sonnet-4-5-20250929")
|
||||
if string(params.Model) != "claude-sonnet-4.6" {
|
||||
t.Errorf("Model = %q, want %q", params.Model, "claude-sonnet-4.6")
|
||||
}
|
||||
if params.MaxTokens != 1024 {
|
||||
t.Errorf("MaxTokens = %d, want 1024", params.MaxTokens)
|
||||
@@ -37,7 +37,7 @@ func TestBuildParams_SystemMessage(t *testing.T) {
|
||||
{Role: "system", Content: "You are helpful"},
|
||||
{Role: "user", Content: "Hi"},
|
||||
}
|
||||
params, err := buildParams(messages, nil, "claude-sonnet-4-5-20250929", map[string]interface{}{})
|
||||
params, err := buildParams(messages, nil, "claude-sonnet-4.6", map[string]interface{}{})
|
||||
if err != nil {
|
||||
t.Fatalf("buildParams() error: %v", err)
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func TestBuildParams_ToolCallMessage(t *testing.T) {
|
||||
},
|
||||
{Role: "tool", Content: `{"temp": 72}`, ToolCallID: "call_1"},
|
||||
}
|
||||
params, err := buildParams(messages, nil, "claude-sonnet-4-5-20250929", map[string]interface{}{})
|
||||
params, err := buildParams(messages, nil, "claude-sonnet-4.6", map[string]interface{}{})
|
||||
if err != nil {
|
||||
t.Fatalf("buildParams() error: %v", err)
|
||||
}
|
||||
@@ -94,7 +94,7 @@ func TestBuildParams_WithTools(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
params, err := buildParams([]Message{{Role: "user", Content: "Hi"}}, tools, "claude-sonnet-4-5-20250929", map[string]interface{}{})
|
||||
params, err := buildParams([]Message{{Role: "user", Content: "Hi"}}, tools, "claude-sonnet-4.6", map[string]interface{}{})
|
||||
if err != nil {
|
||||
t.Fatalf("buildParams() error: %v", err)
|
||||
}
|
||||
@@ -178,7 +178,7 @@ func TestProvider_ChatRoundTrip(t *testing.T) {
|
||||
|
||||
provider := NewProviderWithClient(createAnthropicTestClient(server.URL, "test-token"))
|
||||
messages := []Message{{Role: "user", Content: "Hello"}}
|
||||
resp, err := provider.Chat(t.Context(), messages, nil, "claude-sonnet-4-5-20250929", map[string]interface{}{"max_tokens": 1024})
|
||||
resp, err := provider.Chat(t.Context(), messages, nil, "claude-sonnet-4.6", map[string]interface{}{"max_tokens": 1024})
|
||||
if err != nil {
|
||||
t.Fatalf("Chat() error: %v", err)
|
||||
}
|
||||
@@ -195,8 +195,8 @@ func TestProvider_ChatRoundTrip(t *testing.T) {
|
||||
|
||||
func TestProvider_GetDefaultModel(t *testing.T) {
|
||||
p := NewProvider("test-token")
|
||||
if got := p.GetDefaultModel(); got != "claude-sonnet-4-5-20250929" {
|
||||
t.Errorf("GetDefaultModel() = %q, want %q", got, "claude-sonnet-4-5-20250929")
|
||||
if got := p.GetDefaultModel(); got != "claude-sonnet-4.6" {
|
||||
t.Errorf("GetDefaultModel() = %q, want %q", got, "claude-sonnet-4.6")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ func TestProvider_ChatUsesTokenSource(t *testing.T) {
|
||||
return "refreshed-token", nil
|
||||
}, server.URL)
|
||||
|
||||
_, err := p.Chat(t.Context(), []Message{{Role: "user", Content: "hello"}}, nil, "claude-sonnet-4-5-20250929", map[string]interface{}{})
|
||||
_, err := p.Chat(t.Context(), []Message{{Role: "user", Content: "hello"}}, nil, "claude-sonnet-4.6", map[string]interface{}{})
|
||||
if err != nil {
|
||||
t.Fatalf("Chat() error: %v", err)
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ func TestChat_PassesModelFlag(t *testing.T) {
|
||||
|
||||
_, err := p.Chat(context.Background(), []Message{
|
||||
{Role: "user", Content: "Hi"},
|
||||
}, nil, "claude-sonnet-4-5-20250929", nil)
|
||||
}, nil, "claude-sonnet-4.6", nil)
|
||||
if err != nil {
|
||||
t.Fatalf("Chat() error = %v", err)
|
||||
}
|
||||
@@ -346,7 +346,7 @@ func TestChat_PassesModelFlag(t *testing.T) {
|
||||
if !strings.Contains(args, "--model") {
|
||||
t.Errorf("CLI args missing --model, got: %s", args)
|
||||
}
|
||||
if !strings.Contains(args, "claude-sonnet-4-5-20250929") {
|
||||
if !strings.Contains(args, "claude-sonnet-4.6") {
|
||||
t.Errorf("CLI args missing model name, got: %s", args)
|
||||
}
|
||||
}
|
||||
@@ -417,9 +417,9 @@ func TestChat_EmptyWorkspaceDoesNotSetDir(t *testing.T) {
|
||||
func TestCreateProvider_ClaudeCli(t *testing.T) {
|
||||
cfg := config.DefaultConfig()
|
||||
cfg.ModelList = []config.ModelConfig{
|
||||
{ModelName: "claude-sonnet-4", Model: "claude-cli/claude-sonnet-4-20250514", Workspace: "/test/ws"},
|
||||
{ModelName: "claude-sonnet-4.6", Model: "claude-cli/claude-sonnet-4.6", Workspace: "/test/ws"},
|
||||
}
|
||||
cfg.Agents.Defaults.Model = "claude-sonnet-4"
|
||||
cfg.Agents.Defaults.Model = "claude-sonnet-4.6"
|
||||
|
||||
provider, _, err := CreateProvider(cfg)
|
||||
if err != nil {
|
||||
|
||||
@@ -48,7 +48,7 @@ func TestClaudeProvider_ChatRoundTrip(t *testing.T) {
|
||||
provider := newClaudeProviderWithDelegate(delegate)
|
||||
|
||||
messages := []Message{{Role: "user", Content: "Hello"}}
|
||||
resp, err := provider.Chat(t.Context(), messages, nil, "claude-sonnet-4-5-20250929", map[string]interface{}{"max_tokens": 1024})
|
||||
resp, err := provider.Chat(t.Context(), messages, nil, "claude-sonnet-4.6", map[string]interface{}{"max_tokens": 1024})
|
||||
if err != nil {
|
||||
t.Fatalf("Chat() error: %v", err)
|
||||
}
|
||||
@@ -65,8 +65,8 @@ func TestClaudeProvider_ChatRoundTrip(t *testing.T) {
|
||||
|
||||
func TestClaudeProvider_GetDefaultModel(t *testing.T) {
|
||||
p := NewClaudeProvider("test-token")
|
||||
if got := p.GetDefaultModel(); got != "claude-sonnet-4-5-20250929" {
|
||||
t.Errorf("GetDefaultModel() = %q, want %q", got, "claude-sonnet-4-5-20250929")
|
||||
if got := p.GetDefaultModel(); got != "claude-sonnet-4.6" {
|
||||
t.Errorf("GetDefaultModel() = %q, want %q", got, "claude-sonnet-4.6")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ func createCodexAuthProvider() (LLMProvider, error) {
|
||||
// If no prefix is specified, it defaults to "openai".
|
||||
// Examples:
|
||||
// - "openai/gpt-4o" -> ("openai", "gpt-4o")
|
||||
// - "anthropic/claude-3" -> ("anthropic", "claude-3")
|
||||
// - "anthropic/claude-sonnet-4.6" -> ("anthropic", "claude-sonnet-4.6")
|
||||
// - "gpt-4o" -> ("openai", "gpt-4o") // default protocol
|
||||
func ExtractProtocol(model string) (protocol, modelID string) {
|
||||
model = strings.TrimSpace(model)
|
||||
|
||||
@@ -26,9 +26,9 @@ func TestExtractProtocol(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "anthropic with prefix",
|
||||
model: "anthropic/claude-3-sonnet",
|
||||
model: "anthropic/claude-sonnet-4.6",
|
||||
wantProtocol: "anthropic",
|
||||
wantModelID: "claude-3-sonnet",
|
||||
wantModelID: "claude-sonnet-4.6",
|
||||
},
|
||||
{
|
||||
name: "no prefix - defaults to openai",
|
||||
@@ -134,7 +134,7 @@ func TestCreateProviderFromConfig_DefaultAPIBase(t *testing.T) {
|
||||
func TestCreateProviderFromConfig_Anthropic(t *testing.T) {
|
||||
cfg := &config.ModelConfig{
|
||||
ModelName: "test-anthropic",
|
||||
Model: "anthropic/claude-3-sonnet",
|
||||
Model: "anthropic/claude-sonnet-4.6",
|
||||
APIKey: "test-key",
|
||||
}
|
||||
|
||||
@@ -145,8 +145,8 @@ func TestCreateProviderFromConfig_Anthropic(t *testing.T) {
|
||||
if provider == nil {
|
||||
t.Fatal("CreateProviderFromConfig() returned nil provider")
|
||||
}
|
||||
if modelID != "claude-3-sonnet" {
|
||||
t.Errorf("modelID = %q, want %q", modelID, "claude-3-sonnet")
|
||||
if modelID != "claude-sonnet-4.6" {
|
||||
t.Errorf("modelID = %q, want %q", modelID, "claude-sonnet-4.6")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ func TestCreateProviderFromConfig_Antigravity(t *testing.T) {
|
||||
func TestCreateProviderFromConfig_ClaudeCLI(t *testing.T) {
|
||||
cfg := &config.ModelConfig{
|
||||
ModelName: "test-claude-cli",
|
||||
Model: "claude-cli/claude-sonnet-4-20250514",
|
||||
Model: "claude-cli/claude-sonnet-4.6",
|
||||
}
|
||||
|
||||
provider, modelID, err := CreateProviderFromConfig(cfg)
|
||||
@@ -181,8 +181,8 @@ func TestCreateProviderFromConfig_ClaudeCLI(t *testing.T) {
|
||||
if provider == nil {
|
||||
t.Fatal("CreateProviderFromConfig() returned nil provider")
|
||||
}
|
||||
if modelID != "claude-sonnet-4-20250514" {
|
||||
t.Errorf("modelID = %q, want %q", modelID, "claude-sonnet-4-20250514")
|
||||
if modelID != "claude-sonnet-4.6" {
|
||||
t.Errorf("modelID = %q, want %q", modelID, "claude-sonnet-4.6")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ func TestResolveProviderSelection(t *testing.T) {
|
||||
{
|
||||
name: "anthropic oauth routes to claude auth provider",
|
||||
setup: func(cfg *config.Config) {
|
||||
cfg.Agents.Defaults.Model = "claude-sonnet-4-5-20250929"
|
||||
cfg.Agents.Defaults.Model = "claude-sonnet-4.6"
|
||||
cfg.Providers.Anthropic.AuthMethod = "oauth"
|
||||
},
|
||||
wantType: providerTypeClaudeAuth,
|
||||
@@ -276,7 +276,7 @@ func TestCreateProviderReturnsClaudeProviderForAnthropicOAuth(t *testing.T) {
|
||||
cfg.ModelList = []config.ModelConfig{
|
||||
{
|
||||
ModelName: "test-claude-oauth",
|
||||
Model: "anthropic/claude-3-sonnet",
|
||||
Model: "anthropic/claude-sonnet-4.6",
|
||||
AuthMethod: "oauth",
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user