Repository navigation
Description
Version
codebase-memory-mcp v0.10.8
Platform
Linux x86_64 (reproduces with both fast and full indexing modes)
What happened
TypeScript / TSX awaited calls with explicit generic type arguments do not produce CALLS edges. For example, await parseJsonBody<T>() is omitted, while the equivalent non-generic await parseJsonBody() call is indexed.
This makes inbound call tracing incomplete without any parse error or warning.
Minimal reproduction
Create these two files in an otherwise empty directory.
route-utils.ts
export async function parseJsonBody<T>() { return {} as T; }
export async function plainLocal() { return await parseJsonBody(); }
export async function genericLocal() { return await parseJsonBody<{ message: string }>(); }gateway.ts
import { parseJsonBody } from './route-utils';
type Payload = { message: string };
export async function plainImported() { return await parseJsonBody(); }
export async function genericImported() { return await parseJsonBody<{ message: string }>(); }
export async function genericPrimitive() { return await parseJsonBody<string>(); }
export async function genericNamed() { return await parseJsonBody<Payload>(); }Index the directory, then call trace_path with:
{
"project": "awaited-generic-repro",
"function_name": "parseJsonBody",
"direction": "inbound",
"depth": 1,
"format": "json"
}Actual result
Only these two callers are returned:
plainLocalplainImported
Expected result
All six callers should be returned:
plainLocalgenericLocalplainImportedgenericImportedgenericPrimitivegenericNamed
The behavior is the same in .tsx files. The generic calls are valid TypeScript, and the generic type argument should not change the callee from parseJsonBody.
Notes
This appears to be an extraction issue around the AST shape of await f<T>(), rather than a resolver issue: the non-generic calls in the same files resolve correctly. Because the corrected extraction changes graph content while source files remain unchanged, an index semantic-version/cache invalidation may also be needed so existing indexes are rebuilt.
Confirmations
- I searched existing issues and did not find this exact awaited-generic-call case.
- The reproduction contains only standalone, shareable code.
Activity
DeusData commentedon Sep 20, 2026
Fixed on main in 60c307e (PR #2242, by @lorenzozanee).
await parseJsonBody<string>()parses with theawait_expressionwhere the callee is expected, so the generic call was never reached and its CALLS edge was dropped. The callee is now unwrapped once at selection time, in both the textual extractor and the TypeScript LSP resolver — a fix in only one would have left the graph disagreeing with itself.Verified falsifiable: with the production change reverted and the tests left in place,
count_calls_named(r, "parseJsonBody")returns 1 instead of 2 andfind_resolved(r, "generic", "parseJsonBody")finds nothing.