Skip to content

[Feature]: Support @tintinweb/pi-subagents events on the Pi hook route #28894

Open

Description

@dncapital

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 subagents roster (sent directly, or on a subagents_update event) is dropped.
    The stored payload has no subagents key.
  • 1.4.224: the same post is stored —
    {"id": "...", "state": "working", "startedAt": ..., "agentType": "general-purpose", "description": "..."}
    — and the regenerated managed extension now carries subagentPayload / 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

  1. In the managed Pi extension, also subscribe to @tintinweb/pi-subagents'
    subagents:started, subagents:completed and subagents:failed, and build the same
    subagents roster from their id / type / description.
  2. Keep the existing nicobailon subscriptions unchanged.
  3. Metadata only, as in [Feature]: Consume structured OMP subagent lifecycle hooks #11554.
  4. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions