Skip to content

Add task --resume-thread <id> for explicit thread resume#475

Open
Guardiannw wants to merge 1 commit into
openai:mainfrom
Guardiannw:task-resume-thread
Open

Add task --resume-thread <id> for explicit thread resume#475
Guardiannw wants to merge 1 commit into
openai:mainfrom
Guardiannw:task-resume-thread

Conversation

@Guardiannw

Copy link
Copy Markdown

Summary

Adds task --resume-thread <id> so callers can resume an explicit Codex thread instead of the newest tracked one.

--resume / --resume-last picks the most recent tracked task thread, which is ambiguous for orchestrators driving several concurrent Codex jobs in one repository: which thread gets resumed depends on job-store state and session scoping rather than the caller's intent. The app-server layer already supports targeting a thread (runAppServerTurn's resumeThreadId); this exposes it on the task subcommand so a caller that recorded a threadId from a previous run (task --json) can continue that exact conversation deterministically.

Changes

  • task --resume-thread <id> resumes the given thread (foreground and --background; the worker path serializes resumeThreadId through the stored request).
  • Conflicts with --resume / --resume-last / --fresh are rejected with a clear error.
  • A prompt remains optional, matching --resume-last semantics (the default continue-prompt is used when none is given).

Tests

  • task --resume-thread resumes the specified thread — round 1 task --json captures a threadId, round 2 resumes it and asserts the same thread + continued output.
  • task --resume-thread rejects --resume-last and --fresh.
  • Full existing suite green (npm test): 93 passing.

Motivation

We drive Codex as a multi-round peer reviewer from Claude Code. Round 1 records the threadId from task --json; subsequent rounds need to resume that thread. Today the only CLI path is --resume-last, which is a heuristic; under any concurrency it can resume the wrong conversation. This flag makes the common "continue the thread I just started" case explicit and deterministic, using machinery the app-server already exposes.

--resume/--resume-last picks the newest tracked task thread, which is
ambiguous for orchestrators driving several concurrent Codex jobs in one
repository: the thread that gets resumed depends on job-store state and
session scoping rather than the caller's intent. The app-server layer
already supports targeting a thread (runAppServerTurn resumeThreadId);
this exposes it on the task subcommand so callers that recorded a
threadId from a previous run (task --json) can continue that exact
conversation.

- task --resume-thread <id> resumes the given thread (foreground and
  --background; the worker path serializes resumeThreadId through the
  stored request)
- conflicts with --resume/--resume-last/--fresh are rejected
- a prompt remains optional, matching --resume-last semantics

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Guardiannw Guardiannw requested a review from a team July 11, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant