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.
This commit is contained in:
viettranx committed 2026-03-11 16:54:11 +07:00
1 parent fa5f51e72e
commit e596d2b656
1 file changed
+2 -7
+2 -7
View File
@@ -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,