Skip to content

[Feature]: Show Pi subagents in native chat (pi --mode rpc sessions) #38210

Closed

Description

@jestyr27

Problem or use case

When Pi runs in an Orca terminal pane, the subagents a Pi extension reports appear in Orca's agent status. When the same Pi runs as an Orca native chat session (Orca launches pi --mode rpc through its provider supervisor), no subagents appear at all, even while several are running. Each subagent launch shows only as a plain tool-call row.

Same machine, same Pi install, same extensions in both cases. In one native chat session, an extension started five subagents, all visible in Pi's own session records, and Orca listed none of them. The same extension's subagents do show in a terminal pane.

Environment: Orca 1.4.245 (macOS, Apple silicon), Pi 1.1.0 (@earendil-works/pi-coding-agent), and the Orca-managed extension ~/.pi/agent/extensions/orca-agent-status.ts.

Why it happens (from reading the 1.4.245 bundle):

  1. The roster is collected by Orca's own Pi extension. orca-agent-status.ts listens on Pi's extension event bus for task:subagent:lifecycle, subagent:async-started, subagent:async-complete and subagent:process-terminal, and adds a subagents array to each status post. It posts to the agent hook endpoint (ORCA_AGENT_HOOK_ENDPOINT, or ORCA_AGENT_HOOK_PORT and ORCA_AGENT_HOOK_TOKEN), and postOnce returns without posting unless a port, a token and ORCA_PANE_KEY are all set.
  2. Native chat does not give Pi that endpoint. The hook endpoint variables are set in the terminal (PTY) launch path. None of the structured agent session modules under app.asar.unpacked/out/ mention ORCA_AGENT_HOOK, and a native chat session's environment has no ORCA_AGENT_HOOK_* variables.
  3. The Pi chat adapter has no subagent input. In out/main/chunks/structured-agent-session-host-assembly-*.js, the Pi adapter's RPC event switch handles response, agent_start, message_*, tool_execution_*, turn_end, agent_end, agent_settled, the compaction events and the auto-retry events. Every Pi tool event becomes a generic tool-call block. Native chat builds its subagent roster from subagent and subagent-group blocks, which the Codex and Claude adapters produce (for example from spawn_agent); the Pi adapter never produces one.
  4. Pi cannot forward the bus event itself. Pi's pi.events is extension-to-extension only (Pi docs, extensions.md). In RPC mode, the only extension output that reaches stdout is extension_ui_request (notify, setStatus, setWidget, setTitle and the dialogs; Pi docs, rpc-extension-ui.md), and the Pi adapter's switch has no extension_ui_request case.

Reproduce:

  1. Save this as ~/.pi/agent/extensions/demo-subagent.ts. It reports one subagent when a turn starts and ends it 30 seconds later:

    export default function (pi) {
    	let n = 0;
    	pi.on("agent_start", () => {
    		const id = `demo-${++n}`;
    		pi.events.emit("task:subagent:lifecycle", { id, agent: "worker", description: "Demo subagent", status: "started" });
    		setTimeout(() => pi.events.emit("task:subagent:lifecycle", { id, agent: "worker", description: "Demo subagent", status: "completed" }), 30_000);
    	});
    }
  2. In an Orca terminal pane, run pi and send any prompt. "Demo subagent" should appear in Orca's agent status for about 30 seconds.

  3. Start a Pi native chat session in Orca and send any prompt. No subagent appears.

I have not run this exact demo extension. The event shape is the one our own extension emits, and that extension behaves as described in both modes.

Proposed solution

Either would work; the first reuses what Orca already ships.

  1. Give native chat Pi sessions the agent hook endpoint (port, token and a pane key the extension can send back), and fold the subagents array from those posts into the native chat subagent roster. No Pi change and no extension change are needed.
  2. Handle extension_ui_request in the Pi chat adapter. The Orca-managed extension could then report the roster in RPC mode through a fire-and-forget call (for example setWidget with an Orca-specific key), and the adapter would map it to subagent blocks.

Alternatives or additional context

Activity

  1. Fiv5 commented on Nov 13, 2026

    @Fiv5

    Same issue here.Hope Pi can also be treated as a first-class citizen, just like claude code/codex.

  2. self-assigned this
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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