openai/codex-plugin-cc · error · Error

`status --wait` requires a job id.

Error message

`status --wait` requires a job id.

What it means

handleStatus supports listing all jobs (no positional) or targeting one job (positional reference). The --wait flag triggers polling via waitForSingleJobSnapshot, which requires a single job reference to poll. Waiting on the entire list is undefined, so --wait without a positional is rejected before the list report is built.

Source

Thrown at plugins/codex/scripts/codex-companion.mjs:903

    valueOptions: ["cwd", "timeout-ms", "poll-interval-ms"],
    booleanOptions: ["json", "all", "wait"]
  });

  const cwd = resolveCommandCwd(options);
  const reference = positionals[0] ?? "";
  if (reference) {
    const snapshot = options.wait
      ? await waitForSingleJobSnapshot(cwd, reference, {
          timeoutMs: options["timeout-ms"],
          pollIntervalMs: options["poll-interval-ms"]
        })
      : buildSingleJobSnapshot(cwd, reference);
    outputCommandResult(snapshot, renderJobStatusReport(snapshot.job), options.json);
    return;
  }

  if (options.wait) {
    throw new Error("`status --wait` requires a job id.");
  }

  const report = buildStatusSnapshot(cwd, { all: options.all });
  outputResult(renderStatusPayload(report, options.json), options.json);
}

function handleResult(argv) {
  const { options, positionals } = parseCommandInput(argv, {
    valueOptions: ["cwd"],
    booleanOptions: ["json"]
  });

  const cwd = resolveCommandCwd(options);
  const reference = positionals[0] ?? "";
  const { workspaceRoot, job } = resolveResultJob(cwd, reference);
  const storedJob = readStoredJob(workspaceRoot, job.id);
  const payload = {
    job,

View on GitHub (pinned to db52e28f4d)

Solutions

  1. Provide a job id: status <job-id> --wait.
  2. Drop --wait to get an immediate snapshot of all jobs: status.
  3. Use --timeout-ms and --poll-interval-ms to tune the wait for a specific job.

Example fix

// before
codex-companion.mjs status --wait
// after
codex-companion.mjs status task-abc123 --wait
Defensive patterns

Strategy: validation

Validate before calling

if (options.wait && !reference) throw new Error('status --wait needs a job id');

Prevention

When it happens

Trigger: Running `status --wait` with no job id. The guard sits after the reference-present branch (which would have used --wait correctly) and before the all-jobs snapshot.

Common situations: User expects --wait to block until all jobs finish; muscle memory from other CLIs where wait blocks globally.

Related errors


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