Skip to content

Commit 2f8d34c

Browse files
yoanbernabeuclaude
andcommitted
fix(trace): add caller nodes to call graph for incoming edges
The GetCallGraph method was adding incoming edges to the root node but not including the caller symbols in the graph's Nodes map, causing incomplete graph results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b034356 commit 2f8d34c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

trace/store.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,12 @@ func (s *GOBSymbolStore) GetCallGraph(ctx context.Context, symbolName string, de
361361
graph.Edges = append(graph.Edges, edge)
362362
edgeSeen[edgeKey] = true
363363
}
364+
// Ensure caller node is present in the graph.
365+
if _, exists := graph.Nodes[edge.Caller]; !exists {
366+
if syms, ok := s.index.Symbols[edge.Caller]; ok && len(syms) > 0 {
367+
graph.Nodes[edge.Caller] = syms[0]
368+
}
369+
}
364370
}
365371
}
366372
}

0 commit comments

Comments
 (0)