{"record":{"id":"d0f933636d327b73","repo":"abhigyanpatwari/GitNexus","slug":"embedbatch-failed-for-subtexts-length-texts","errorCode":null,"errorMessage":"⚠️ embedBatch failed for ${subTexts.length} texts (first: \"${subTexts[0]?.substring(0, 80)}...\") — dropping ${droppedNodeIds.size} node(s) from this run so the next run re-embeds them (${consecutiveSubBatchFailures}/${MAX_CONSECUTIVE_SUB_BATCH_FAILURES} consecutive, ${subBatchFailures}/${subBatchesAttempted} sub-batches failed this run):","messagePattern":"⚠️ embedBatch failed for (.+?) texts \\(first: \"(.+?)\\.\\.\\.\"\\) — dropping (.+?) node\\(s\\) from this run so the next run re-embeds them \\((.+?)/(.+?) consecutive, (.+?)/(.+?) sub-batches failed this run\\):","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/embeddings/embedding-pipeline.ts","lineNumber":846,"sourceCode":"        let embeddings: Float32Array[];\n        try {\n          embeddings = await embedBatch(subTexts, { signal: pipelineOptions.signal });\n        } catch (embedErr) {\n          // Never swallow a cancel as a \"tolerable\" failure — the operator asked\n          // us to stop, and the run has no business continuing (or deleting rows).\n          if (pipelineOptions.signal?.aborted || isCancellationError(embedErr)) throw embedErr;\n\n          // #2790: one transient hiccup used to discard an entire multi-hour run.\n          // Warn (not error — the run survives), drop this sub-batch's nodes, and\n          // keep going; the cleanup DELETE after this loop makes the drop safe.\n          const droppedNodeIds = new Set(subUpdates.map((u) => u.nodeId));\n          for (const nodeId of droppedNodeIds) batchFailedNodeIds.add(nodeId);\n          consecutiveSubBatchFailures += 1;\n          subBatchFailures += 1;\n          const streakError = (streakFirstError ??= { err: embedErr });\n          // Log under `err` so pino's standard serializer keeps the message and\n          // stack — the previous `{ embedErr }` key serialized to `{}` (#2114).\n          logger.warn(\n            { err: embedErr },\n            `⚠️ embedBatch failed for ${subTexts.length} texts (first: \"${subTexts[0]?.substring(0, 80)}...\") — ` +\n              `dropping ${droppedNodeIds.size} node(s) from this run so the next run re-embeds them ` +\n              `(${consecutiveSubBatchFailures}/${MAX_CONSECUTIVE_SUB_BATCH_FAILURES} consecutive, ` +\n              `${subBatchFailures}/${subBatchesAttempted} sub-batches failed this run):`,\n          );\n          if (consecutiveSubBatchFailures >= MAX_CONSECUTIVE_SUB_BATCH_FAILURES) {\n            // Bail out — but via `break`, not `throw`, so the cleanup DELETE below\n            // still runs: sub-batches that succeeded before the endpoint went dark\n            // left partial rows carrying the CURRENT hash, which is exactly the\n            // read-as-fresh corruption this path exists to prevent.\n            abortError = streakError;\n            break;\n          }\n          if (\n            subBatchesAttempted >= minSubBatchesForRatioGuard &&\n            subBatchFailures / subBatchesAttempted >= MAX_SUB_BATCH_FAILURE_RATIO\n          ) {","sourceCodeStart":828,"sourceCodeEnd":864,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/aac7515d2a8c50a1f8f923c6fb77218b333560d6/gitnexus/src/core/embeddings/embedding-pipeline.ts#L828-L864","documentation":"Error \"⚠️ embedBatch failed for ${subTexts.length} texts (first: \"${subTexts[0]?.substring(0, 80)}...\") — dropping ${droppedNodeIds.size} node(s) from this run so the next run re-embeds them (${consecutiveSubBatchFailures}/${MAX_CONSECUTIVE_SUB_BATCH_FAILURES} consecutive, ${subBatchFailures}/${subBatchesAttempted} sub-batches failed this run):\" thrown in abhigyanpatwari/GitNexus.","triggerScenarios":"Thrown at gitnexus/src/core/embeddings/embedding-pipeline.ts:846 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":"aac7515d2a8c50a1f8f923c6fb77218b333560d6","analyzedAt":"2026-08-20T23:29:22.980Z","contentChangedAt":"2026-08-20T23:29:22.980Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}