OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Bug] Semantic retries reprocess files that already succeeded in the previous attempt

Open nextCY opened this issue 2 months ago • 0 comments

Description

When semantic processing of a multi-file directory partially fails, a queue retry repeats work that already succeeded in the previous attempt.

For example, if summary generation succeeds for a.txt and then a transient provider error occurs for b.txt, the directory attempt aborts. On the next SemanticQueue attempt, a.txt is summarized and potentially vectorized again before retrying b.txt. One transient failure can therefore amplify LLM and embedding calls across every retry.

The current incremental path reconstructs per-file reusable state from the generated .overview.md. That free-form sidecar is not a durable progress checkpoint and may not be written or parseable after a partial failure.

Reproduction

  1. Create a directory containing a.txt and b.txt.
  2. Run incremental semantic processing with serial summary generation.
  3. Let a.txt succeed and make the first request for b.txt raise a retryable error.
  4. Retry the same semantic message.
  5. Observe that the successful work for a.txt is performed again.

With a deterministic test double, the current call sequence is effectively:

a.txt, b.txt, a.txt, b.txt

The desired sequence is:

a.txt, b.txt, b.txt

Expected behavior

Successful per-file progress should survive a directory-level failure. A retry should process only failed files or incomplete phases, plus any affected ancestor directory summaries.

Suggested direction

Persist versioned, structured per-file semantic state keyed by content hash, including summary and summary/vectorization status. Mark work as failed before starting and successful only after the corresponding output or queue message is durable.

Related issues

  • #2383 tracks repeated work during unchanged add_resource refreshes and already points toward a structured auxiliary file.
  • #3151 tracks swallowed overview-generation failures and missing queue retries.

This issue is specifically about retaining partial per-file success across an actual queue retry.

nextCY avatar Sep 07 '26 07:09 nextCY