openai/codex-plugin-cc · error · Error

Stored job ${options["job-id"]} is missing its task request

Error message

Stored job ${options["job-id"]} is missing its task request payload.

What it means

Even when a stored job file exists, it must contain a request object (the task payload written by enqueueBackgroundTask as queuedRecord.request). If request is null/undefined or not an object, the worker has no prompt/model/effort to run with, so it aborts. This indicates a corrupted or incomplete job file.

Source

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

async function handleTaskWorker(argv) {
  const { options } = parseCommandInput(argv, {
    valueOptions: ["cwd", "job-id"]
  });

  if (!options["job-id"]) {
    throw new Error("Missing required --job-id for task-worker.");
  }

  const cwd = resolveCommandCwd(options);
  const workspaceRoot = resolveCommandWorkspace(options);
  const storedJob = readStoredJob(workspaceRoot, options["job-id"]);
  if (!storedJob) {
    throw new Error(`No stored job found for ${options["job-id"]}.`);
  }

  const request = storedJob.request;
  if (!request || typeof request !== "object") {
    throw new Error(`Stored job ${options["job-id"]} is missing its task request payload.`);
  }

  const { logFile, progress } = createTrackedProgress(
    {
      ...storedJob,
      workspaceRoot
    },
    {
      logFile: storedJob.logFile ?? null
    }
  );
  await runTrackedJob(
    {
      ...storedJob,
      workspaceRoot,
      logFile
    },
    () =>

View on GitHub (pinned to db52e28f4d)

Solutions

  1. Re-enqueue the task to write a complete job record with the request payload.
  2. Inspect the job file in the state directory to confirm it has a request object; repair or delete it.
  3. Ensure writeJobFile/upsertJob in enqueueBackgroundTask always include the request field.

Example fix

// before (job file has no request)
// state file: { "id": "task-abc", "status": "queued" }
// after: re-enqueue so the record includes request
codex-companion.mjs task --background "prompt"
Defensive patterns

Strategy: type-guard

Validate before calling

if (!storedJob.request || typeof storedJob.request !== 'object') {
  throw new Error('job record missing request');
}

Type guard

/** @param {object} j @returns {j is {request: object}} */
function hasTaskRequest(j) {
  return j != null && j.request != null && typeof j.request === 'object';
}

Prevention

When it happens

Trigger: The job file was written without a request field (e.g. an older version of the code, a manual edit, or a partially-written file from a crash during writeJobFile). Also if a non-task job file is mistakenly loaded by task-worker.

Common situations: Version mismatch where older job records lack request; filesystem corruption; a race where the file is read before the request field is flushed.

Related errors


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