Broad bug hunt: auth flow, WS edge cases, and build hygiene.

Scope API auth to /api/v1, fix dashboard WebSocket 401s, session login in Calibrate, safe agent naming, reconnect races, and remove corrupt ollama/main.go.
This commit is contained in:
drjones
2026-05-28 19:53:53 -07:00
parent 3316a75f7a
commit 9e26c4babb
16 changed files with 332 additions and 30 deletions

View File

@@ -32,3 +32,22 @@ func TestAuthPayloadWorkerNameFallback(t *testing.T) {
t.Fatalf("expected forged worker name, got %q", displayName)
}
}
func TestShortAgentID(t *testing.T) {
if shortAgentID("abcdef12-3456") != "abcdef12" {
t.Fatalf("expected 8-char prefix")
}
if shortAgentID("ab") != "ab" {
t.Fatalf("expected short id preserved")
}
if shortAgentID("") != "agent" {
t.Fatalf("expected fallback agent label")
}
}
func TestAgentDisplayNameFallback(t *testing.T) {
name := agentDisplayName("", "", "", "12345678-abcd")
if name != "12345678" {
t.Fatalf("expected id prefix, got %q", name)
}
}