Skip to content

Persist use_colpali on the document record so requeue keeps it - #450

Merged
Adityav369 merged 1 commit into
mainfrom
fix/persist-use-colpali-for-requeue
Oct 14, 2026
Merged

Adityav369 merged 1 commit into
mainfrom
fix/persist-use-colpali-for-requeue

Conversation

@Adityav369

@Adityav369 Adityav369 commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

/ingest/requeue decides use_colpali per document in this order:

  1. the use_colpali value in the request job, if given;
  2. use_colpali in the document's system_metadata;
  3. otherwise False.

The worker only writes use_colpali to system_metadata when ingestion completes. A document that was ingested with use_colpali=true but failed before ever completing has no stored flag. If a client later requeues it without passing the flag, the document is silently reprocessed with text embeddings only. Nothing reports that the mode changed.

Fix

Store the requested use_colpali in system_metadata when the document record is first created (_ingest_file_content_locked) and when its content is replaced (queue_document_update). Requeue then keeps the original mode. An explicit use_colpali in the requeue request still takes precedence.

Tests

  • New: the initial document record carries use_colpali, and a queued content update persists it. Both tests fail without the fix.
  • pytest core/tests/unit/test_ingestion_service_metadata_update.py core/tests/unit/test_week1_ingest_fixes.py and the other ingest unit tests: 58 passed.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

/ingest/requeue resolves use_colpali from the request, then from the
document's system_metadata, and otherwise falls back to False. The flag
was only written to system_metadata when ingestion completed, so a
document that failed before ever completing was silently requeued
without ColPali when the requeue request omitted the flag.

Store the requested flag when the document record is created and when
its content is replaced, so requeue keeps the original mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Adityav369
Adityav369 merged commit dd831dd into main Oct 14, 2026
9 checks passed
Adityav369 added a commit that referenced this pull request Oct 14, 2026
/ingest/requeue resolves use_colpali from the request, then from the
document's system_metadata, and otherwise falls back to False. The flag
was only written to system_metadata when ingestion completed, so a
document that failed before ever completing was silently requeued
without ColPali when the requeue request omitted the flag.

Store the requested flag when the document record is created and when
its content is replaced, so requeue keeps the original mode.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant