openai/codex-plugin-cc · error · Error
Missing required --job-id for task-worker.
Error message
Missing required --job-id for task-worker.
What it means
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.
Source
Thrown at plugins/codex/scripts/codex-companion.mjs:844
const { options } = parseCommandInput(argv, {
valueOptions: ["cwd", "source"],
booleanOptions: ["json"]
});
const cwd = resolveCommandCwd(options);
const { payload, rendered } = await executeTransfer(cwd, {
source: options.source
});
outputCommandResult(payload, rendered, options.json);
}
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,
workspaceRootView on GitHub (pinned to db52e28f4d)
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.
Example fix
// before codex-companion.mjs task-worker // after codex-companion.mjs task-worker --cwd /repo --job-id task-abc123
Defensive patterns
Strategy: validation
Validate before calling
if (!options['job-id']) throw new Error('--job-id required'); Prevention
- Treat task-worker as internal; do not invoke manually without --job-id.
- Assert job.id is non-empty before spawning the worker.
When it happens
Trigger: 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.
Common situations: Manual debugging of the worker subprocess, or a bug in enqueueBackgroundTask where job.id is undefined and the spawned argv lacks a value.
Related errors
- Provide a prompt, a prompt file, piped stdin, or use --resum
- Missing required --endpoint.
- Unsupported reasoning effort "${effort}". Use one of: none,
- Choose either --enable-review-gate or --disable-review-gate.
- This `/codex:review` target is not supported by the built-in
AI-assisted analysis of openai/codex-plugin-cc@db52e28f4d (2026-08-13).
Data as JSON: /api/errors/e74a31ebe3c3caf4.
Report an issue: GitHub.