From 0c7dd2237ffaed93ded1dba69cbc9b2fd10d0a15 Mon Sep 17 00:00:00 2001 From: OpenClaw Bot Date: Fri, 15 May 2026 14:02:10 +0000 Subject: [PATCH] fix(#1197): plumb hop-context to handleNodePaths resolveWithContext (GREEN) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit routes.go:1428 (handleNodePaths) was the last production call site still passing nil context to pm.resolveWithContext. handleNodePaths aggregates paths that terminate at the queried node (lowerPK), so seeding the resolver with [lowerPK] lets tier-1/2 hop-context disambiguation light up for prefix collisions on the destination — exactly the regression class #1197 targets. Verified by extended call-site gate (resolve_context_callsites_test.go) which now passes across all cmd/server/*.go. --- cmd/server/routes.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/server/routes.go b/cmd/server/routes.go index c778b91f..02704b03 100644 --- a/cmd/server/routes.go +++ b/cmd/server/routes.go @@ -1421,11 +1421,17 @@ func (s *Server) handleNodePaths(w http.ResponseWriter, r *http.Request) { pathGroups := map[string]*pathAgg{} totalTransmissions := 0 hopCache := make(map[string]*nodeInfo) + // Anchor the resolver with the node being queried so tier-1/2 hop-context + // resolution lights up when a hop prefix matches the destination node + // (handleNodePaths aggregates paths terminating at lowerPK). Passing nil + // here re-introduced regression #1197 in production. See + // resolve_context_callsites_test.go. + hopContext := []string{lowerPK} resolveHop := func(hop string) *nodeInfo { if cached, ok := hopCache[hop]; ok { return cached } - r, _, _ := pm.resolveWithContext(hop, nil, s.store.graph) + r, _, _ := pm.resolveWithContext(hop, hopContext, s.store.graph) hopCache[hop] = r return r }