openai/codex-plugin-cc · error · Error

Provide a prompt, a prompt file, piped stdin, or use --resum

Error message

Provide a prompt, a prompt file, piped stdin, or use --resume-last.

What it means

After the resume lookup, executeTaskRun requires either a prompt or a resumeThreadId. If resumeLast was true but resolved no thread (and that case already threw error 8), or if resumeLast was false and prompt is empty, this guard fires. It ensures runAppServerTurn always has something to send.

Source

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

  const taskMetadata = buildTaskRunMetadata({
    prompt: request.prompt,
    resumeLast: request.resumeLast
  });

  let resumeThreadId = null;
  if (request.resumeLast) {
    const latestThread = await resolveLatestTrackedTaskThread(workspaceRoot, {
      excludeJobId: request.jobId
    });
    if (!latestThread) {
      throw new Error("No previous Codex task thread was found for this repository.");
    }
    resumeThreadId = latestThread.id;
  }

  if (!request.prompt && !resumeThreadId) {
    throw new Error("Provide a prompt, a prompt file, piped stdin, or use --resume-last.");
  }

  const result = await runAppServerTurn(workspaceRoot, {
    resumeThreadId,
    prompt: request.prompt,
    defaultPrompt: resumeThreadId ? DEFAULT_CONTINUE_PROMPT : "",
    model: request.model,
    effort: request.effort,
    sandbox: request.write ? "workspace-write" : "read-only",
    onProgress: request.onProgress,
    persistThread: true,
    threadName: resumeThreadId ? null : buildPersistentTaskThreadName(request.prompt || DEFAULT_CONTINUE_PROMPT)
  });

  const rawOutput = typeof result.finalMessage === "string" ? result.finalMessage : "";
  const failureMessage = result.error?.message ?? result.stderr ?? "";
  const rendered = renderTaskResult(
    {

View on GitHub (pinned to db52e28f4d)

Solutions

  1. Provide a prompt as a positional argument, via --prompt-file, or through piped stdin.
  2. Use --resume-last to continue a prior task instead of a new prompt.
  3. If using --prompt-file, confirm the file exists and is non-empty (readTaskPrompt would throw on missing file separately).

Example fix

// before
codex-companion.mjs task
// after
codex-companion.mjs task "refactor the parser"
Defensive patterns

Strategy: validation

Validate before calling

if (!prompt && !resumeThreadId) {
  throw new Error('prompt or resume required');
}

Prevention

When it happens

Trigger: Foreground `task` invocation with no positional prompt, no --prompt-file, no piped stdin, and --resume-last either omitted or resolving to nothing. Note: for foreground tasks this check runs inside executeTaskRun, after the background path's requireTaskRequest would already have caught it.

Common situations: Empty invocation, stdin not actually piped (readStdinIfPiped returns empty when not a TTY-less pipe), or a prompt-file that is empty.

Related errors


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