Add optional thread resumption to codex queue (#57232)

## What changed

Add `codex queue --resume` to resume an unloaded thread after queueing a message through the local daemon or selected `--remote` server. Already loaded threads are left running. If resumption fails, emit a warning while preserving the successful queue result.

Read only the thread status when checking whether to resume, allowing remote metadata to contain paths from another operating system.

## Testing

Extend CLI integration coverage for unloaded threads consuming queued messages, archived thread rejection, and successful queueing when another server owns the thread and rejects resumption.

GitOrigin-RevId: cc8aa3c11a37e990da36e6ff9a17934f73322e7b
This commit is contained in:
Eric Traut
2026-10-26 20:25:22 +00:00
committed by copyberry
parent 0b021a5fc9
commit 4fc522f5e0
3 changed files with 168 additions and 14 deletions
+7
View File
@@ -19,6 +19,11 @@ pub(crate) struct QueueCommand {
#[arg(long, value_name = "TEXT", value_parser = NonEmptyStringValueParser::new())]
message: String,
/// After queueing, try to resume the thread on the local daemon or selected --remote server.
/// A failed resume produces a warning and the command still succeeds.
#[arg(long)]
resume: bool,
#[clap(flatten)]
remote: InteractiveRemoteOptions,
@@ -37,6 +42,7 @@ pub(crate) async fn run_queue_command(
let QueueCommand {
thread,
message,
resume,
remote,
config_overrides,
} = command;
@@ -52,6 +58,7 @@ pub(crate) async fn run_queue_command(
codex_tui::run_session_queue_command(
thread,
message,
resume,
codex_tui::SessionArchiveCommandOptions {
cli,
arg0_paths,