fix(config): disable tool feedback by default (#2026)

Co-authored-by: Alix-007 <267018309+Alix-007@users.noreply.github.com>
This commit is contained in:
Alix-007 2026-03-26 09:31:42 +08:00 committed by GitHub
parent 9503f38ace
commit 5c210e6f15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 2 deletions

View file

@ -487,6 +487,33 @@ func TestDefaultConfig_WebPreferNativeEnabled(t *testing.T) {
} }
} }
func TestDefaultConfig_ToolFeedbackDisabled(t *testing.T) {
cfg := DefaultConfig()
if cfg.Agents.Defaults.ToolFeedback.Enabled {
t.Fatal("DefaultConfig().Agents.Defaults.ToolFeedback.Enabled should be false")
}
}
func TestLoadConfig_ToolFeedbackDefaultsFalseWhenUnset(t *testing.T) {
dir := t.TempDir()
configPath := filepath.Join(dir, "config.json")
if err := os.WriteFile(
configPath,
[]byte(`{"version":1,"agents":{"defaults":{"workspace":"./workspace"}}}`),
0o600,
); err != nil {
t.Fatalf("WriteFile() error: %v", err)
}
cfg, err := LoadConfig(configPath)
if err != nil {
t.Fatalf("LoadConfig() error: %v", err)
}
if cfg.Agents.Defaults.ToolFeedback.Enabled {
t.Fatal("agents.defaults.tool_feedback.enabled should remain false when unset in config file")
}
}
func TestLoadConfig_WebPreferNativeDefaultsTrueWhenUnset(t *testing.T) { func TestLoadConfig_WebPreferNativeDefaultsTrueWhenUnset(t *testing.T) {
dir := t.TempDir() dir := t.TempDir()
configPath := filepath.Join(dir, "config.json") configPath := filepath.Join(dir, "config.json")

View file

@ -39,7 +39,7 @@ func DefaultConfig() *Config {
SummarizeTokenPercent: 75, SummarizeTokenPercent: 75,
SteeringMode: "one-at-a-time", SteeringMode: "one-at-a-time",
ToolFeedback: ToolFeedbackConfig{ ToolFeedback: ToolFeedbackConfig{
Enabled: true, Enabled: false,
MaxArgsLength: 300, MaxArgsLength: 300,
}, },
SplitOnMarker: false, SplitOnMarker: false,

View file

@ -67,7 +67,7 @@ export const EMPTY_FORM: CoreConfigForm = {
workspace: "", workspace: "",
restrictToWorkspace: true, restrictToWorkspace: true,
splitOnMarker: false, splitOnMarker: false,
toolFeedbackEnabled: true, toolFeedbackEnabled: false,
toolFeedbackMaxArgsLength: "300", toolFeedbackMaxArgsLength: "300",
execEnabled: true, execEnabled: true,
allowRemote: true, allowRemote: true,