Files
Agent-System-Backend/internal/settings/settings_test.go
T
weichenandCursor 93adb93b9d
ci / vet-and-test (pull_request) Successful in 40s
Retry direct model calls before the first delta
Why: The direct path never retried provider timeouts, so a single 429 failed the run.
Evidence: go test ./internal/settings/ ./internal/runtime/ passed. Default runtime.llmRetries is 2.
Impact: Retries happen only when the stream has not forwarded a delta. Injected test streams are not wrapped.
Refs: feature/llm-robustness
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 15:53:42 +00:00

42 lines
1.2 KiB
Go

package settings
import "testing"
func TestLLMRetriesDefault(t *testing.T) {
block := SystemDefaults()["runtime"].(map[string]any)
if block["llmRetries"] != 2 {
t.Fatalf("llmRetries = %#v", block["llmRetries"])
}
var found bool
for _, desc := range Schema() {
if desc.Key == "runtime.llmRetries" && desc.Default == 2 {
found = true
}
}
if !found {
t.Fatal("schema missing runtime.llmRetries default 2")
}
}
func TestDeliverableSettingsPresent(t *testing.T) {
defaults := SystemDefaults()
block, ok := defaults["deliverables"].(map[string]any)
if !ok || block["style"] != "modern" || block["accentColor"] != "" || block["templateArtifactId"] != "" {
t.Fatalf("defaults = %#v", defaults["deliverables"])
}
var style, accent, template bool
for _, desc := range Schema() {
switch desc.Key {
case "deliverables.style":
style = len(desc.Options) == 3 && desc.Options[0] == "modern"
case "deliverables.accentColor":
accent = true
case "deliverables.templateArtifactId":
template = true
}
}
if !style || !accent || !template {
t.Fatalf("schema missing deliverable keys: style=%v accent=%v template=%v", style, accent, template)
}
}