can1357/oh-my-pi · error · Error

run ${jobName} not found

Error message

run ${jobName} not found

What it means

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).

Source

Thrown at packages/metaharness/src/server.ts:444

			config: { ...request },
			role: request.role,
			note: request.note,
		});
		if (request.goal) this.#store.setExperimentGoal(experimentOf(jobName), request.goal);
		return { jobName, pid };
	}

	/**
	 * Resume a harbor run in place via the runner's `--resume`: completed
	 * trials (and their spend) are reused, interrupted/pending trials re-run,
	 * and errored trials are evicted for retry. The runner recovers the
	 * original launch flags from the run's recorded config, so nothing needs
	 * re-specifying. `filterErrorTypes` overrides the default retry set
	 * (every exception type recorded in the job's result.json).
	 */
	resume(jobName: string, opts: { filterErrorTypes?: string[] } = {}): { jobName: string; pid: number } {
		const run = this.#store.getRun(jobName);
		if (!run) throw new Error(`run ${jobName} not found`);
		if (run.benchmark !== "harbor")
			throw new Error(`resume supports only harbor runs (${jobName} is ${run.benchmark})`);
		// Trust liveness, not the recorded status: a runner killed while a
		// previous server instance owned it leaves a stale `running` row with a
		// dead (or null) pid and nobody to fire markExit.
		if (this.#runLive(run)) {
			throw new Error(`run ${jobName} is already running`);
		}
		if (run.status === "running") this.#store.markExit(jobName, null, true);
		const jobDir = path.join(this.jobsDir, jobName);
		if (!fs.existsSync(path.join(jobDir, "config.json"))) {
			throw new Error(`${jobName} has no harbor config.json to resume from`);
		}
		const argv = ["bun", "src/runner.ts", "--resume", jobName, "--jobs-dir", this.jobsDir];
		for (const t of opts.filterErrorTypes ?? erroredExceptionTypes(jobDir)) argv.push("--filter-error-type", t);
		let prewalk: LaunchRequest["prewalk"];
		try {
			prewalk = run.prewalk ? (JSON.parse(run.prewalk) as { into?: string }) : undefined;

View on GitHub (pinned to 9690622007)

Solutions

  1. List runs from the store and copy the exact jobName instead of typing it.
  2. Point the server at the same jobsDir/store the original launch used.
  3. If the run was never registered, launch it fresh instead of resuming.
  4. Check for typos/whitespace in the jobName argument.

Example fix

// before
server.resume("gpt-4o-2026-08-31 10.00.00"); // wrong separator
// after
const failed = server.listRuns().find(r => r.status === "failed");
server.resume(failed.jobName);
Defensive patterns

Strategy: validation

Validate before calling

const run = store.listRuns().find(r => r.jobName === jobName);
if (!run) throw new Error(`no run named '${jobName}'; pick one from listRuns()`);

Try / catch

try {
  server.resume(jobName);
} catch (err) {
  if (err instanceof Error && err.message.includes("not found")) {
    console.error(`Unknown run '${jobName}'. Available:`, store.listRuns().map(r => r.jobName));
  }
  throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/b98f315e26cfdecb. Report an issue: GitHub.