From 6d6241df8754ecd9fa8d87523ad961e040552af6 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Fri, 10 Oct 2025 09:23:07 +1100 Subject: [PATCH] Fix task ID lookup in triggerTeamCompositionForCouncil MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Query the actual task_id from councils table instead of incorrectly using council_id as task_id. Issue: Council activation was failing to trigger team composition because it was looking for a task with ID=council_id which doesn't exist. Fix: Query SELECT task_id FROM councils WHERE id = council_id 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- internal/server/server.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/server/server.go b/internal/server/server.go index fdbbf98..851486f 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -3917,11 +3917,14 @@ func (s *Server) ensureCouncilAgentStatusConstraint(ctx context.Context) error { // triggerTeamCompositionForCouncil starts team composition for the task linked to the council func (s *Server) triggerTeamCompositionForCouncil(ctx context.Context, councilID uuid.UUID) error { - // Look up the task associated with this council. For now we assume the task ID matches the council ID. - // Future work could store an explicit mapping in the database. - taskID := councilID.String() + // Look up the task associated with this council from the database + var taskID uuid.UUID + err := s.db.Pool.QueryRow(ctx, "SELECT task_id FROM councils WHERE id = $1", councilID).Scan(&taskID) + if err != nil { + return fmt.Errorf("failed to get task_id for council: %w", err) + } - log := zerolog.Ctx(ctx).With().Str("council_id", councilID.String()).Str("task_id", taskID).Logger() + log := zerolog.Ctx(ctx).With().Str("council_id", councilID.String()).Str("task_id", taskID.String()).Logger() log.Info().Msg("🔁 Triggering team composition for council-linked task") // Reuse the monitor's capability to run team composition if available. @@ -3931,7 +3934,7 @@ func (s *Server) triggerTeamCompositionForCouncil(ctx context.Context, councilID } // Use the monitor's helper so the same logic runs as for bzzz-task issues. - go s.repoMonitor.TriggerTeamCompositionForCouncil(ctx, taskID) + go s.repoMonitor.TriggerTeamCompositionForCouncil(ctx, taskID.String()) return nil }