{"record":{"id":"e74a31ebe3c3caf4","repo":"openai/codex-plugin-cc","slug":"missing-required-job-id-for-task-worker","errorCode":null,"errorMessage":"Missing required --job-id for task-worker.","messagePattern":"Missing required --job-id for task-worker\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugins/codex/scripts/codex-companion.mjs","lineNumber":844,"sourceCode":"  const { options } = parseCommandInput(argv, {\n    valueOptions: [\"cwd\", \"source\"],\n    booleanOptions: [\"json\"]\n  });\n\n  const cwd = resolveCommandCwd(options);\n  const { payload, rendered } = await executeTransfer(cwd, {\n    source: options.source\n  });\n  outputCommandResult(payload, rendered, options.json);\n}\n\nasync function handleTaskWorker(argv) {\n  const { options } = parseCommandInput(argv, {\n    valueOptions: [\"cwd\", \"job-id\"]\n  });\n\n  if (!options[\"job-id\"]) {\n    throw new Error(\"Missing required --job-id for task-worker.\");\n  }\n\n  const cwd = resolveCommandCwd(options);\n  const workspaceRoot = resolveCommandWorkspace(options);\n  const storedJob = readStoredJob(workspaceRoot, options[\"job-id\"]);\n  if (!storedJob) {\n    throw new Error(`No stored job found for ${options[\"job-id\"]}.`);\n  }\n\n  const request = storedJob.request;\n  if (!request || typeof request !== \"object\") {\n    throw new Error(`Stored job ${options[\"job-id\"]} is missing its task request payload.`);\n  }\n\n  const { logFile, progress } = createTrackedProgress(\n    {\n      ...storedJob,\n      workspaceRoot","sourceCodeStart":826,"sourceCodeEnd":862,"githubUrl":"https://github.com/openai/codex-plugin-cc/blob/db52e28f4d9ded852ab3942cea316258ae4ef346/plugins/codex/scripts/codex-companion.mjs#L826-L862","documentation":"handleTaskWorker is the detached background worker entrypoint spawned by spawnDetachedTaskWorker. It requires --job-id to load the stored job that contains the task request. Without it there is nothing to execute. The value options parsed are only cwd and job-id.","triggerScenarios":"The worker is normally spawned internally with --job-id; this error surfaces if someone invokes task-worker manually without --job-id, or if spawnDetachedTaskWorker's argument construction is broken so job.id is empty.","commonSituations":"Manual debugging of the worker subprocess, or a bug in enqueueBackgroundTask where job.id is undefined and the spawned argv lacks a value.","solutions":["Do not invoke task-worker directly; it is an internal subcommand launched by the background task path.","If debugging, pass a valid --job-id that exists in the workspace state: task-worker --cwd <path> --job-id <id>.","Ensure spawnDetachedTaskWorker receives a non-empty jobId from buildTaskJob/generateJobId."],"exampleFix":"// before\ncodex-companion.mjs task-worker\n// after\ncodex-companion.mjs task-worker --cwd /repo --job-id task-abc123","handlingStrategy":"validation","validationCode":"if (!options['job-id']) throw new Error('--job-id required');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat task-worker as internal; do not invoke manually without --job-id.","Assert job.id is non-empty before spawning the worker."],"tags":["cli","validation","worker","missing-argument"],"backgroundTag":null,"analyzedSha":"db52e28f4d9ded852ab3942cea316258ae4ef346","analyzedAt":"2026-08-13T05:13:20.855Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}