Skip to content

[Bug]: Pi native chat never installs Orca's managed Pi extensions, so subagent rows from #42448 cannot appear #43291

Closed

Description

@ShizkMoon

Where were you using Orca?

Desktop only

Operating system

Windows

Orca version

v1.4.261

Details

Summary

Pi native chat never installs Orca's managed Pi extensions into the agent directory that chat launches Pi with. PR #42448 added subagent reporting to orca-agent-status.ts and to the RPC adapter, but the chat launch path installs no extension files at all, so subagent rows cannot appear unless the user already has a current copy sitting in the right directory.

Why

  • piRpcLaunchPart → resolvePiRpcInvocation (src/main/pi/rpc/launch/rpc-launch-resolution.ts:140-166) sets only env.PI_CODING_AGENT_DIR = deps.accountDir (line 159). Nothing is written to disk.
  • The chat command is pi --mode rpc --extension <userData>/pi-native-chat/orca-background-work.ts (src/main/pi/rpc/launch/rpc-launch.ts:112-117). The background-work bridge is the only injected extension.
  • installManagedExtensions (src/main/pi/managed-extensions/titlebar-extension-service.ts:122) is the only writer of orca-agent-status.ts, orca-titlebar-spinner.ts and orca-prefill.ts. Its only caller is buildPtyEnv (same file, declared line 167, called line 201), and the only Pi caller of buildPtyEnv is the PTY env assembly at src/main/ipc/pty/host-env/assembly.ts:180. A repo-wide search for installManagedExtensions returns that single file.

So orca-agent-status.ts gets installed for a terminal-launched Pi and is absent for a chat-launched Pi. #42448's subagent rows depend on that file.

Reproduction

  1. Orca 1.4.261 on Windows 11, Pi configured, agent status hooks enabled.
  2. Do not spawn a Pi terminal. Open a Pi native chat and ask it to run a subagent.
  3. No subagent row appears. extensions under the directory the chat process runs with (PI_CODING_AGENT_DIR, verified here as C:\Users\Administrator\.pi\agent) contains none of Orca's managed files; orca-agent-status.ts is missing entirely.
  4. Copy a current orca-agent-status.ts into that directory, restart the chat, repeat: the extension loads and reports.

Same root cause, second symptom: upgrading leaves the on-disk copy stale

Because the file is written only from the PTY path, upgrading Orca does not refresh it:

  • resources/app.asar after the 1.4.261 update: mtime 2026-11-16 18:26, contains the post-feat(pi): show subagents in Pi native chat #42448 source (grep finds orca-subagents and ORCA_STRUCTURED_SESSION in it).
  • C:\Users\Administrator\.pi-orca\agent\extensions\orca-agent-status.ts before any Pi terminal had been spawned: 43953 bytes, mtime 2026-11-15 21:54, no orca-subagents, no ORCA_STRUCTURED_SESSION.
  • orca agent launch --agent pi --surface terminal rewrote it to 45305 bytes, and both markers appeared.

On this machine the terminal account home (~\.pi-orca\agent) and the directory chat runs with (~\.pi\agent) differ, so even that rewrite does not reach the chat process. writeManagedExtension (line 85) already skips identical content, so refreshing on every launch costs nothing.

Expected

After upgrading Orca, Pi native chat reports subagent activity without manual file copying, the same way terminal-launched Pi does.

Suggested fix

Install the managed extensions for deps.accountDir inside the RPC launch path, for example a ptyId-free overload of installManagedExtensions called from resolvePiRpcInvocation before the version probe. Alternatively run one install pass over every configured Pi account directory at app startup, so an upgrade converges without a terminal spawn.

Workaround

Spawn any Pi terminal once so Orca rewrites the extension, then copy it into the directory chat uses:

Copy-Item "$env:USERPROFILE\.pi-orca\agent\extensions\orca-agent-status.ts" "$env:USERPROFILE\.pi\agent\extensions\"

The two paths are the terminal account home and the chat agent dir on this machine; on other installs take them from buildPtyEnv's target and the PI_CODING_AGENT_DIR the chat process was started with.

Activity

  1. added a commit that references this issue on Nov 17, 2026
    41194fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions