[Bug]: Agents panel keeps a finished delegated child as Working when it was started before the parent's MCP session changed; stop and task_cancel don't clear it#32235

opened4d agobyBBronto-p

What happens

A delegated child that finished hours ago stays in the parent's Agents panel as Working, with its timer still counting (11h 16m when I noticed). Pressing the row's stop button does nothing. The row stays.

Agents panel showing Sol review #471 round 1 as Working for 11h 16m 18s, with a stop button

The child itself is done:

  • t3_thread_read on the child shows status: "completed", activeRunId: null.
  • Its single run reports completed, completedAt: 12:06Z, about 2.5 minutes after it started.
  • The parent read its final verdict and acted on it.

How it got there

  1. A Claude Code parent thread called delegate_task (Codex child, isolation: "worktree"). The returned ids carried the parent's MCP command namespace at the time: node:delegated-task:command%3Amcp%3Ae607eb0f-…%3Adelegate-task%3A69f75109-….
  2. The parent's context was compacted (/compact), and the parent's later tool calls came from a new MCP command namespace (…mcp%3Ad05dd328-…).
  3. The child finished. No completion wake reached the parent.
  4. From the new session, task_status with the original task id (bare uuid, delegate-task:<uuid>) returns task_not_found: Delegated task … does not belong to thread <parent>, although the child's parentThreadId is that same parent thread.
  5. task_cancel with the full node:delegated-task:command%3Amcp%3Ae607eb0f-… id returns status: "completed" and bumps the child's updatedAt, but the Agents row stays Working.
  6. Tapping the row's stop button in the iOS app doesn't remove it either.

The parent also showed "waiting on 1 subagent" for the rest of the session, while every other delegated task had finished and been delivered.

Expected

  • A child's row settles when its run completes, whether or not the parent's MCP session that started it is still current.
  • Task ids stay resolvable from the same parent thread after compaction or an MCP reconnect.
  • Stop, or task_cancel returning completed, removes a stale Working row.

Impact

The panel says a Codex agent has been working for 11+ hours, so it looks like tokens are being spent. Nothing clears it.

#30911 shows a similar symptom, with extra Working rows after a stopped child is resumed. This report is a different path: the child was never stopped or resumed, the parent's MCP session changed, and stop can't clear the row.

Environment

macOS host; Claude Code parent thread on Opus; Codex (GPT-6.1-Sol) child; viewed in the T3 iOS app; observed 2026-11-06.