From 29d4019e628b57f50c15116c4597191a28ac2433 Mon Sep 17 00:00:00 2001 From: lxowalle <83055338+lxowalle@users.noreply.github.com> Date: Fri, 27 Feb 2026 17:02:25 +0800 Subject: [PATCH] fix: set max tokens to 32k, default model to null (#858) * * Set default value of max tokens to 32768 * * set max tokens to 32k, default model to null * * Fix format error --- pkg/config/config_test.go | 8 ++++---- pkg/config/defaults.go | 4 ++-- pkg/migrate/migrate_test.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index bf56b7f34..45cdd8ec8 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -210,8 +210,8 @@ func TestDefaultConfig_WorkspacePath(t *testing.T) { func TestDefaultConfig_Model(t *testing.T) { cfg := DefaultConfig() - if cfg.Agents.Defaults.Model == "" { - t.Error("Model should not be empty") + if cfg.Agents.Defaults.Model != "" { + t.Error("Model should be empty") } } @@ -331,8 +331,8 @@ func TestConfig_Complete(t *testing.T) { if cfg.Agents.Defaults.Workspace == "" { t.Error("Workspace should not be empty") } - if cfg.Agents.Defaults.Model == "" { - t.Error("Model should not be empty") + if cfg.Agents.Defaults.Model != "" { + t.Error("Model should be empty") } if cfg.Agents.Defaults.Temperature != nil { t.Error("Temperature should be nil when not provided") diff --git a/pkg/config/defaults.go b/pkg/config/defaults.go index 6805a8bc4..8e21809ee 100644 --- a/pkg/config/defaults.go +++ b/pkg/config/defaults.go @@ -13,8 +13,8 @@ func DefaultConfig() *Config { Workspace: "~/.picoclaw/workspace", RestrictToWorkspace: true, Provider: "", - Model: "glm-4.7", - MaxTokens: 8192, + Model: "", + MaxTokens: 32768, Temperature: nil, // nil means use provider default MaxToolIterations: 50, }, diff --git a/pkg/migrate/migrate_test.go b/pkg/migrate/migrate_test.go index b6b3d70aa..9216442bb 100644 --- a/pkg/migrate/migrate_test.go +++ b/pkg/migrate/migrate_test.go @@ -296,8 +296,8 @@ func TestConvertConfig(t *testing.T) { if len(warnings) != 0 { t.Errorf("expected no warnings, got %v", warnings) } - if cfg.Agents.Defaults.Model != "glm-4.7" { - t.Errorf("default model should be glm-4.7, got %q", cfg.Agents.Defaults.Model) + if cfg.Agents.Defaults.Model != "" { + t.Errorf("default model should be nil, got %q", cfg.Agents.Defaults.Model) } }) }