-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Bug
find_definition, find_call_sites, trace_call_chain, and trace_data_flow all fail with GRAPH_NOT_CACHED even after explore_codebase has successfully generated and cached a graph.
Root Cause
Cache key mismatch between explore_codebase and the task-specific query tools.
explore_codebase stores the graph using generateIdempotencyKey() from api-helpers.ts:
{repoName}-{pathHash}:{graphType}:{gitHash}{statusHash}
# e.g. "workspace-8af22c4:supermodel:d16bfe05a7-6a95220"
find_definition et al. look it up using getCacheKey() in each tool file:
function getCacheKey(path: string): string {
return `cache_${path}`;
}
// e.g. "cache_/workspace"These keys never match. The graph is in memory but the query tools can't find it.
Reproduction
- Start the MCP server
- Call
explore_codebasewithquery: "summary"on a repo — succeeds, returns graph withsource: "api" - Call
explore_codebasewithquery: "domain_map"— succeeds,source: "cache"(graph is cached) - Call
find_definitionwithpathandname— fails:GRAPH_NOT_CACHED
Observed in a local mcpbr trial run against swe-bench-verified (astropy__astropy-12907). Logs available.
Impact
All four task-specific query tools are effectively broken in the current release (v0.8.0). This affects the ongoing full SWE-bench Verified run — any agent that calls explore_codebase first and then tries to use query tools will hit this error. The agent in our trial run pivoted to Grep/Read after the failure, but the query tools provided zero value.
Fix
The query tools should use generateIdempotencyKey() from api-helpers.ts instead of their local getCacheKey() function. All tools should share a single cache key generation mechanism.
Affected Files
src/tools/find-definition.ts(lines ~192-194)src/tools/find-call-sites.ts(same pattern)src/tools/trace-call-chain.ts(same pattern)src/tools/trace-data-flow.ts(same pattern)
Same issue exists in mcp-task-specific-tools repo.