[Bug]: Promoting a queued subagent follow-up to Steer marks its task stopped#19351

opened23d agobyMmurayy

Area

apps/server

Steps to reproduce

  1. An agent delegates a task with delegate_task.
  2. While the subagent's turn runs, the agent sends it follow-ups with t3_thread_send. Each one queues as its own delegated task.
  3. Promote a queued follow-up to Steer.

Expected behavior

The follow-up joins the running turn, the way a direct steer does. Its task stays in progress and settles with that turn's result.

Actual behavior

The follow-up's task settles at once as cancelled. The parent shows a "Stopped" card and gets a completion notice with "Child task ended with status cancelled.", and task_status reports cancelled, while the subagent thread is still working.

Cause

dispatchQueuedMessagePromoteToSteer cancels the queued run and moves its message into the running turn. The follow-up's task stays bound to the cancelled run through delegatedTaskId, so finalizeAppOwnedSubagentTask and delegatedTaskResultPending read that run's cancelled status as the task's outcome.

Impact

Minor bug or occasional failure

Version or commit

main @ 9a01524f3f

Environment

Codex subagent delegated from a Codex parent thread, desktop app.

Reproduced on current main 70e5e384da, Linux web dev app, Codex parent and child.

The missing prerequisite is a completed original delegation: after that completes, send a new long-running message to the same child with t3_thread_send (mode: queue), queue another follow-up, then click Steer on the queued row. The follow-up immediately shows Stopped, and task_status returns cancelled, while the child's running turn continues.

During the original delegation's first turn, the same queued send did not receive a separate task ID; promoting that message left the original task running.

Before promotion: Queued follow-up before promotion

After promotion: Parent reports one working and one stopped

The bug is reproduced, but the candidate orchestration fix is incomplete. Review confirmed two remaining agent-facing paths: a blocking task wait can still return cancelled between target completion and parent settlement, and result-transfer lookup/acknowledgement still follows the cancelled queued run.

Further implementation is stopped at the automated triage flow's MCP-surface boundary for maintainer review. The issue remains open; no fix PR was published.

Fresh reproduction on main 8acbefefc5, Linux web dev app, Codex parent and child. After the initial delegation completed, I queued a long-running send and a follow-up to the same child, then clicked Steer. The follow-up immediately showed Stopped while the target run continued. task_status returned cancelled / result_available with “Child task ended with status cancelled.” The joined target later completed with FOLLOWUP_DONE.

Recording of queue → Steer → stopped parent card.

Existing fix #19352 is being preserved and checked against current main.