From 82dc4d3b94fd42b58d4c592142129c85b589a2b0 Mon Sep 17 00:00:00 2001 From: viettranx Date: Sat, 11 Apr 2026 11:24:21 +0700 Subject: [PATCH] chore(agents): remove dead UUID invalidation in agents_update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Post-Phase-2 canonicalization, router cache entries are always keyed as tenantID:agent_key. The belt-and-suspenders m.agents.InvalidateAgent(ag.ID.String()) call never matched any entry — exact-segment match on the final ":"- delimited segment cannot match a UUID as the agentKey. Removes the dead call and the misleading comment that justified it. Phase 2 follow-up (H7). --- internal/gateway/methods/agents_update.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/gateway/methods/agents_update.go b/internal/gateway/methods/agents_update.go index 7148a6ee..12f3d1e1 100644 --- a/internal/gateway/methods/agents_update.go +++ b/internal/gateway/methods/agents_update.go @@ -237,10 +237,11 @@ func (m *AgentsMethods) handleUpdate(ctx context.Context, client *gateway.Client } } + // Post-Phase-2 canonicalization: router cache entries are always keyed + // as `tenantID:agent_key`. The previous belt-and-suspenders UUID-based + // invalidation was dead code — exact-segment match never matches a + // UUID as the final segment of a canonical cache key. m.agents.InvalidateAgent(params.AgentID) - // Also invalidate by UUID — heartbeat/cron sessions cached under UUID key - // before the agentKey fix may still be in the router cache. - m.agents.InvalidateAgent(ag.ID.String()) } client.SendResponse(protocol.NewOKResponse(req.ID, map[string]any{