Skip to content

TypeScript: awaited generic calls omit CALLS edges #2210

Description

@lichao2014

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:

  • plainLocal
  • plainImported

Expected result

All six callers should be returned:

  • plainLocal
  • genericLocal
  • plainImported
  • genericImported
  • genericPrimitive
  • genericNamed

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    parsing/qualityGraph extraction bugs, false positives, missing edges

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions