fix(api): propagate lenient structural-validation flag to batch + pipeline

Main already reuses the per-modality input handlers in batch and pipeline
(#244), so the modality-aware reuse from the video QA sweep was redundant.
Port only the remaining unique piece: pass lenient: skipStructuralValidation
to the handler so batched/pipelined PDF tools that opt out of structural
validation behave like the single-file factory path. Keeps main's safer
explicit image-decode chain (HEIC/RAW/SVG/autoOrient) and AI fileId threading.
This commit is contained in:
SnapOtter
2026-06-17 14:28:22 +08:00
parent 3fc4149143
commit e52e0bb3d5
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -249,6 +249,7 @@ export async function registerBatchRoutes(app: FastifyInstance): Promise<void> {
processFilename,
{
scratchDir: batchScratch,
lenient: getToolConfig(toolId)?.skipStructuralValidation,
},
);
processBuffer = prepared.buffer;
+5 -1
View File
@@ -304,6 +304,7 @@ export async function registerPipelineRoutes(app: FastifyInstance): Promise<void
try {
const prepared = await inputHandlerFor(inputModality).prepare(fileBuffer, filename, {
scratchDir: pipelineScratch,
lenient: getToolConfig(firstToolId ?? "")?.skipStructuralValidation,
});
fileBuffer = prepared.buffer;
filename = prepared.filename;
@@ -893,7 +894,10 @@ export async function registerPipelineRoutes(app: FastifyInstance): Promise<void
const prepared = await inputHandlerFor(batchModality).prepare(
processBuffer,
processFilename,
{ scratchDir: pipelineBatchScratch },
{
scratchDir: pipelineBatchScratch,
lenient: getToolConfig(pipeline.steps[0]?.toolId ?? "")?.skipStructuralValidation,
},
);
processBuffer = prepared.buffer;
processFilename = prepared.filename;