Yeachan-Heo/oh-my-codex · error · Error
autoresearch_resume_missing_worktree
autoresearch_resume_missing_worktree
Error message
autoresearch_resume_missing_worktree:${manifest.worktree_path} What it means
resumeAutoresearchRuntime throws (code autoresearch_resume_missing_worktree) when the worktree directory recorded in the manifest no longer exists on disk. The run is nominally still 'running' but its working directory was deleted, so resume cannot continue in place.
Source
Thrown at src/autoresearch/runtime.ts:974
ledgerFile,
latestEvaluatorFile,
resultsFile,
stateFile,
candidateFile,
repoRoot: projectRoot,
worktreePath,
taskDescription,
};
}
export async function resumeAutoresearchRuntime(projectRoot: string, runId: string): Promise<PreparedAutoresearchRuntime> {
await assertAutoresearchLockAvailable(projectRoot);
const manifest = await loadAutoresearchRunManifest(projectRoot, runId);
if (manifest.status !== 'running') {
throw new Error(`autoresearch_resume_terminal_run:${runId}`);
}
if (!existsSync(manifest.worktree_path)) {
throw new Error(`autoresearch_resume_missing_worktree:${manifest.worktree_path}`);
}
await ensureRuntimeExcludes(manifest.worktree_path);
await ensureAutoresearchWorktreeDependencies(projectRoot, manifest.worktree_path);
assertResetSafeWorktree(manifest.worktree_path);
await startMode('autoresearch', `autoresearch resume ${runId}`, 1, projectRoot);
await activateAutoresearchRun(manifest);
await updateModeState('autoresearch', {
current_phase: 'running',
run_id: manifest.run_id,
run_tag: manifest.run_tag,
mission_dir: manifest.mission_dir,
mission_file: manifest.mission_file,
sandbox_file: manifest.sandbox_file,
mission_slug: manifest.mission_slug,
repo_root: manifest.repo_root,
worktree_path: manifest.worktree_path,
baseline_commit: manifest.baseline_commit,
last_kept_commit: manifest.last_kept_commit,View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Check whether manifest.worktree_path (printed in the message) exists; if it was merely moved, recreate it at that exact path or update the manifest carefully
- If deleted, the run cannot be resumed in place — start a new autoresearch run from the repo root
- Prevent recurrence: keep worktrees out of temp directories and avoid `git worktree prune` while runs are paused
- If resuming on another machine, first restore the .omx state and worktree to identical paths
Defensive patterns
Strategy: validation
Validate before calling
import { existsSync } from 'node:fs';
const manifest = await loadAutoresearchRunManifest(repoRoot, runId);
if (!existsSync(manifest.worktree_path)) {
throw new Error(`Worktree ${manifest.worktree_path} missing; run cannot be resumed.`);
} Try / catch
try { await resumeAutoresearchRuntime(repoRoot, runId); }
catch (e) { if (e instanceof Error && e.message.startsWith('autoresearch_resume_missing_worktree')) { /* recreate worktree at the recorded path or start a new run */ } throw e; } Prevention
- Keep autoresearch worktrees out of /tmp and OS-cleaned directories
- Never run `git worktree prune` while runs are paused
- Resume on the same machine/clone where the run started
When it happens
Trigger: Calling resumeAutoresearchRuntime when manifest.worktree_path has been removed — manual cleanup of worktree directories, `git worktree prune`, OS temp-dir cleaners, or a checkout on another machine that never had the worktree.
Common situations: Disk cleanup tools removing .omx worktrees, running `git worktree prune` while a run is paused, resuming on a different machine/clone, or the worktree path living under /tmp and being wiped on reboot.
Related errors
- autoresearch_resume_terminal_run
- autoresearch_worktree_requires_named_mode
- No autoresearch-goal mission found at ${repoRelative(cwd, pa
- Invalid autoresearch-goal mission at ${repoRelative(cwd, pat
- Autoresearch goal ${mission.slug} is already complete; creat
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/037c13ec621e39d2.
Report an issue: GitHub.