Fix config validation edge cases

This commit is contained in:
2026-07-03 18:56:35 +00:00
parent 4477b13203
commit fd835b582c
6 changed files with 222 additions and 34 deletions

View File

@@ -79,7 +79,7 @@ func TestValidateRejectsInvalidNumericFields(t *testing.T) {
name: "max concurrency",
mutate: func(cfg Config) Config {
profile := cfg.LLMProfiles["default"]
profile.MaxConcurrency = 0
profile.MaxConcurrency = -1
cfg.LLMProfiles["default"] = profile
return cfg
},
@@ -97,6 +97,15 @@ func TestValidateRejectsInvalidNumericFields(t *testing.T) {
}
}
func TestValidateAllowsPartialLLMProfileNumericConfig(t *testing.T) {
cfg := validConfig()
cfg.LLMProfiles["retry-only"] = LLMProfile{MaxRetries: 3}
if err := cfg.Validate(); err != nil {
t.Fatalf("Validate: %v", err)
}
}
func TestValidateRejectsInvalidDiagnosticsRetention(t *testing.T) {
cfg := validConfig()
cfg.Diagnostics.Retention = diagnostics.RetentionMode("sometimes")