# \[Bug\]: Async pi-subagents runs never show in the subagent UI on Pi threads · Issue \#17363 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/issues/17363)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: backlog

Priority: 0

## Description

[Discussion and activity](https://git.cafe/pingdotgg/t3code/issues/17363)

---

### Before submitting

- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.

### Area

apps/server. The Pi provider adapter (`packages/provider-pi/src/server/adapter.ts`), observed in the desktop app.

### Steps to reproduce

1. Install the [pi-subagents](https://github.com/nicobailon/pi-subagents) extension for Pi and start a Pi thread in T3 Code.
2. Ask the agent to call the `subagent` tool for one agent with `async: true`, for example `{ "agent": "reviewer", "task": "Review the diff", "async": true }`.
3. Watch the Agents panel and the thread timeline while the child runs and after it finishes.

### Expected behavior

The async child shows as a running subagent of the run that launched it, the way Claude background agents do and the way pi-subagents' synchronous mode already does. It settles as completed or failed when pi-subagents reports that the child finished.

### Actual behavior

Nothing appears in the subagent UI. The `subagent` tool row turns completed as soon as the launch returns, while the child keeps running. In the thread where I hit this, a review child ran for about four minutes with no sign in T3 Code that anything was running or that it finished.

The adapter's subagent support (`emitSubagentTasks` in `adapter.ts`) reads only `result.details.results[]`, the shape of Pi's synchronous example extension. pi-subagents' async mode reports differently:

- At launch, the `subagent` tool returns `details = { mode: "single", asyncId, asyncDir, results: [] }`, so the adapter emits no subagent.
- When the child finishes, pi-subagents sends a custom message with `customType: "subagent-notify"`. Its `details.runs` lists each run's agent and status, and its text names each run's directory. The message arrives between turns, before the wake turn starts, and `handleSessionEvent` ignores non-assistant `message_end` events.

### Impact

Minor bug or occasional failure

### Version or commit

Observed on desktop `0.0.46-nightly.20261008.2833`. The same code is on main at `d81afa0a6`.

### Environment

macOS 27.0, Pi 1.1.0 (`@earendil-works/pi-coding-agent`), pi-subagents 0.76.1, Pi provider with `openai-codex/gpt-6.1-sol` as the parent model.

### Logs or stack traces

```shell
# Inbound `pi --mode rpc` frames, in order, from a live run with only pi-subagents loaded.
# T3 Code's Pi replay recorder normalized ids and paths. "..." marks trimmed fields.
{"type":"tool_execution_end","toolName":"subagent","isError":false,"result":{"content":[{"type":"text","text":"Run fan-out: 1/64 used, 63 remaining\nAsync: echo [00000000-0000-4000-8000-000000000005]\n\nThe async run is deta ..."}],"details":{"mode":"single","runId":"00000000-0000-4000-8000-000000000005","results":[],"asyncId":"00000000-0000-4000-8000-000000000005","asyncDir":"/tmp/pi-rec-tmp/pi-subagents-uid-501/async-subagent-runs/00000000-0000-4000-8000-000000000005","...":"..."}}}
{"type":"agent_settled","aborted":false}
{"type":"message_end","message":{"role":"custom","customType":"subagent-notify","content":"Background task completed: **echo**\n\necho:\nECHO_DONE\n\nRetention-managed async directory: /tmp/pi-rec-tmp/pi-subagents-uid-501/async-subagent-runs/00000000-0000-4000-8000-000000000005\n\n...","display":false,"details":{"runs":[{"agent":"echo","status":"completed"}]}}}
{"type":"agent_start"}
```

### Workaround

Ask the agent for `subagent({ action: "status" })`, or read the run's result from pi-subagents' async directory. Once the wake turn runs (#15589, fixed by #17214), the parent model also sees the result, but T3 Code's subagent UI still shows nothing.

I have a fix with a recorded replay fixture and will link the PR here.

