From e596d2b6567180380c99804a6b17661a81ee3ceb Mon Sep 17 00:00:00 2001 From: viettranx Date: Wed, 11 Mar 2026 16:54:11 +0700 Subject: [PATCH] fix: invalidate TeamToolManager cache on team create handleCreate() only invalidated agentRouter but missed emitting the pub/sub event for TeamToolManager. Reuse invalidateTeamCaches() which does both, matching the pattern used by all other team mutations. --- internal/gateway/methods/teams.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/internal/gateway/methods/teams.go b/internal/gateway/methods/teams.go index 276d1244..5b7557ce 100644 --- a/internal/gateway/methods/teams.go +++ b/internal/gateway/methods/teams.go @@ -156,13 +156,8 @@ func (m *TeamsMethods) handleCreate(ctx context.Context, client *gateway.Client, m.autoCreateTeamLinks(ctx, team.ID, leadAgent, memberAgents, client.UserID()) } - // Invalidate agent caches so TEAM.md gets injected - if m.agentRouter != nil { - m.agentRouter.InvalidateAgent(leadAgent.AgentKey) - for _, ag := range memberAgents { - m.agentRouter.InvalidateAgent(ag.AgentKey) - } - } + // Invalidate agent + team tool caches so TEAM.md gets injected + m.invalidateTeamCaches(ctx, team.ID) client.SendResponse(protocol.NewOKResponse(req.ID, map[string]any{ "team": team,