Skip to content

A thread_send follow-up task is held by the child's later background work and reports a stale result #37698

Closed

Description

@cyanyux

What happened

A parent agent thread sends follow-up messages to a long-running delegated child with t3_thread_send. The child keeps starting awaited background commands (test runs waiting on a shared build queue) across many runs.

The follow-up tasks for sends at 15:19:15Z and 15:49:20Z did not complete until 16:35:49Z, both at once. Each carried the child's message from when its own work ended (15:40Z and 16:24Z). The parent showed both as "Finished" with stale text, and each woke the parent for a turn.

Diagnosis

  • delegatedTaskAwaitsWork (apps/server/src/orchestration-v2/RestartBackgroundNote.ts:233) holds a follow-up task while any provider thread of the child has awaited background work (line 248). The task's own subagents are scoped by run id; background work is not.
  • After the task's run ends, it is re-checked when a provider-thread.updated event shows the roster going from holding to not holding (settlesChildWork in Orchestrator.ts).
  • A child that chains awaited commands has no such gap, so every earlier follow-up task stays open, then they all settle together with stale results.
  • Expected, either: scope the background work to the task's own runs, or settle a follow-up when the child answers it.

Steps to reproduce

Inferred from source; not reproduced in isolation.

  1. Delegate a child thread (Claude provider).
  2. In the child, start an awaited background command that runs for several minutes, then end the turn.
  3. From the parent, t3_thread_send message A. The child answers in a short run and starts another awaited background command before ending.
  4. About 10 minutes later, send message B the same way.
  5. Task A does not complete when the child answers it. A and B complete together only when the child briefly has no awaited background work, each with its old result.

Version

Server 0.1.10-nightly.20261116.4774 (commit 16695c8); the server ran this build for the whole window. The triage CLI is the same build. The code is unchanged on main.

Environment

Server on Linux x64, Node v26.13.1, Claude provider. Viewed in T3 Code Desktop on macOS, same version.

Evidence

From the subagent projection (started_at -> completed_at) on the parent thread:
- child W, send 1: 15:19:15.143Z -> 16:35:49.252Z
- child W, send 2: 15:49:20.755Z -> 16:35:49.609Z
- child I, send 1: 14:09:36.474Z -> 15:58:02.007Z
- child I, send 2: 14:58:04.281Z -> 15:58:03.598Z
The child run answering W's send 1 completed at 15:40:54Z with an awaited background command pending. Child W read the output of its last awaited command at about 16:36Z, right after the 16:35:49Z settlement.

Related issues

#25585 (done shown at intermediate stops of background jobs), #20936

Fix applied or workaround

None applied. Read the child thread directly; send fewer, larger follow-ups.

Filed by

Claude Opus 5.5 (claude-opus-5-5) in Claude Code running inside T3 Code, following the triage playbook

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions