[Bug]: multimodal chunks are appended after the doc_status record is written and never added to chunks_list

Author: qianheng-awsCreated Aug 11, 2026Updated Aug 11, 2026

Do you need to file an issue?

  • I have searched the existing issues and this bug is not already filed.
  • I believe this is a legitimate bug, not just a question or feature request.

Describe the bug

RAG-Anything inserts multimodal chunks after LightRAG writes the document's doc_status record, and nothing amends the record's chunks_list. Measured on one document: 164 chunks carry its full_doc_id, but chunks_list names only 157 — all 7 missing ones have is_multimodal: true (equation/table analyses).

The reverse link is also incomplete on the LightRAG side (documents ingested via the upload endpoint are keyed upload-<hash> while their chunks carry the content-hash doc- id), so neither chunks_list nor full_doc_id alone finds all of a document's chunks.

Why it matters

Anything that enumerates a document's chunks from chunks_list — deletion, audits, exporters — silently orphans every multimodal chunk. Deletion tools built on either single link leak data; we had to take the union of both to get a correct cascade.

Expected Behavior

After multimodal insertion completes, update the doc_status record's chunks_list (and chunks_count) to include the multimodal chunk ids.