openai/codex-plugin-cc · error · Error

Multiple Codex jobs are active. Pass a job id to /codex:canc

Error message

Multiple Codex jobs are active. Pass a job id to /codex:cancel.

What it means

Thrown by resolveCancelableJob() when no reference is supplied and more than one active job exists in the current session. The function refuses to pick one arbitrarily; it demands disambiguation. Guards against cancelling the wrong job.

Source

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

  const workspaceRoot = resolveWorkspaceRoot(cwd);
  const jobs = sortJobsNewestFirst(listJobs(workspaceRoot));
  const activeJobs = jobs.filter((job) => job.status === "queued" || job.status === "running");

  if (reference) {
    const selected = matchJobReference(activeJobs, reference);
    if (!selected) {
      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. Pass the specific job id: /codex:cancel <id> (find it via /codex:status).
  2. If you genuinely want to stop all of them, cancel each by id in turn.
  3. Avoid launching overlapping jobs in the same session, or always pass an explicit id.

Example fix

// before
resolveCancelableJob(cwd); // >1 active

// after
resolveCancelableJob(cwd, "abc123");
Defensive patterns

Strategy: validation

Validate before calling

function activeJobCount(jobs, options) {
  return filterJobsForCurrentSession(
    jobs.filter((j) => ["queued", "running"].includes(j.status)),
    options
  ).length;
}

const n = activeJobCount(listJobs(workspaceRoot), options);
if (n > 1) {
  throw new Error(`${n} active jobs — pass a specific id to disambiguate.`);
}

Try / catch

try {
  resolveCancelableJob(cwd);
} catch (err) {
  if (/Multiple Codex jobs are active/.test(err.message)) {
    const snap = buildStatusSnapshot(cwd);
    console.log(snap.running.map((j) => j.id).join("\n")); // present choice
  } else throw err;
}

Prevention

When it happens

Trigger: Calling resolveCancelableJob(cwd) (no ref) — i.e. `/codex:cancel` with no id — when two or more jobs in the session are queued or running.

Common situations: Multiple parallel Codex jobs launched in one session; a prior job left lingering in queued state while a new one started; forgetting to pass the job id to /codex:cancel.

Related errors


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