openai/codex-plugin-cc · error · Error
No job found for "${reference}". Run /codex:status to inspec
Error message
No job found for "${reference}". Run /codex:status to inspect known jobs. What it means
Thrown by buildSingleJobSnapshot() when matchJobReference returns null — i.e. a reference was given that matched nothing, OR no reference was given and the (unfiltered) job list is empty. Distinct from error 43: this fires from the single-job snapshot path and the recovery text says 'inspect known jobs'. Note matchJobReference only throws internally on ambiguity; for a plain miss it returns null, which this branch converts to an error.
Source
Thrown at plugins/codex/scripts/lib/job-control.mjs:247
.map((job) => enrichJob(job, { maxProgressLines }));
return {
workspaceRoot,
config,
sessionRuntime: getSessionRuntimeStatus(options.env, workspaceRoot),
running,
latestFinished,
recent,
needsReview: Boolean(config.stopReviewGate)
};
}
export function buildSingleJobSnapshot(cwd, reference, options = {}) {
const workspaceRoot = resolveWorkspaceRoot(cwd);
const jobs = sortJobsNewestFirst(listJobs(workspaceRoot));
const selected = matchJobReference(jobs, reference);
if (!selected) {
throw new Error(`No job found for "${reference}". Run /codex:status to inspect known jobs.`);
}
return {
workspaceRoot,
job: enrichJob(selected, { maxProgressLines: options.maxProgressLines })
};
}
export function resolveResultJob(cwd, reference) {
const workspaceRoot = resolveWorkspaceRoot(cwd);
const jobs = sortJobsNewestFirst(reference ? listJobs(workspaceRoot) : filterJobsForCurrentSession(listJobs(workspaceRoot)));
const selected = matchJobReference(
jobs,
reference,
(job) => job.status === "completed" || job.status === "failed" || job.status === "cancelled"
);
if (selected) {View on GitHub (pinned to db52e28f4d)
Solutions
- Run /codex:status (no arg) to enumerate known jobs and copy a valid id.
- If no jobs are listed, start a Codex job first so there is something to inspect.
- Verify the workspace root and that job state files exist under the jobs directory.
Example fix
// before buildSingleJobSnapshot(cwd, "old-id"); // after const snap = buildStatusSnapshot(cwd); const validId = (snap.running[0] ?? snap.recent[0] ?? snap.latestFinished)?.id; if (validId) buildSingleJobSnapshot(cwd, validId);
Defensive patterns
Strategy: validation
Validate before calling
function safeSingleJobSnapshot(cwd, reference) {
const jobs = listJobs(resolveWorkspaceRoot(cwd));
if (reference && !jobs.some((j) => j.id === reference || j.id.startsWith(reference))) {
return { error: 'not-found', knownIds: jobs.map((j) => j.id) };
}
if (!reference && jobs.length === 0) {
return { error: 'empty' };
}
return buildSingleJobSnapshot(cwd, reference);
} Try / catch
try {
buildSingleJobSnapshot(cwd, ref);
} catch (err) {
if (/No job found/.test(err.message)) {
buildStatusSnapshot(cwd, { all: true }); // show what exists
} else throw err;
} Prevention
- Check buildStatusSnapshot output for known ids before drilling into a single job.
- Confirm at least one job exists before calling with no reference.
- Validate the id against the current job list to give a richer not-found message.
When it happens
Trigger: Calling buildSingleJobSnapshot(cwd, ref) with a non-matching ref, or buildSingleJobSnapshot(cwd) with no reference when zero jobs exist in the workspace. The path is used by the /codex:status <job> detail command.
Common situations: Inspecting a job id from a prior/rotated session; typo in the id; querying before any Codex job has ever run in this repo; pointing --root at the wrong directory.
Related errors
- No job found for "${reference}". Run /codex:status to list k
- No finished job found for "${reference}". Run /codex:status
- No finished Codex jobs found for this repository yet.
- No active job found for "${reference}".
- Job reference "${reference}" is ambiguous. Use a longer job
AI-assisted analysis of openai/codex-plugin-cc@db52e28f4d (2026-08-13).
Data as JSON: /api/errors/9a19883a837b385f.
Report an issue: GitHub.