coleam00/Archon · warning
Status: Failed - ${err.message}
Error message
Status: Failed - ${err.message} What it means
isolationCleanupCommand prints this per-environment failure line when destroying a git worktree/execution environment fails during `archon isolation cleanup`. The underlying error is logged as 'worktree_destroy_failed' with the env id and path; the message surfaces err.message to the operator and the summary counts it as failed.
Source
Thrown at packages/cli/src/commands/isolation.ts:154
console.log(` Status: Skipped — run ${liveRun.id.slice(0, 8)} is ${liveRun.status}`);
skipped++;
continue;
}
try {
await provider.destroy(env.working_path, {
branchName: env.branch_name ? toBranchName(env.branch_name) : undefined,
canonicalRepoPath: toRepoPath(env.codebase_default_cwd),
});
await isolationDb.updateStatus(env.id, 'destroyed');
console.log(' Status: Cleaned');
cleaned++;
} catch (error) {
const err = error as Error;
getLog().warn({ err, envId: env.id, path: env.working_path }, 'worktree_destroy_failed');
console.error(` Status: Failed - ${err.message}`);
failed++;
}
}
console.log(
`\nCleanup complete: ${String(cleaned)} cleaned, ${String(skipped)} skipped, ${String(failed)} failed`
);
// Reap orphaned container environments (terminal / run-less, older than the
// threshold). Paused runs' containers are deliberately skipped (awaited state).
const containerReport = await cleanupContainerEnvironments(daysStale);
const containerTotal =
containerReport.removed.length + containerReport.skipped.length + containerReport.errors.length;
if (containerTotal > 0) {
console.log('\nContainer environments:');
for (const id of containerReport.removed) {
console.log(` Removed: ${id.slice(0, 8)}`);
}
for (const s of containerReport.skipped) {View on GitHub (pinned to 0773b97458)
Solutions
- Close processes holding the worktree open (check the logged path in 'worktree_destroy_failed'), then re-run cleanup
- If the directory is already gone, prune stale git metadata (git worktree prune) so Archon's records match disk
- Remove the directory manually with adequate permissions, then re-run cleanup to clear the record
- Re-run `archon isolation cleanup` — skipped/locked entries may succeed once the run has finished
Defensive patterns
Strategy: try-catch
Validate before calling
// before cleanup, verify the worktree path exists and is unused
if (!existsSync(env.working_path)) {
getLog().warn({ envId: env.id }, 'worktree_path_missing_before_destroy');
}
const { stdout } = Bun.spawnSync(['git', '-C', env.working_path, 'status', '--porcelain']);
const busy = stdout.toString().length === 0 && isProcessUsingPath(env.working_path); Type guard
function isFsError(err: unknown): err is NodeJS.ErrnoException {
return err instanceof Error && 'code' in err;
} Try / catch
try {
await destroyWorktree(env);
} catch (err) {
getLog().warn({ err, envId: env.id, path: env.working_path }, 'worktree_destroy_failed');
failed++;
} Prevention
- Close editors/dev servers/agent processes using the worktree before cleanup
- Do not delete worktree directories manually; let Archon manage them
- Run cleanup after runs have finished, not concurrently
- Re-run cleanup and reconcile against `git worktree list`
When it happens
Trigger: Running `archon isolation cleanup` when worktree destruction throws — the working_path no longer exists, permissions deny removal, files are held open/locked by a running process, or the git repo/worktree metadata is corrupt or already pruned.
Common situations: A workflow run still holds the worktree open (editor, dev server, agent process); the checkout was deleted manually out from under Archon; running cleanup without filesystem permissions; stale worktrees on an unmounted volume.
Related errors
- Error processing codebase: ${err.message}
- Failed to start detached workflow child (executable: ${cmd[0
- Error loading workflows: ${err.message} Hint: Check permissi
- Cannot resume: the working path from the run no longer exist
- Approved but failed to resume workflow '${result.workflowNam
AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01).
Data as JSON: /api/errors/516790315ab34c60.
Report an issue: GitHub.