Skip to content

Bug: detect_changes_tool hangs indefinitely on large repos #465

@krmahadevan

Description

@krmahadevan

Symptom

detect_changes_tool runs for 1779s+ in GitHub Actions, ending with:

MCP error -32000: Connection closed
STDIO connection closed after 1794s (cleanly)

Environment

  • Repo: 109,189 nodes, 1,312,887 edges
  • Languages: Java, Scala, Python, JavaScript, Bash
  • Call site: Claude CLI in GitHub Actions (no step timeout set)
  • Version: 2.3.3 (latest release)

Root Cause

detect_changes_tool calls analyze_changes(), which calls compute_risk_score() for every changed function in the PR. compute_risk_score() calls get_transitive_tests() on each function. get_transitive_tests() does a BFS that follows all CALLS edges with no cap on frontier size.

Query explosion:

  1. Large PR → N changed functions (no upper bound)
  2. Per function: get_transitive_tests() fetches all CALLS edges from that function → M callees
  3. Per callee: one TESTED_BY SQL query
  4. Total queries: N × M (e.g., 1000 functions × 100 callees = 100,000 queries)

On a 1.3M-edge graph with hub functions common in Java/Scala, M can easily exceed 100.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions