Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Veryfront and adjusts the ext-document-kreuzberg Deno extraction behavior to avoid falling back to the OOM-prone worker/opaque extraction path when Kreuzberg native bindings are unavailable, adding regression tests to lock in the new failure mode.
Changes:
- Bump
veryfrontversion to0.1.990(and keepVERSIONconstant in sync). - In
KreuzbergDocumentExtractor, throw a dedicated “native binding unavailable” error instead of falling back when native bindings are missing (both for PDF-native and native-progress paths). - Update/add tests to assert that missing native bindings fail fast and do not use the worker/opaque fallback.
Verification
- Not run in this review environment. Based on PR notes, the author ran
deno task testunderextensions/ext-document-kreuzberg,deno fmt --check ..., and pre-push checks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
deno.json |
Bumps package version to 0.1.990. |
src/utils/version-constant.ts |
Keeps exported VERSION aligned with deno.json. |
extensions/ext-document-kreuzberg/src/index.ts |
Stops Deno PDF/native-progress extraction from falling back when native bindings are missing; introduces a dedicated error wrapper. |
extensions/ext-document-kreuzberg/src/index.test.ts |
Updates tests to assert “fail instead of fallback” behavior for missing native bindings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function createNativeBindingUnavailableError(error: unknown): Error { | ||
| return new Error( | ||
| "Native document extraction is unavailable because the Kreuzberg native binding could not be loaded.", | ||
| { cause: error }, | ||
| ); | ||
| } |
580d5c3 to
edffee5
Compare
|
Closing this follow-up because we are keeping the no-progress PDF behavior that falls back to the Deno worker when native PDF extraction is unavailable. The deploy/runtime fix continues in veryfront-server#209, which ships the native binding in the server image. |
Critical ReviewScore: 68/100. Right fix, right direction: fail fast with a structured error beats an OOMKilled pod surfacing as an opaque HTTP 502. But the headline detection mechanism is dead code in production, and the new test proves a scenario that cannot happen. 1. The progress-path missing-binding check never fires in production (P1, main issue)The chain, verified against actual sources:
So the new Net behavior for PDFs is still correct, which is why this scores 68 and not 40. But:
Fix: classify in the worker and send a structured flag across the boundary, e.g. the worker catch posts 2.
|
Summary
Fix the staging runtime failure found while proving
veryfront-studio#5484:veryfrontto0.1.990Root Cause
The post-merge staging proof did not reach successful PDF extraction. The runtime pod logged that
@kreuzberg/nodecould not load its platform native binding, fell back to the previous opaque extraction path, then Kubernetes OOMKilled theveryfront-serverpod. The API only surfaced that process death asRuntime execution returned HTTP 502.Verification
deno task testinextensions/ext-document-kreuzbergdeno fmt --check deno.json src/utils/version-constant.ts extensions/ext-document-kreuzberg/src/index.ts extensions/ext-document-kreuzberg/src/index.test.tsgit diff --check2223 passed (19094 steps), 0 failedNotes
This PR pairs with the
veryfront-serverPR that stages@kreuzberg/node-linux-x64-gnuinto the server image so the native path is actually available in staging.