Skip to content
Source
Sign inSign up
pingdotgg/t3code

Remote delegated tasks don't notify the parent of follow-up runs on the child thread #31707

Opentimeteos(GitHub profile, opens in a new tab) opened this issue 5 comments

What happened

fresh start on my Linux box delegated an iOS build check to my Mac (delegate_task with target.environmentId). The child's first run ended blocked (no simulator runtime), the parent woke up and reported that, and suggested I reply directly in the child's thread. I installed the simulator and continued there: the child ran the build (it succeeded) and finished. The parent never woke up for any of that and still believes the Mac agent is blocked.

Diagnosis

A remote delegation follows only the run it launched, then goes deaf. RemoteDelegation.followOnce waits on remoteChild.runId (ordinal:1) via waitForThread, completes the task when that run ends, and the follower ends (apps/server/src/peer/RemoteDelegation.ts). Later runs on the child never re-notify the parent. Local delegation has parity: recordSubagentFollowup (apps/server/src/orchestration-v2/Orchestrator.ts) creates a new parent subagent with completionWake: "always" when a follow-up starts a new run on a finished delegated child. Remote children can't hit that path (top-level thread there, no parent linkage). The docstring promises the missing parity: "a follower completes it when the thread there ends, so the parent wakes as it would for a local child" (RemoteDelegation.ts:64-67). Here: subagent completed 21:25:37Z off child run 1 (delivered; parent run 202 said "blocked"); child runs 2 (build OK) and 3 (done 22:10:48Z) produced no wake; trace shows no child wait/notify at 22:10. First wake worked as coded; follow-ups untracked.

Steps to reproduce

  1. Link environments A and B. 2. On A, delegate_task with target.environmentId=B. 3. Let child run 1 complete; parent wakes. 4. Send a user message in the child thread on B (new run). 5. Let it complete. 6. Observe: no parent notification/wake. Compare local delegate_task, where the parent is re-woken (recordSubagentFollowup).

Version

0.1.7 (local server 0.1.7 and linked Mac server 0.1.7; Desktop 0.1.7)

Environment

Parent: Desktop 0.1.7 Linux x64, server 0.1.7, Node v24.22.1, claudeAgent/opus-5-5. Child: server 0.1.7 macOS arm64, claudeAgent/sonnet-5-5.

Evidence

subagent driver=remote status=completed completed_at=2026-11-05T21:25:37.292Z; remoteChild runId=..:ordinal:1 stoppedThere=true; delivery=delivered; child runs: #1 done 21:25:37Z, #2 21:35-22:07Z (build OK), #3 done 22:10:48Z; parent ends at run 202 (21:25:50Z), no later wake; trace: no child wait/notify at 22:10.

#21060 (Grok stuck-Working, different symptom), #30469 (Working indicator). No duplicate found; RemoteDelegation.ts unchanged since v0.1.7.

Fix applied or workaround

None run on machine. Ask the parent to re-read the child (t3_thread_read + environmentId), or relay the result yourself.

Filed by

