fix(mcp): trace_path cross_service follows CROSS_* edges (#522) - #538
Merged
DeusData merged 1 commit intoJun 22, 2026
Merged
Conversation
trace_path mode=cross_service resolved its default edge-type list to
{HTTP_CALLS, ASYNC_CALLS, DATA_FLOWS, CALLS} — none of the CROSS_* edge
types the cross-repo pass actually writes. Since cbm_store_bfs filters
edges with an exact `WHERE e.type IN (...)` clause, cross-service traces
silently skipped every cross hop even when the edge was present and
visible via query_graph.
Add the six CROSS_* types (CROSS_HTTP_CALLS, CROSS_ASYNC_CALLS,
CROSS_CHANNEL, CROSS_GRPC_CALLS, CROSS_GRAPHQL_CALLS, CROSS_TRPC_CALLS)
to the cross_service default list — exactly the set pass_cross_repo.c
emits and cross_repo_delete_edges() cleans up. The count is now computed
from the array size (sizeof) so it can't drift; the dead MCP_N_DEFAULTS_4
constant is removed. Tool description updated to match.
Adds integ_mcp_trace_path_cross_service: seeds a CROSS_HTTP_CALLS edge
between two indexed functions with no CALLS relationship and asserts
cross_service surfaces the hop while calls mode does not.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: kirilklein <kikl@di.ku.dk>
|
Built this branch on macOS (arm64) and tested it: with a node reachable only through a CROSS_HTTP_CALLS edge, trace_path cross_service returns 0 callees on main and 1 on this branch. Confirmed working. Thanks for the quick turnaround. |
|
I have a kinesis stream for eventing and it couldn't recognize the cross service calls from upstream and downstream, by any chance will this change include the kinesis too? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #522 —
trace_pathwithmode=cross_servicedid not follow cross-repo edges, so cross-service traces silently dropped every cross hop even when the edge existed and was visible viaquery_graph.Root cause.
resolve_trace_edge_types()insrc/mcp/mcp.cresolved thecross_servicedefault edge-type list to{HTTP_CALLS, ASYNC_CALLS, DATA_FLOWS, CALLS}— none of theCROSS_*types the cross-repo pass actually writes.cbm_store_bfsfilters edges with an exactWHERE e.type IN (...)clause, so anyCROSS_HTTP_CALLS/CROSS_ASYNC_CALLS/ … hop was filtered out. The traversal engine was fine; the defaults list was just missing the cross types.Fix. Add the six
CROSS_*types (CROSS_HTTP_CALLS,CROSS_ASYNC_CALLS,CROSS_CHANNEL,CROSS_GRPC_CALLS,CROSS_GRAPHQL_CALLS,CROSS_TRPC_CALLS) to thecross_servicedefault list — exactly the setpass_cross_repo.cemits andcross_repo_delete_edges()cleans up. The count is now derived from the array size (sizeof) so it can't drift; the now-deadMCP_N_DEFAULTS_4constant is removed. Thetrace_pathtool description is updated to match.Before / after (repro from the issue)
query_graphreturns theCROSS_HTTP_CALLSedge, buttrace_path(mode=cross_service)from the source function returns only in-repo callees.trace_path(mode=cross_service)surfaces the cross hop;query_graphstill returns the edge.Test
Adds
integ_mcp_trace_path_cross_service: seeds aCROSS_HTTP_CALLSedge between two indexed functions that have noCALLSrelationship, then assertscross_servicesurfaces the hop whilecallsmode does not (proving the cross edge specifically is what's followed). Verified to fail before the fix and pass after.Checklist
git commit -s)make -f Makefile.cbm test) — 5609 passedclang-format --dry-run --Werrorclean on changed files (fulllint-cideferred to CI)🤖 Generated with Claude Code