openai/codex-plugin-cc · warning · Error

No active Codex jobs to cancel.

Error message

No active Codex jobs to cancel.

What it means

Thrown by resolveCancelableJob() when no reference is supplied, no session id is present (getCurrentSessionId falsy), and there are zero active jobs repo-wide. It is the global 'nothing to cancel' terminal state — the broadest of the cancel not-found errors.

Source

Thrown at plugins/codex/scripts/lib/job-control.mjs:307

      throw new Error(`No active job found for "${reference}".`);
    }
    return { workspaceRoot, job: selected };
  }

  const sessionScopedActiveJobs = filterJobsForCurrentSession(activeJobs, options);

  if (sessionScopedActiveJobs.length === 1) {
    return { workspaceRoot, job: sessionScopedActiveJobs[0] };
  }
  if (sessionScopedActiveJobs.length > 1) {
    throw new Error("Multiple Codex jobs are active. Pass a job id to /codex:cancel.");
  }

  if (getCurrentSessionId(options)) {
    throw new Error("No active Codex jobs to cancel for this session.");
  }

  throw new Error("No active Codex jobs to cancel.");
}

View on GitHub (pinned to db52e28f4d)

Solutions

  1. Run /codex:status to verify there are no active jobs (nothing to cancel).
  2. Start a Codex job first if cancellation was expected to interrupt work.
  3. If you believe a job is hung, confirm via /codex:status that it is still tracked as active.

Example fix

// before
resolveCancelableJob(cwd); // nothing active repo-wide

// after
const snap = buildStatusSnapshot(cwd);
if (snap.running.length === 0) {
  console.log("No active jobs to cancel.");
} else {
  resolveCancelableJob(cwd, snap.running[0].id);
}
Defensive patterns

Strategy: validation

Validate before calling

function repoHasActiveJobs(jobs) {
  return jobs.some((j) => ["queued", "running"].includes(j.status));
}

if (!repoHasActiveJobs(listJobs(workspaceRoot))) {
  console.log("No active jobs repo-wide — nothing to cancel.");
}

Try / catch

try {
  resolveCancelableJob(cwd);
} catch (err) {
  if (/No active Codex jobs to cancel/.test(err.message)) {
    console.log(err.message); // benign terminal state
  } else throw err;
}

Prevention

When it happens

Trigger: Calling resolveCancelableJob(cwd) with no reference and no session context when the entire job list has no queued or running jobs. Bare /codex:cancel outside any session with nothing live.

Common situations: Calling cancel before any job was started; all jobs already finished; running in an environment where session id is unavailable so session scoping is skipped and the global set is empty.

Related errors


AI-assisted analysis of openai/codex-plugin-cc@db52e28f4d (2026-08-13). Data as JSON: /api/errors/a6f891a33d0b1e99. Report an issue: GitHub.