fix(ingest): suppress misleading batch-fallback warn for in-cluster rung
Address claude-review round 3 on #922: - Important: _process_batch emitted "no gateway backend (provider=mistral or EMBEDDING_GATEWAY_URL unset)" for the gateway_only in-cluster rung, where the gateway IS configured — sending operators chasing a non-existent config problem. The real reason is "in-cluster GPU is synchronous-only; batch is the upstream path". Guard the warning with `if not self._gateway_only`. Extended test_gateway_only_processor_never_uses_batch_mode to drive _process_batch and assert _batch_fallback_warned stays False. - Nits: refresh stale ladder in escalation.py module docstring (fast->structured->ocr-incluster->ocr-upstream); fix "minimum='ocr'" -> "ocr-incluster" in a test docstring; rename stale tier="ocr" -> "ocr-upstream" in test_process_tier_oversize_fails_fast. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
6e32bd9561
commit
ebbf905dc5
@@ -2,7 +2,7 @@
|
||||
|
||||
The escalation ladder is the cheapest-first ordering of extraction tiers:
|
||||
|
||||
fast -> structured -> ocr ( -> llm, reserved)
|
||||
fast -> structured -> ocr-incluster -> ocr-upstream ( -> llm, reserved)
|
||||
|
||||
It mirrors the ``tier`` vocabulary documented on
|
||||
:meth:`DocumentProcessor.tier <.base.DocumentProcessor.tier>` and the
|
||||
|
||||
@@ -499,10 +499,15 @@ class OcrProcessor(DocumentProcessor):
|
||||
return None
|
||||
client = await self._get_batch_client()
|
||||
if client is None:
|
||||
self._batch_fallback(
|
||||
"no gateway backend (provider=mistral or EMBEDDING_GATEWAY_URL unset)",
|
||||
filename,
|
||||
)
|
||||
# The in-cluster (gateway_only) rung returns None here BY DESIGN — the
|
||||
# GPU is synchronous-only, batch is the upstream Mistral path — so don't
|
||||
# emit the "no gateway backend" warning (the gateway IS configured; that
|
||||
# warning would send an operator chasing a non-existent config problem).
|
||||
if not self._gateway_only:
|
||||
self._batch_fallback(
|
||||
"no gateway backend (provider=mistral or EMBEDDING_GATEWAY_URL unset)",
|
||||
filename,
|
||||
)
|
||||
return None
|
||||
|
||||
# Lazy import: keep the vector/DB stack off the document_processors load
|
||||
|
||||
Reference in New Issue
Block a user