aft icon indicating copy to clipboard operation
aft copied to clipboard

aft_callgraph while the store is building: report progress, allow a bounded wait, or return marked lexical candidates

Open iceteaSA opened this issue 1 month ago • 1 comments

Problem

While the call-graph store is building, every aft_callgraph op returns at once:

callers: callgraph_building — callers: callgraph store is building in the background; retry shortly
data: {"index":{"callgraph":{"status":"building","reason":null}},"results":null}

The reply has no progress and no estimate. The agent can't tell whether "shortly" means seconds or ten minutes. On a large repository we got this answer twice, about four minutes apart, for the same query. So agents either loop on the call (wasting turns), or give up and grep without saying the result is unverified. Checked on main (396d0bff8): no bounded wait and no fallback.

Proposal

Any one of these would help; together they would remove the dead end:

  1. Progress in the reply: files done / total, or elapsed time, so the agent can decide whether to wait.
  2. A bounded wait: an optional wait_ms (capped by config) that blocks until the store is ready or the wait expires, then answers or reports building with progress.
  3. A marked fallback: for callers and impact, return the lexical candidates (files that reference the name), clearly labelled unverified: lexical candidates while the call graph builds, with complete: false.

Option 3 must never present lexical candidates as the call-graph answer.

iceteaSA avatar Oct 19 '26 18:10 iceteaSA

In v0.64.0, call-graph commands use the new index store and wait up to 30 seconds for a regular checkout's graph to become current before returning building. This implements the bounded-wait alternative in this issue; it does not add lexical answers or progress counters. Parent-folder queries can still report a child whose first graph is loading. Please reopen if a regular checkout still returns immediately throughout a build on v0.64.0.

aft-alfonso[bot] avatar Nov 11 '26 19:11 aft-alfonso[bot]