{"record":{"id":"a6343508238b3159","repo":"Yeachan-Heo/oh-my-codex","slug":"autoresearch-candidate-missing-candidatefile","errorCode":null,"errorMessage":"autoresearch_candidate_missing:${candidateFile}","messagePattern":"autoresearch_candidate_missing:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/autoresearch/runtime.ts","lineNumber":1062,"sourceCode":"  if (!Array.isArray(record.notes) || record.notes.some((note) => typeof note !== 'string')) {\n    throw new Error('autoresearch candidate artifact notes must be a string array');\n  }\n  if (typeof record.created_at !== 'string' || !record.created_at.trim()) {\n    throw new Error('autoresearch candidate artifact created_at is required');\n  }\n  return {\n    status,\n    candidate_commit: record.candidate_commit,\n    base_commit: record.base_commit,\n    description: record.description,\n    notes: record.notes,\n    created_at: record.created_at,\n  };\n}\n\nasync function readCandidateArtifact(candidateFile: string): Promise<AutoresearchCandidateArtifact> {\n  if (!existsSync(candidateFile)) {\n    throw new Error(`autoresearch_candidate_missing:${candidateFile}`);\n  }\n  return parseAutoresearchCandidateArtifact(await readFile(candidateFile, 'utf-8'));\n}\n\nasync function finalizeRun(\n  manifest: AutoresearchRunManifest,\n  projectRoot: string,\n  updates: { status: AutoresearchRunStatus; stopReason: string },\n): Promise<void> {\n  manifest.status = updates.status;\n  manifest.stop_reason = updates.stopReason;\n  manifest.completed_at = nowIso();\n  await writeRunManifest(manifest);\n  await updateModeState('autoresearch', {\n    active: false,\n    current_phase: updates.status,\n    completed_at: manifest.completed_at,\n    stop_reason: updates.stopReason,","sourceCodeStart":1044,"sourceCodeEnd":1080,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/autoresearch/runtime.ts#L1044-L1080","documentation":"readCandidateArtifact loads the candidate artifact file recorded in the run manifest, and this error means that file does not exist on disk. The path is embedded in the message so you can see exactly which file is missing. It typically indicates the run directory was partially deleted or the artifact was never written.","triggerScenarios":"Calling readCandidateArtifact(candidateFile) (via resume/finalize flows) when existsSync(candidateFile) is false — e.g. the run dir was cleaned, the file was renamed, or an interrupted run never produced a candidate artifact.","commonSituations":"Manually pruning .autoresearch run directories, syncing a repo without untracked artifact files, or resuming a run that aborted before the candidate step completed.","solutions":["Check the path in the error message and the run manifest's candidate_file field; restore or recreate the file","If the run never completed, start a new autoresearch run rather than resuming the broken one","Ensure run directories are not excluded by .gitignore/cleanup tools if you intend to resume them"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"import { existsSync } from 'fs';\nif (!existsSync(candidateFile)) { /* start a new run or restore the file */ }","typeGuard":null,"tryCatchPattern":"try { await readCandidateArtifact(file); } catch (e) { if ((e as Error).message.startsWith('autoresearch_candidate_missing:')) { /* re-run or skip resume */ } throw e; }","preventionTips":["Don't prune run directories you intend to resume","Check the manifest's candidate_file field before resuming"],"tags":["autoresearch","file-not-found","filesystem","run-state"],"backgroundTag":"file-not-found","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}