Fission-AI/OpenSpec · error
Could not retire capability '${update.id}': failed to delete
Error message
Could not retire capability '${update.id}': failed to delete ${update.target} (${(error as Error).message}). Remove it by hand, then rerun the archive. What it means
Error "Could not retire capability '${update.id}': failed to delete ${update.target} (${(error as Error).message}). Remove it by hand, then rerun the archive." thrown in Fission-AI/OpenSpec.
Source
Thrown at src/core/specs-apply.ts:870
await fs.lstat(update.target);
throw new Error(
`${error instanceof Error ? error.message : String(error)} ` +
`A concurrent file now occupies ${update.target}; the displaced spec was retained at ${displaced}.`
);
} catch (targetError) {
if ((targetError as NodeJS.ErrnoException).code !== 'ENOENT') throw targetError;
}
await fs.rename(displaced, update.target);
throw error;
}
} else {
await fs.unlink(update.target);
}
} catch (error) {
if ((error as NodeJS.ErrnoException).code === 'ENOENT') return { retired: false };
// A bare errno here reads as an internal failure; say what was being
// attempted so the message is actionable on its own.
throw new Error(
`Could not retire capability '${update.id}': failed to delete ${update.target} ` +
`(${(error as Error).message}). Remove it by hand, then rerun the archive.`
);
}
if (!options.deferDelete) {
await pruneEmptyDirs(path.dirname(update.target), mainSpecsDir);
}
const nominal = options.displayPath ?? `openspec/specs/${update.id}/spec.md`;
if (!options.silent) {
console.log(`Retiring ${nominal}: all requirements removed.`);
}
// `resolvedPath` is always the file that was actually unlinked - callers need
// it to report a path git will accept, since the nominal one is built from
// the capability id and can differ in case, or point through a symlink.
return {
retired: true,View on GitHub (pinned to 6926ccb18a)
When it happens
Trigger: Thrown at src/core/specs-apply.ts:870 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25).
Data as JSON: /api/errors/2bcb679f2e4211c1.
Report an issue: GitHub.