#3616·graphify

`extract_corpus_parallel` misreports failed chunks as successful model omissions

Author: GREYGROUPJPCreated Sep 16, 2026Updated Sep 16, 2026

Summary

When a semantic chunk raises before returning a model response, extract_corpus_parallel() correctly reports the chunk failure and increments failed_chunks, but the final reconciliation warning then describes the same file as if the model returned a successful response and omitted it.

Confirmed on v0.9.63 (eaaec1abd99d3a7fb30301ccb49f4cc72ae34011).

Minimal reproduction

import io
from contextlib import redirect_stderr
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import patch

from graphify.llm import extract_corpus_parallel

with TemporaryDirectory() as d:
    doc = Path(d) / "guide.md"
    doc.write_text("# Guide\n", encoding="utf-8")
    stderr = io.StringIO()
    with patch(
        "graphify.llm._extract_with_adaptive_retry",
        side_effect=ImportError(
            "OpenAI package not installed. pip install 'graphifyy[gemini]'."
        ),
    ), redirect_stderr(stderr):
        result = extract_corpus_parallel(
            [doc], backend="gemini", token_budget=None,
            chunk_size=1, max_concurrency=1,
        )
    print(stderr.getvalue())
    assert result["failed_chunks"] == 1

Actual output

[graphify] chunk 1/1 failed: OpenAI package not installed. pip install 'graphifyy[gemini]'.
[graphify] WARNING: 1/1 semantic chunk(s) failed — see errors above. Partial results returned.
[graphify] WARNING: 1/1 dispatched file(s) produced no nodes and are absent from the graph: guide.md. The model returned a response but omitted them; a re-run will retry them.

The final sentence contradicts the preceding failure: no model response existed.

Cause

The dispatch/return reconciliation computes every dispatched file with no returned node as uncovered, but it does not retain which files belonged to chunks that raised. The single omission warning is therefore used for two distinct cases:

  1. a chunk failed before returning a usable result; and
  2. a chunk succeeded, but its response omitted one or more files.

Expected

Files from failed chunks should be described as failed before returning a usable result. The existing “model returned a response but omitted them” wording should remain only for files absent from successful chunk results.

This matters for missing optional dependencies as well as provider/backend errors: the first error tells the operator what to install or fix, while the final warning currently sends them toward model-output debugging instead.