feat(settings): KEEL_AW_URL with localhost default

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 19:39:49 -04:00
parent 3a4f498f86
commit 67f91442a4
2 changed files with 24 additions and 3 deletions
+17 -2
View File
@@ -8,7 +8,7 @@ import (
func TestSaveLoadRoundTrip(t *testing.T) {
path := filepath.Join(t.TempDir(), "settings.json")
want := Settings{AIBackend: "codex", MarvinCmd: "uv run am", KnowledgePath: "/tmp/k.md"}
want := Settings{AIBackend: "codex", MarvinCmd: "uv run am", KnowledgePath: "/tmp/k.md", AWURL: "http://aw.local:5600"}
if err := Save(path, want); err != nil {
t.Fatalf("save: %v", err)
}
@@ -32,8 +32,9 @@ func TestSeedFromEnvReadsVars(t *testing.T) {
t.Setenv("KEEL_AI_BACKEND", "codex")
t.Setenv("KEEL_MARVIN_CMD", "uv run am")
t.Setenv("KEEL_KNOWLEDGE_FILE", "/tmp/k.md")
t.Setenv("KEEL_AW_URL", "http://aw.local:5600")
got := SeedFromEnv()
want := Settings{AIBackend: "codex", MarvinCmd: "uv run am", KnowledgePath: "/tmp/k.md"}
want := Settings{AIBackend: "codex", MarvinCmd: "uv run am", KnowledgePath: "/tmp/k.md", AWURL: "http://aw.local:5600"}
if got != want {
t.Errorf("SeedFromEnv = %+v, want %+v", got, want)
}
@@ -58,3 +59,17 @@ func TestSaveCreatesDir(t *testing.T) {
t.Fatalf("file not written: %v", err)
}
}
func TestSeedFromEnvAWURL(t *testing.T) {
t.Setenv("KEEL_AW_URL", "http://aw.example:9999")
if got := SeedFromEnv().AWURL; got != "http://aw.example:9999" {
t.Fatalf("AWURL = %q", got)
}
}
func TestSeedFromEnvAWURLDefault(t *testing.T) {
t.Setenv("KEEL_AW_URL", "")
if got := SeedFromEnv().AWURL; got != "http://localhost:5600" {
t.Fatalf("default AWURL = %q", got)
}
}