fix(hook): handle error from events.LogFeed (#440)

* fix(beads): cache version check and add timeout to prevent cli lag

* fix(mail_queue): add nil check for queue config

Prevents potential nil pointer panic when queue config exists
in map but has nil value. Added || queueCfg == nil check to
the queue lookup condition in runMailClaim function.

Fixes potential panic that could occur if a queue entry exists
in config but with a nil value.

* fix(migrate_agents_test): fix icon expectations to match actual output

The printMigrationResult function uses icons with two leading spaces
("  ✓", "  ⊘", "  ✗") but the test expected icons without spaces.
This fixes the test expectations to match the actual output format.

* fix(hook): handle error from events.LogFeed

Previously the error from LogFeed was silently ignored with _.
Now we log the error to stderr at warning level but don't fail
the operation since the primary hook action succeeded.
This commit is contained in:
sigfawn
2026-01-13 16:40:57 -05:00
committed by GitHub
parent 1453b8b592
commit aa0bfd0c40
4 changed files with 39 additions and 13 deletions

View File

@@ -20,7 +20,7 @@ func TestMigrationResultStatus(t *testing.T) {
Status: "migrated",
Message: "successfully migrated",
},
wantIcon: "✓",
wantIcon: " ✓",
},
{
name: "would migrate shows checkmark",
@@ -30,7 +30,7 @@ func TestMigrationResultStatus(t *testing.T) {
Status: "would migrate",
Message: "would copy state from gt-mayor",
},
wantIcon: "✓",
wantIcon: " ✓",
},
{
name: "skipped shows empty circle",
@@ -40,7 +40,7 @@ func TestMigrationResultStatus(t *testing.T) {
Status: "skipped",
Message: "already exists",
},
wantIcon: "⊘",
wantIcon: " ⊘",
},
{
name: "error shows X",
@@ -50,7 +50,7 @@ func TestMigrationResultStatus(t *testing.T) {
Status: "error",
Message: "failed to create",
},
wantIcon: "✗",
wantIcon: " ✗",
},
}
@@ -59,11 +59,11 @@ func TestMigrationResultStatus(t *testing.T) {
var icon string
switch tt.result.Status {
case "migrated", "would migrate":
icon = "✓"
icon = " ✓"
case "skipped":
icon = "⊘"
icon = " ⊘"
case "error":
icon = "✗"
icon = " ✗"
}
if icon != tt.wantIcon {
t.Errorf("icon for status %q = %q, want %q", tt.result.Status, icon, tt.wantIcon)