{"record":{"id":"b98f315e26cfdecb","repo":"can1357/oh-my-pi","slug":"run-jobname-not-found","errorCode":null,"errorMessage":"run ${jobName} not found","messagePattern":"run (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/metaharness/src/server.ts","lineNumber":444,"sourceCode":"\t\t\tconfig: { ...request },\n\t\t\trole: request.role,\n\t\t\tnote: request.note,\n\t\t});\n\t\tif (request.goal) this.#store.setExperimentGoal(experimentOf(jobName), request.goal);\n\t\treturn { jobName, pid };\n\t}\n\n\t/**\n\t * Resume a harbor run in place via the runner's `--resume`: completed\n\t * trials (and their spend) are reused, interrupted/pending trials re-run,\n\t * and errored trials are evicted for retry. The runner recovers the\n\t * original launch flags from the run's recorded config, so nothing needs\n\t * re-specifying. `filterErrorTypes` overrides the default retry set\n\t * (every exception type recorded in the job's result.json).\n\t */\n\tresume(jobName: string, opts: { filterErrorTypes?: string[] } = {}): { jobName: string; pid: number } {\n\t\tconst run = this.#store.getRun(jobName);\n\t\tif (!run) throw new Error(`run ${jobName} not found`);\n\t\tif (run.benchmark !== \"harbor\")\n\t\t\tthrow new Error(`resume supports only harbor runs (${jobName} is ${run.benchmark})`);\n\t\t// Trust liveness, not the recorded status: a runner killed while a\n\t\t// previous server instance owned it leaves a stale `running` row with a\n\t\t// dead (or null) pid and nobody to fire markExit.\n\t\tif (this.#runLive(run)) {\n\t\t\tthrow new Error(`run ${jobName} is already running`);\n\t\t}\n\t\tif (run.status === \"running\") this.#store.markExit(jobName, null, true);\n\t\tconst jobDir = path.join(this.jobsDir, jobName);\n\t\tif (!fs.existsSync(path.join(jobDir, \"config.json\"))) {\n\t\t\tthrow new Error(`${jobName} has no harbor config.json to resume from`);\n\t\t}\n\t\tconst argv = [\"bun\", \"src/runner.ts\", \"--resume\", jobName, \"--jobs-dir\", this.jobsDir];\n\t\tfor (const t of opts.filterErrorTypes ?? erroredExceptionTypes(jobDir)) argv.push(\"--filter-error-type\", t);\n\t\tlet prewalk: LaunchRequest[\"prewalk\"];\n\t\ttry {\n\t\t\tprewalk = run.prewalk ? (JSON.parse(run.prewalk) as { into?: string }) : undefined;","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/metaharness/src/server.ts#L426-L462","documentation":"resume() looks up the named run in the uniform run store before doing anything; if store.getRun(jobName) returns nothing, there is no recorded run to resume. This error means the job name passed to resume() does not match any run the manager has registered (including completed, failed, or interrupted ones).","triggerScenarios":"Typo in jobName when calling resume(); resuming a run launched by a different server instance pointed at a different jobsDir/store; the job directory was deleted so the run never got registered; calling resume on a run name that only exists in an old store file.","commonSituations":"Hand-typing job names that embed timestamps (e.g. 'gpt-4o-2026-08-31T10-00-00'); switching JOBS_DIR between invocations; cleaning the jobs directory while keeping scripts that resume old names.","solutions":["List runs from the store and copy the exact jobName instead of typing it.","Point the server at the same jobsDir/store the original launch used.","If the run was never registered, launch it fresh instead of resuming.","Check for typos/whitespace in the jobName argument."],"exampleFix":"// before\nserver.resume(\"gpt-4o-2026-08-31 10.00.00\"); // wrong separator\n// after\nconst failed = server.listRuns().find(r => r.status === \"failed\");\nserver.resume(failed.jobName);","handlingStrategy":"validation","validationCode":"const run = store.listRuns().find(r => r.jobName === jobName);\nif (!run) throw new Error(`no run named '${jobName}'; pick one from listRuns()`);","typeGuard":null,"tryCatchPattern":"try {\n  server.resume(jobName);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"not found\")) {\n    console.error(`Unknown run '${jobName}'. Available:`, store.listRuns().map(r => r.jobName));\n  }\n  throw err;\n}","preventionTips":["Never hand-type timestamped job names — always select from listRuns().","Ensure every server invocation uses the same jobsDir/store path.","Don't delete job directories that resume scripts may still reference.","Store chosen jobName in a manifest file for later resume steps."],"tags":["lookup","missing-data","naming"],"backgroundTag":"resource-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}