Skip to content

feat(task): add --resume-id <threadId> option for explicit thread resumption#231

Open
hirotomoyamada wants to merge 5 commits intoopenai:mainfrom
hirotomoyamada:feat/resume-thread-id
Open

feat(task): add --resume-id <threadId> option for explicit thread resumption#231
hirotomoyamada wants to merge 5 commits intoopenai:mainfrom
hirotomoyamada:feat/resume-thread-id

Conversation

@hirotomoyamada
Copy link
Copy Markdown

@hirotomoyamada hirotomoyamada commented Apr 15, 2026

Summary

  • Add --resume-id <threadId> value option to the task command for resuming a specific thread by ID
  • Existing --resume (boolean) and --resume-last behavior is unchanged

Using a separate --resume-id flag instead of overloading --resume preserves backward compatibility with the rescue command routing that uses bare --resume as a boolean continue signal.

Closes #230

Changes

  • handleTask(): add --resume-id as a value option, extract resumeId
  • buildTaskRequest(): pass resumeId through the request object
  • executeTaskRun(): use resumeId directly when provided, fall back to resolveLatestTrackedTaskThread() for --resume-last
  • Usage text updated to show --resume-id <threadId>

Test plan

  • task --resume-id <valid-threadId> "prompt" resumes the specified thread
  • task --resume "prompt" still works as boolean resume (unchanged)
  • task --resume-last "prompt" still resumes the latest thread (unchanged)
  • task --resume-id <id> --fresh throws an error
  • task --resume-id <id> --background works correctly
  • task "prompt" without resume flags creates a new thread (unchanged)

@hirotomoyamada hirotomoyamada requested a review from a team April 15, 2026 04:17
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@hirotomoyamada hirotomoyamada changed the title feat(task): add --resume <threadId> option for explicit thread resumption feat(task): add --resume-id <threadId> option for explicit thread resumption Apr 15, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

feat: add --resume-id <threadId> option to task command

1 participant