feat(task): add --resume-id <threadId> option for explicit thread resumption#231
feat(task): add --resume-id <threadId> option for explicit thread resumption#231hirotomoyamada wants to merge 5 commits intoopenai:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04b059a3e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76c0aae9f9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ce86d41f8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 943aab3340
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const effort = normalizeReasoningEffort(options.effort); | ||
| const prompt = readTaskPrompt(cwd, options, positionals); | ||
|
|
||
| const resumeId = typeof options["resume-id"] === "string" ? options["resume-id"] : null; |
There was a problem hiding this comment.
Reject flag-like values for --resume-id
handleTask accepts any string from options["resume-id"] without checking whether it is actually another flag token, so task --resume-id --fresh is parsed as resumeId="--fresh" and fresh=false. That bypasses the mutual-exclusion guard and runs as a resume against an invalid thread ID, producing a confusing downstream failure instead of an immediate argument error. Validate --resume-id values (or require --resume-id=<id>) before building the request.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in dc006ef — now rejects flag-like values:
if (rawResumeId && rawResumeId.startsWith("-")) {
throw new Error(`Invalid --resume-id value: "${rawResumeId}". Provide a thread ID, not a flag.`);
}task --resume-id --fresh now throws immediately instead of silently consuming --fresh as a thread ID.
Summary
--resume-id <threadId>value option to thetaskcommand for resuming a specific thread by ID--resume(boolean) and--resume-lastbehavior is unchangedUsing a separate
--resume-idflag instead of overloading--resumepreserves backward compatibility with the rescue command routing that uses bare--resumeas a boolean continue signal.Closes #230
Changes
handleTask(): add--resume-idas a value option, extractresumeIdbuildTaskRequest(): passresumeIdthrough the request objectexecuteTaskRun(): useresumeIddirectly when provided, fall back toresolveLatestTrackedTaskThread()for--resume-last--resume-id <threadId>Test plan
task --resume-id <valid-threadId> "prompt"resumes the specified threadtask --resume "prompt"still works as boolean resume (unchanged)task --resume-last "prompt"still resumes the latest thread (unchanged)task --resume-id <id> --freshthrows an errortask --resume-id <id> --backgroundworks correctlytask "prompt"without resume flags creates a new thread (unchanged)