Skip to content
Source
Sign inSign up
pingdotgg/t3code

Since 0.1.11, about half of async Pi subagents never leave Running in T3 #39871

Closedgiovanecesar(GitHub profile, opens in a new tab) opened this issue 1 comment

What happened

Since the update to 0.1.11 this morning, Pi subagents launched by the agent never get marked finished in the UI. The subagents do their work and finish in Pi, but the thread stays on "Waiting on 9 subagents". The user also sees other background work wait forever, but has not found a consistent way to trigger it.

Diagnosis

Async pi-subagents runs (the subagent-async widget path) reach running in T3 and often never reach a terminal state. Synchronous subagent results complete normally.

Findings from the local database (orchestration_v2_projection_subagents, read-only):

  • 34 Pi subagents are running. They started between 18:28 and 19:48 UTC on 2026-11-20. Each row got its last update about 5 seconds after launch.
  • All 34 are async members. Each row has an empty prompt and a native task key of <toolCallId>:subagent:step:0, which only updateAsyncRun in packages/provider-pi/src/server/adapter.ts (about lines 1612-1652) emits.
  • The failure is partial. In one run, 5 async members completed and 4 stayed running, with the same launch times.
  • On 2026-11-19 (0.1.10), about 120 async members completed and none stayed running. On 2026-11-20, 56 async members started from 12:47 UTC onward never settled. A server restart at 18:21:25 UTC moved all 56 to interrupted.
  • The pi-subagents package did not change. Version 0.89.1 has been installed since 2026-11-18, and it still publishes PI_SUBAGENT_ASYNC_JSON: snapshots on the subagent-async widget.
  • The provider thread's pendingBackgroundTasks is empty, but the stuck subagent rows keep the "Waiting on N subagents" banner.

Between v0.1.10 and v0.1.11, the async tracking code (emitSubagentTasks, updateAsyncRun, updateAsyncSubagents, piAsyncSubagentStatus) did not change. These Pi changes in the same release are candidates:

  • backgroundTasksEndWithProcess: true on the Pi adapter, used by ProviderSessionManager.readReleasedProviderThreads.
  • get_state and adoptLiveSessionFile calls added to the agent_settled (interrupted) and stop paths.
  • terminatePiProcess now ends the SIGTERM grace early when the process group is gone (rpc.ts).

Root cause is unverified. The Pi provider event log for this thread stops on 2026-11-19, and orchestration_v2_events is pruned. So it is unknown whether Pi sent the terminal (complete) snapshot for the stuck runs, or whether T3 got it and dropped it.

Steps to reproduce

  1. Install pi-subagents and use T3 Code 0.1.11 desktop with the Pi provider.
  2. In a Pi thread, ask the agent to launch several async subagents across a few turns.
  3. Wait for each subagent to finish in Pi.
  4. See that some subagents stay Running in T3 and the thread shows "Waiting on N subagents".

This repro is not deterministic. About half of the async members get stuck.

Version

0.1.11 (desktop app, local server). The triage CLI is also 0.1.11.

Environment

macOS 27.2 (arm64), Node 26.13.1, Pi 1.6.0, pi-subagents 0.89.1, T3 Code desktop app with its local server.

Evidence

# Pi subagent status counts on 2026-11-20 (async members only = empty prompt)
hour (UTC)   status       count
2026-11-20T18  completed    15
2026-11-20T18  interrupted  56   # all at 18:21:25Z restart; started 12:47Z-17:00Z
2026-11-20T18  running      22
2026-11-20T19  completed    12
2026-11-20T19  running      12

# 2026-11-19 (0.1.10): completed 122, failed 8, running 0

# One run with both outcomes (native task key suffix, status, started_at)
...1350:subagent:step:0  completed  18:40:02Z
...c8fc:subagent:step:0  running    18:40:29Z
...91a6:subagent:step:0  completed  18:40:29Z
...c3e5:subagent:step:0  running    18:41:10Z
...86eb:subagent:step:0  running    18:41:10Z
...a492:subagent:step:0  running    18:41:49Z
...e3cc:subagent:step:0  completed  18:41:49Z

# Stuck row payload (trimmed)
{"origin":"provider_native","driver":"pi","prompt":"","title":"sharpened-writer",
 "status":"running","result":null,"startedAt":"2026-11-20T18:28:32.387Z",
 "completedAt":null,"updatedAt":"2026-11-20T18:28:37.298Z"}

#17363 reports that async pi-subagents runs never show in the subagent UI at all. Here they show up but never finish, and only since 0.1.11. #37290 (closed) covered subagents that stay Running after the provider process dies, for other providers.

Fix applied or workaround

Nothing changed on the machine. A restart of the desktop app moves stuck rows to interrupted, which clears the banner. New async subagents can still get stuck after that.

Filed by

Claude Code (claude-opus-5-5) via t3 triage

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

  2. tanstack-source added labelsbug

  3. juliusmarminge closed this

Sign in to join this conversation.