Repository navigation
Description
Problem or use case
Orca shows Claude Code subagents as child rows under the parent agent. A Pi session that runs
subagents shows only the root row, and the root can settle "done" while background subagents are
still running — the symptom class of #28090.
Orca already supports Pi subagents, but only through one specific package. Orca's managed Pi
extension subscribes to subagent:async-started, subagent:async-complete and
subagent:process-terminal, and posts a subagents roster to /hook/pi. The fixtures in
src/main/pi/agent-status-subagent-event-fixtures.ts say they "mirror traces recorded from
pi-subagents 0.71.0", which is the unscoped pi-subagents package (nicobailon/pi-subagents, now
0.78.0).
The other widely used package is @tintinweb/pi-subagents (scoped, tintinweb/pi-subagents, now
0.22.0). It emits a different event family and none of the names above, so Orca never sees its
children. Users of that package get no rows and no hold.
Evidence
Event names grepped out of the published npm tarballs:
| Package | Version | Emits |
|---|---|---|
pi-subagents (nicobailon) |
0.78.0 | subagent:async-started, subagent:async-complete, subagent:process-terminal |
@tintinweb/pi-subagents |
0.19.0 and 0.22.0 | subagents:created, subagents:started, subagents:completed, subagents:failed, subagents:steered, subagents:compacted |
@tintinweb/pi-subagents contains no occurrence of subagent:async-started,
subagent:async-complete, subagent:process-terminal or task:subagent:lifecycle at either
version. Its payloads already carry what a child row needs: id, type and description.
Ingress side, verified on 1.4.211 and 1.4.224 by posting to the local hook endpoint from a Pi pane
and reading ~/.config/orca/agent-hooks/last-status.json:
- 1.4.211: a
subagentsroster (sent directly, or on asubagents_updateevent) is dropped.
The stored payload has nosubagentskey. - 1.4.224: the same post is stored —
{"id": "...", "state": "working", "startedAt": ..., "agentType": "general-purpose", "description": "..."}
— and the regenerated managed extension now carriessubagentPayload/MAX_SUBAGENT_SNAPSHOT.
So the ingress and rendering paths work. The only missing piece is that nothing shaped like
@tintinweb/pi-subagents reaches them.
Proposed solution
- In the managed Pi extension, also subscribe to
@tintinweb/pi-subagents'
subagents:started,subagents:completedandsubagents:failed, and build the same
subagentsroster from theirid/type/description. - Keep the existing nicobailon subscriptions unchanged.
- Metadata only, as in [Feature]: Consume structured OMP subagent lifecycle hooks #11554.
- Child events must not complete the root pane or replace its preview; the root stays "working"
while any child is live.
Alternative: document the adapter contract the managed extension expects, so a harness can emit it
deliberately. A user-side bridge is possible either way, but it has to impersonate another
package's event names and will drift as that package evolves.
Alternatives or additional context
- A user-side bridge exists and works: re-emit
subagents:*assubagent:async-started/
subagent:async-complete, carrying only id, agent type and the caller's short description. It is
about 60 lines, but it duplicates Orca's adapter logic in user space and depends on
pi-subagentskeeping its event names. - Related: [Bug]: Muse background subagents show the worktree as done while they are still running #28090 (Muse background subagents show the worktree as done), Subagent tracking can retain stale rosters and miss live activity; OMP adapter first #28522, [Feature]: Consume structured OMP subagent lifecycle hooks #11554, [Feature]: Surface Codex sub-agents, models, and orchestration relationships in agent UI #8251.
- I can test a patch against a real Pi session running
@tintinweb/pi-subagentswith background
subagents and report the emitted payloads.
Activity