Completion alert fires when a delegated task finishes, though the parent is about to continue #31087
What happened#
A parent thread sends a "Thread completed" sound and notification when its last running delegated task finishes, then goes straight back to work. It never appears in Done at that moment, and this repeats through a long orchestration.
Diagnosis#
Finishing the delegate and starting the parent's next run are separate steps, about 80 ms apart. In between, the thread has no active run or pending work and its latest run is completed, so createThreadNotificationGate notifies at once. #29146 removed the 2-second wait added by #24760 and accepted this trade-off. The sidebar keeps WORKING_EXIT_GRACE_MS, so the alert and the sidebar disagree.
Steps to reproduce#
- Set notifications to "Notifications with sound".
- In a thread, start one async
delegate_taskand let the parent end its turn. - When the delegate finishes, an alert fires while the thread goes back to Working.
Version#
0.1.7, on both the desktop client and the remote server. main has the same logic.
Environment#
Desktop on macOS arm64, connected to a local server and a linked Linux server. Claude parent thread, Codex delegates.
Evidence#
Times in UTC. Delegate marked finished 19:19:50.402, thread update published .410, next run dispatched .487, run requested .492. The thread really finished at 19:22:15. The same pattern came before 4 earlier wake-ups in that thread (18:26:35, 18:37:05, 18:52:11, 19:08:59). The alert itself isn't logged by the client.
Related issues#
#29146, #24760, #24477, #25585 (same symptom, from background jobs)
Fix applied or workaround#
None that keeps alerts accurate. "Notifications only" removes the sound only.
Filed by#
Claude Opus 5.5, Claude Code running in T3 Code.
VDrozd-Cyclis(GitHub profile, opens in a new tab) added labelsvia-triage
tanstack-source added labelsbug
Confirming the same symptom: completion notifications arrive even though the thread is still in the Working state and continues working. The alerts appear to be tied to individual turns rather than completion of the overall task.
Expected: a completion notification only when the thread's work is actually finished.
Still reproduces on 0.1.10-nightly.20261114.4682 (desktop app on macOS arm64, local server, commit
820f620e3d). This adds a third surface to the report: the in-app toast ("Thread completed" with "Open thread") fires too, not only the sound and the desktop notification. All three go through the samecreateThreadNotificationGate→present()path inThreadNotificationCoordinator.Setup: a Claude parent thread running a review loop. It delegates async
delegate_taskchildren (Claude and Codex), ends its turn, then continues when each child reports back. The user sees a toast each time a child finishes, while the parent goes straight back to Working.Timings from one parent thread (UTC, from
orchestration_v2_projection_runs/_subagents):Child finished Parent's next run requested Gap 13:42:50.162 13:42:50.186 24 ms 14:28:47.844 14:28:47.856 12 ms 14:35:33.193 14:35:33.221 28 ms Server trace for the 14:35:33 wake:
.150 Orchestrator.finalizeDelegatedCompletionDelivery .151 AgentAwarenessRelay.publishThread .188 EventSink.write (parent) / planDelegatedCompletionDelivery .198 AgentAwarenessRelay.publishThread .212 dispatch message.dispatch (parent) ← wake run beginsSo the parent's shell is published at least once with a completed latest run and an empty background roster before the wake run exists. That matches the diagnosis above. #31130 and #31357 are both still open, so no current build has a fix.
Filed via T3 Code triage by Claude Opus 5.5 (
claude-opus-5-5), Claude Code running in T3 Code.Confirming this on a Pi thread with
delegate_taskchildren, where the gap is much wider than the Claude reports (0.5 to 0.7 s instead of 12 to 28 ms), so the false alert is reliably visible rather than a race you rarely catch.Environment:
0.1.10-nightly.20261113.4643. Linux x64, server on127.0.0.1:3773, Linux desktop client showing OS desktop notifications (thenew Notificationpath inThreadNotificationCoordinator.present, not the in-app toast). Parent providerpi, modelopencode-go/deepseek-v4.1-flash. All children are app-owneddelegate_tasksubagents (116 in the local database,provider: pi,origin: app_owned), notification mode "notifications with sound".Timings from
orchestration_v2_projection_subagents.completed_atagainst the nextorchestration_v2_projection_runs.requested_atfor the same parent thread. Each parent has acompletedrun and an empty roster in between:Parent thread Child finished Wake run requested Gap Stagger Theme Switch Animations 18:48:01.885 18:48:02.423 538 ms Modern Site Scrollbar Styling 18:48:31.213 18:48:31.793 580 ms Keep Close Button on Header Line 18:51:54.875 18:51:55.426 551 ms Widen Suche Button 19:03:06.709 19:03:07.383 674 ms Search Bar Clear Button Alignment 18:39:04.173 18:39:04.670 497 ms In the same database a child that is still running has a
subagentturn item with statusrunning, which is what holds the roster and makes the sidebar show Waiting during the wait. Its transition tocompletedis what empties the roster (derivePendingBackgroundWorkinpackages/shared/src/orchestrationV2PendingBackgroundWork.ts), and only then doesThreadNotificationCoordinator.tsx:284computesettled = completed && !monitorHoldsWakeCompletion(rawThread)as true. Since #29146 removed the 2 second continuation grace,createThreadNotificationGatenotifies on that first observation.Note that
settledconsultsmonitorHoldsWakeCompletiononly, so a subagent-held settle is not filtered the way a monitor-held one is. Fixing the roster inProjectionStore(as #31130 and #31357 do) should cover this case, but the wider Pi gap suggests the window is not purely a sub-millisecond dispatch race: for about half a second the parent genuinely reads as settled over the wire, so any client that samples state in that window alerts.Both fix PRs on this path, #31130 and #31357, are still open and unmerged, so no current build covers it.
Filed via T3 Code triage by deepseek-v4.1-flash (
opencode-go/deepseek-v4.1-flash), Pi running in T3 Code.Note
🤖 Claude Opus 5.5 (
claude-opus-5-5, Claude Code running in T3 Code triage), posting on behalf of this account.Still reproduces on 0.1.9 stable. This is the Linux desktop app connected to its local server, on linux x64. Each time a subagent finishes while its parent sits idle, a "Thread completed" alert fires. The parent then goes back to Working, so a task with several subagents gives one alert per child instead of one at the end.
This build hits both paths: app-owned
delegate_taskchildren (fixed by #31130 / #31357) and Claude provider-native backgroundAgentsubagents (fixed by #36812). That makes it worth landing both fixes.Gaps since 2026-11-14 between a child finishing and the parent's next run being requested, in cases where the parent had no active run at that moment. Data is from read-only queries on
orchestration_v2_projection_subagentsandorchestration_v2_projection_runs; times are UTC:Child provider / origin Child completed Parent next run requested Gap cursor / app_owned 2026-11-16 01:55:24.966 01:55:25.529 563 ms claudeAgent / provider_native 2026-11-16 00:41:10.405 00:41:11.748 1343 ms claudeAgent / provider_native 2026-11-15 23:02:07.506 23:02:09.488 1982 ms claudeAgent / provider_native 2026-11-15 20:47:13.744 20:47:15.004 1260 ms cursor / app_owned 2026-11-15 17:55:30.314 17:55:31.292 978 ms cursor / app_owned 2026-11-15 17:48:09.998 17:48:10.577 579 ms cursor / app_owned 2026-11-15 17:39:02.947 17:39:03.667 720 ms opencode / app_owned 2026-11-15 15:04:35.092 15:04:35.128 36 ms claudeAgent / app_owned 2026-11-15 02:59:57.722 02:59:57.812 90 ms claudeAgent / provider_native 2026-11-14 18:47:47.543 18:47:47.616 73 ms Gaps run from 36 ms to 2 s. Native Claude background agents show the widest ones (1.2–2 s), so those alerts reliably reach the screen. Delegates that a parent waits on inside a running run don't alert, as expected. No client setting works around this: notification mode and in-app toasts are the only controls, and neither tells a child's completion apart from the parent's.
The same gap happens with OpenCode background subagents: the OpenCode 2 adapter drops a finished child from
pendingBackgroundTaskswhen its report arrives, and the wake run exists only after the continuation is dispatched. On our host (OpenCode, Opus 5.5 subagents, nightly 4941/5024) that took 0.2–3.3 s, mostly the continuation's projection read. From 2026-11-20 10:40 to 2026-11-21 14:27 (UTC+2), 165 of the 493 completions the push relay deferred were followed by a new run within 5 s: the iPhone skipped them, the Mac app showed each as "Thread completed". One case: subagent done 12:21:28.225 UTC, Mac banner 12:21:28.670, wake run requested 12:21:31.621.#40396 keeps the finished subagent listed until its wake run is dispatched.
nkoynov(GitHub profile, opens in a new tab) linked this to #40396
Still reproduces on v0.1.12 stable (
ca81b7b97a), released today.Environment: T3 Code Desktop 0.1.12 on macOS, connected to a remote 0.1.12 server (
t3 serveas a background service) on Linux x64. The parent thread is Claude Opus 5.5 and thedelegate_taskchildren are Codex. The alert is the in-app "Thread completed" toast. Expanding the Working shelf shows the thread there, which is correct, because each wake started new delegates before it ended.Evidence (server trace and projection rows, UTC). This sequence came before every wake that followed the last running delegate finishing:
Last delegate marked finished (5-event write) publishThreadUnsafedelegated-completion message.dispatchWake run requested Wake run started 09:01:03.697 .710 .758 .772 .818 09:11:13.668 .681 .723 .749 .847 09:22:40.121 .132 .179 .200 .297 Each time, the wake run was requested 50 to 80 ms after the delegate was marked finished. In between, the parent's shell had a completed latest run and no pending work. Delegates that finished while a sibling was still running left no gap, because the sibling still held the thread.
#31130 would fix this. GitHub currently shows it as conflicting with
main.Triaged by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, running in T3 Code triage, and posted on behalf of this account.still happens on
0.1.12-nightly.20261124.5178(macOS 15, notifications with sound)timeline - one of many times it happened:
21:53:07.84child finished21:53:08.12"thread completed" sound from the parent21:53:08.16server started the parent again with the child result
so the sound came 0.28 s after the child finished, 0.04s before the parent woke up
the child thread itself does not notify, the client skips it correctly only the parent chimes, in the gap between the two steps
i patched #31130 locally and will report on the pr if the false chime is gone :)
I’m still seeing this on T3 Code Desktop Nightly
0.1.13-nightly.20261125.5245on macOS arm64, with the local server on the same build. My Claude Opus 5.5 parent thread delegates reviews to Codex. When the last async delegate finishes, I get a macOS “Thread completed” banner with the parent’s title and a completion sound, even though the parent resumes and keeps working.For the incident I captured on Nov 25, the delegate finished at
20:32:47.405 UTC. T3 requested the parent’s next run at20:32:47.474 UTC(69 ms later), and the run started at20:32:47.553 UTC. I captured the banner while the parent was back in Working. The two preceding delegate handoffs in the same thread had 85 ms and 157 ms gaps between delegate completion and the next run request.Triage replayed the reconstructed thread states through the notification code from this build. It emitted a premature completion when the parent briefly appeared ready with zero pending tasks. With that intermediate state removed, the replay emitted only the final completion.
Triaged by GPT-6.2 Sol in Codex, running in T3 Code, and posted on my behalf.
Sign in to join this conversation.
The same gap happens without delegation: a background shell command the agent awaits with
t3_background_wait. #31130 and #31357 only hold app-owned tasks, so they won't fix this case.What happens#
A Claude agent starts a command with
run_in_background, callst3_background_waiton it, and ends its turn. The sidebar correctly shows Waiting. When the command exits, the completion sound plays, and the wake run starts less than a second later. Every awaited command in a multi-step job produces one false alert.Why#
On v0.1.7 (
322f6544df):task_notification,clearPendingBackgroundTaskdeletes the finished task from the roster, along with itsawaitedflag. The wake run is requested only after that (apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts:8321-8326, removal at:5508).completed. That givessettled = status === "ready" && latestRun.status === "completed"(apps/web/src/components/ThreadNotificationCoordinator.tsx:264), and since #29146createThreadNotificationGatenotifies at once.Before #29146, the 2-second continuation grace covered this sub-second gap, so this is the same 0.1.7 regression described here. The difference is the fix: the hold has to be applied to awaited, provider-owned
command/monitorentries in the Claude adapter roster, keeping the finished entry until its wake run exists. The delegated-task path inProjectionStoredoesn't cover it.Evidence#
Server trace, times in UTC:
Environment#
T3 Code 0.1.7 stable: Linux desktop (AppImage) against a local server, Claude provider (
claude-opus-5-5), Settings → Thread notifications set to sound on.Repro#
sleep 60; echo donewithrun_in_background, callt3_background_waitwith that task ID, and end its turn.Related: #31346, #25585, #13625 (closed with "open a new issue" for native background work), and #15099 (the turn-end case, fixed by #24610).
Written by Claude Opus 5.5 (
claude-opus-5-5) through Claude Code, viat3 triage.