From b71e8abb5d22b2cc3ae73cc6b1f9349c95bcf6b7 Mon Sep 17 00:00:00 2001 From: viettranx Date: Wed, 11 Mar 2026 16:54:18 +0700 Subject: [PATCH] fix: exclude inactive agents from team member listings ListMembers() now filters by a.status = 'active' so inactive agents no longer appear in TEAM.md or delegation prompts, preventing leaders from attempting to delegate to unavailable agents. --- internal/store/pg/teams.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/store/pg/teams.go b/internal/store/pg/teams.go index 9b4ff042..6d688027 100644 --- a/internal/store/pg/teams.go +++ b/internal/store/pg/teams.go @@ -127,7 +127,7 @@ func (s *PGTeamStore) ListMembers(ctx context.Context, teamID uuid.UUID) ([]stor COALESCE(a.frontmatter, '') AS frontmatter FROM agent_team_members m JOIN agents a ON a.id = m.agent_id - WHERE m.team_id = $1 + WHERE m.team_id = $1 AND a.status = 'active' ORDER BY m.joined_at`, teamID) if err != nil { return nil, err