Egonex-AI/Understand-Anything · error
Retry batching failed: ${batching.error ?? batching.status}
Error message
Retry batching failed: ${batching.error ?? batching.status} What it means
The script spawns compute-batches.mjs as a child process to batch the retry files. If the child exits with a non-zero status, it throws this error embedding batching.error (spawn-level failure, e.g. ENOENT) or the numeric exit status. Child stderr is forwarded before throwing to aid diagnosis.
Source
Thrown at understand-anything-plugin/skills/understand/prepare-symbol-retry.mjs:47
throw new Error('Symbol retry already used for these commits; stop without advancing the baseline');
}
}
// Do not trust an old report or a caller-supplied list of files to replace.
const report = await validateIncrementalSymbols(projectRoot, { intermediateDir });
if (report.ok || report.unresolvedFiles.length === 0) {
throw new Error('No unresolved symbol files eligible for a targeted retry; inspect the symbol report');
}
const paths = new Set(report.unresolvedFiles);
const changedFilesPath = join(intermediateDir, 'incremental-symbol-retry-files.json');
const batchesPath = join(intermediateDir, 'incremental-symbol-retry-batches.json');
atomicWriteJson(changedFilesPath, [...paths]);
const skillDir = dirname(fileURLToPath(import.meta.url));
const batching = spawnSync(process.execPath, [
join(skillDir, 'compute-batches.mjs'), projectRoot,
`--changed-files=${changedFilesPath}`, `--output=${batchesPath}`,
], { encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
if (batching.stderr) process.stderr.write(batching.stderr);
if (batching.status !== 0) throw new Error(`Retry batching failed: ${batching.error ?? batching.status}`);
const batches = readJson(batchesPath).batches;
const scheduled = batches.flatMap(batch => batch.files.map(file => file.path));
if (JSON.stringify([...scheduled].sort()) !== JSON.stringify([...paths].sort())) {
throw new Error('Retry batches do not cover exactly the affected files');
}
for (const batch of batches) {
if (!Number.isInteger(batch.batchIndex) || batch.batchIndex < 1) throw new Error('Invalid retry batch index');
const files = new Set(batch.files.map(file => file.path));
batch.previousSymbols = baseline.files.filter(file => files.has(file.filePath)).flatMap(file =>
file.nodes.filter(symbolKind).map(node => {
const parents = new Set(file.edges.filter(edge => edge.type === 'contains' && edge.target === node.id)
.map(edge => edge.source));
const owners = file.nodes.filter(parent => parent.type === 'class' && parents.has(parent.id))
.map(parent => parent.name);
return {
id: node.id, name: node.name, type: node.type, filePath: node.filePath,
...(node.lineRange ? { lineRange: node.lineRange } : {}),
...(owners.length ? { owners } : {}),View on GitHub (pinned to 07edf82a04)
Solutions
- Read the stderr printed just before the error — it contains the child's actual failure message.
- Verify compute-batches.mjs exists next to prepare-symbol-retry.mjs and that the plugin install is intact (reinstall/re-copy the plugin if missing).
- Check the input file incremental-symbol-retry-files.json in the intermediate dir is valid JSON with the expected path array.
- Run compute-batches.mjs manually with the same arguments to reproduce and debug the child failure.
Example fix
// before $ node compute-batches.mjs . --changed-files=... Error: cannot read input (missing incremental-symbol-retry-files.json) // after: ensure prepare-symbol-retry ran its write step, then retry ls .ua/intermediate/incremental-symbol-retry-files.json # must exist node prepare-symbol-retry.mjs .
Defensive patterns
Strategy: try-catch
Validate before calling
import { existsSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const skillDir = dirname(fileURLToPath(import.meta.url));
if (!existsSync(join(skillDir, 'compute-batches.mjs'))) {
throw new Error('compute-batches.mjs missing; reinstall the plugin');
} Try / catch
const batching = spawnSync(process.execPath, [batchScript, projectRoot, ...args], { encoding: 'utf8' });
if (batching.error) throw new Error(`Batching spawn failed: ${batching.error.message}`);
if (batching.stderr) process.stderr.write(batching.stderr);
if (batching.status !== 0) {
throw new Error(`Retry batching failed (exit ${batching.status}); see stderr above`);
} Prevention
- Keep the whole skill directory intact — don't copy prepare-symbol-retry.mjs alone.
- Validate intermediate input JSON files before spawning the batcher.
- Reproduce child failures by running compute-batches.mjs manually with the same args.
When it happens
Trigger: compute-batches.mjs crashes or exits non-zero: a bug in batching logic, unreadable intermediate inputs (changed-files JSON), a thrown error inside the child, or spawn failure (missing script file, ENOENT on the interpreter).
Common situations: Corrupt or missing incremental-symbol-retry-files.json input; compute-batches.mjs failing on a malformed file entry; script moved/renamed so join(skillDir, 'compute-batches.mjs') points nowhere; memory/timeout kill yielding a signal-derived status.
Understand the failure class
Background: "git command failed": what it means when a tool shells out to git and git exits non-zero — this error's family across 21 libraries.
Related errors
- Retry batches do not cover exactly the affected files
- Invalid retry batch index
- Batch artifact does not match the required shape
- Symbol retry requires a partial or architecture incremental
- Symbol retry already used for these commits; stop without ad
AI-assisted analysis of Egonex-AI/Understand-Anything@07edf82a04 (2026-09-07).
Data as JSON: /api/errors/c2db03644d49d36f.
Report an issue: GitHub.