{"record":{"id":"a62afa3cb56d4519","repo":"diegosouzapw/OmniRoute","slug":"batch-stale-batch-batch-id-has-no-item-checkp","errorCode":null,"errorMessage":"[BATCH] Stale batch ${batch.id} has no item checkpoints; failing instead of replaying provider calls","messagePattern":"\\[BATCH\\] Stale batch (.+?) has no item checkpoints; failing instead of replaying provider calls","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"open-sse/services/batchProcessor.ts","lineNumber":118,"sourceCode":"    } else if (batch.status === \"cancelling\") {\n      await cancelBatch(batch);\n    }\n  }\n\n  // Cleanup task: delete files for batches completed more than completionWindow ago\n  await cleanupExpiredBatches();\n}\n\nfunction recoverStaleBatch(batch: BatchRecord): void {\n  const checkpointCount = countBatchItemCheckpoints(batch.id);\n  const hasPotentialExternalEffects =\n    batch.requestCountsTotal > 0 ||\n    batch.requestCountsCompleted > 0 ||\n    batch.requestCountsFailed > 0 ||\n    batch.status === \"finalizing\";\n\n  if (checkpointCount === 0 && hasPotentialExternalEffects) {\n    console.warn(\n      `[BATCH] Stale batch ${batch.id} has no item checkpoints; failing instead of replaying provider calls`\n    );\n    failBatch(\n      batch.id,\n      \"Cannot safely recover stale batch because item checkpoints are unavailable; create a new batch to retry intentionally.\"\n    );\n    return;\n  }\n\n  console.log(`[BATCH] Recovering stale batch ${batch.id} (${batch.status}) → validating`);\n\n  if (batch.outputFileId) {\n    deleteFile(batch.outputFileId);\n  }\n  if (batch.errorFileId) {\n    deleteFile(batch.errorFileId);\n  }\n","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/services/batchProcessor.ts#L100-L136","documentation":"Error \"[BATCH] Stale batch ${batch.id} has no item checkpoints; failing instead of replaying provider calls\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at open-sse/services/batchProcessor.ts:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}