fix: make OCR portable and reliable across AMD64 and ARM64 (#519)

* fix: make OCR portable and reliable

* fix: harden OCR installation portability

* fix: pin OCR partials across downloads

* fix: make OCR execution reliably asynchronous

* fix: harden OCR portability and docs routes

* fix: preserve decoder and docs safeguards
This commit is contained in:
SnapOtter
2026-07-15 03:34:24 +08:00
committed by GitHub
parent 58121f205f
commit 991c981529
409 changed files with 67151 additions and 8076 deletions
@@ -4,6 +4,7 @@ import { apiToolPath, TOOL_BUNDLE_MAP, TOOLS } from "@snapotter/shared";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { fixtureDir } from "../../fixtures/index.js";
import { defaultSettingsFor } from "../../helpers/tool-default-settings.js";
import { cancelAcceptedJobAndWait } from "../settle-job.js";
import {
buildTestApp,
createMultipartPayload,
@@ -275,6 +276,13 @@ describe("multi-modality tool x format matrix", () => {
`${toolId} x ${fixture.filename}: 202 without jobId`,
).toBeDefined();
expect(typeof payload.jobId).toBe("string");
// The generic matrix verifies acceptance, not OCR execution. If an
// optional OCR runtime happens to be installed locally, release its
// long-running job immediately rather than leaking it into teardown.
if (toolId === "ocr-pdf") {
await cancelAcceptedJobAndWait(payload.jobId as string, "ai");
}
}
if (res.statusCode === 501) {