muse-spark-1.3-contributor via t3 triage (Muse Code harness)

  1. timeteos(GitHub profile, opens in a new tab) added labelsvia-triage

  2. tanstack-source added labelsbug

  3. MikaMcFlurry(GitHub profile, opens in a new tab)commented

    Another trigger for the same gap, which I hit far more often than a user follow-up: the remote child's own background work starts the next run.

    A Claude child on a linked Linux machine (parent on Windows, delegate_task with target.environmentId) starts a long test run as a background command and ends its first turn with an interim note. The background command's completion then wakes the child, which continues in run 2 and writes the actual report there.

    One example from today, on the child thread:

    • run 1 completed 01:39:18Z, ending with "The full orchestration-v2 run is still in the background. I'll finish the report when it reports back."
    • run 2 started 01:43:46Z (no user message, woken by the finished background command) and completed 01:44:40Z with the real result.

    The parent was woken once, at the end of run 1. task_status reported status: completed / workState: result_available with the interim note as its summary, and nothing arrived for run 2. It happened on 3 of 11 remote delegations today, and once the day before. Each time I recovered with t3_thread_wait(untilDelegatedWorkSettled: true) on the child thread and read the final message myself.

    So with followOnce following only the launched run, any remote delegate that leaves background work hands back an interim result as its final one. That is the default way agents run long builds and tests. Following until the child thread has settled (no active run, no pending background tasks or owed wake) would cover both this and the user follow-up described above.

  4. Reproduced both triggers on v0.1.9, with the parent on a Linux server and the child in a Vercel Sandbox, linked over Tailscale (--access auto, child claudeAgent).

    Background-wake run (the case #32563 described):

    • The child moved sleep 60 into a background task and ended run 1 with "Waiting for the background task to finish."
    • The follower waited until the background work ended (05:55:37.77Z). It then completed the task with run 1's interim text.
    • Run 2 started about 30 ms later (05:55:37.8Z to 05:55:40.1Z) and wrote the real answer. The parent never received it; we got it only by reading the remote thread.

    User follow-up: a t3_thread_send to the finished remote child started a new run, which finished. The parent did not wake (still nothing 8 minutes later). I see #26776 shipped in v0.1.10 for this case.

    Is #31744 still the planned fix for the background-wake case? It's the main thing that stops us from running sandboxed builder agents as linked environments. Builders run tests and dev servers in the background, so the parent often gets the interim note as the final result.

  5. On the background-wake question: I checked locally whether #31744 covers it (fixture tests only, no live two-server run).

    • PR head 5258d9f655: a test where the remote child's run 1 ends with an interim note and a later run, started by no message, ends ~30 ms later with the final text produces a second task with that text (completionWake: "always"), and the parent wakes again. On the child side, afterRunId counts a run started by a Claude background-command wake (notification.source.kind: "command"); a monitor-sourced wake is skipped by design.
    • Current main 70e4319da8: the same test never sees the final text. The follower completes the task on run 1's interim text and stops observing; the #26776 path only covers t3_thread_send.

    Two caveats with #31744: the parent still gets run 1's interim text as a completed result first, and the PR no longer merges cleanly into main (conflicts in 8 files, overlapping with #26776, #37332 and #32331). The test patch is available if useful.

  6. Worth noting the flip side of local recordSubagentFollowup setting completionWake: "always" on user follow-ups in a delegated child thread:

    When a user opens a finished delegate_task child thread directly to ask an ad-hoc inspection/side question (for example, asking what a commit touched or why UI diffs aren't showing), every user-initiated turn on the child still emits a Delegated task "<title>" finished notification back to parentThreadId and surfaces a new subagent card in the parent's timeline.

    • If the parent is idle, each side question in the child wakes the parent and burns a parent turn (plus context/tokens) on work the parent didn't ask for.
    • If the parent is already mid-turn, those notifications get injected into the active parent turn.

    There's a real distinction between:

    1. Unblocking or continuing the delegated task (e.g. fixing an environment issue and telling the child to retry, where waking the parent makes sense), and
    2. A user side-chat in the child thread (inspecting or asking questions about the child's work, where waking the parent is surprising and burns parent turns).

    As parity is extended to remote follow-ups (e.g. #31744), it may be worth considering an opt-out or a way to keep ad-hoc user Q&A in a child thread from unconditionally waking the parent.

  7. @unthingable Agreed that these are two different cases. On current main (10765a4e47) the wake is fixed in two places:

    • Local: recordSubagentFollowup creates the follow-up task with a hardcoded completionWake: "always" (apps/server/src/orchestration-v2/Orchestrator.ts, around line 10303).
    • Remote: the follow-up path from #26776 does the same (apps/server/src/peer/RemoteDelegation.ts, around line 488).

    A per-task wake policy already exists as a command (delegated_task.wake-policy, always | settled_only). Today only awaitTask uses it, to upgrade a wait to always. So an opt-out probably doesn't need a new mechanism. The user's send would only have to carry an intent (for example "don't notify the parent") that the follow-up task takes as its wake policy instead of the fixed always.

    One constraint for whatever shape this takes: the opt-out should only apply to the user's own follow-up message. recordSubagentFollowup can already tell the cases apart (createdBy === "user" vs. a notification-started run). A run that the child starts itself from a finished background command often carries the real result after an interim note (the case in my comment above and in #32563). If that run stopped waking the parent, the parent would be left with the interim text again.

Sign in to join this conversation.