Skip to content

fix(progress): graph/increment task stays "running" on Ctrl+C abort #415

Description

@HumanBean17

Problem

When the operator hits Ctrl+C during the graph phase of indexing, the [graph]/[increment] task is left visually "running" in the progress renderer — no terminal event is emitted.

Root cause

_run_cocoindex_update_impl wraps its _popen_capturing_stderr call in a try/finally that emits a parent-side terminal event (status="failed"/"done") for the vectors task — see `src/java_codebase_rag/pipeline.py` (on_progress(ProgressEvent(kind="vectors", ..., status="failed"))).

run_build_ast_graph and run_incremental_graph call _popen_capturing_stderr bare — no finally, so on abort the graph task never gets a terminal event.

Why it surfaced now

Follow-up to #414, which made Ctrl+C actually interrupt the indexing wait (proc.wait() is now called before the uninterruptible Thread.join()). Abort is now reliable, so this rendering gap is actually reachable.

Fix (sketch)

Mirror the cocoindex path: wrap the _popen_capturing_stderr call in both graph functions with a try/finally that emits a terminal ProgressEvent(kind="graph", ..., status="failed") (and "done" on success), based on the returned code — same shape as the vectors finally.

Acceptance

  • Ctrl+C during the graph phase renders a red cross / failed marker for the graph task (not a perpetual spinner).
  • A passing graph build still renders the done marker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions