[Bug]: OMP subagent prompt overwrites the top-level agent preview in the sidebar
- Dominant language
- TypeScript
- Stars
- 71.3k
- Forks
- 4.7k
- Avg merge
- 17h 8m
- Merged PRs (30d)
- 475
Description
### Operating system
Windows 11 host + WSL2 Ubuntu 24.04 runtime
### Orca version
1.4.145
### OMP version
17.0.4
### Details
When a visible top-level OMP session delegates work through the `task` tool, the agent description in Orca's left sidebar is overwritten with the task subagent's prompt.
The row initially contains the top-level user's prompt and is therefore recognizable. As soon as an in-process child starts, the same row changes to the child's delegated prompt. OMP task workers commonly begin with similar generated or bootstrap wording, so the sidebar stops identifying what the visible top-level agent is actually working on.
This is distinct from custom-label or tab-title behavior: the automatic preview is receiving prompt data from the wrong session.
### Reproduction
1. Launch OMP from Orca's agent selector.
2. Give the top-level session a distinctive prompt.
3. Confirm that the sidebar agent row initially previews that prompt.
4. Ask the agent to delegate work through OMP's `task` tool.
5. When a task subagent starts, observe the same top-level sidebar row.
6. The row's description changes to the child task prompt even though the visible top-level OMP session is still the same agent.
### Expected behavior
The visible top-level agent row should retain the root session's prompt/identity. Child lifecycle events should not replace its prompt or assistant preview.
If Orca later represents OMP subagents separately, child prompts may be shown on those child rows, but they should not overwrite the parent row.
### Actual behavior
An in-process task child's prompt is attributed to the top-level pane and replaces the root prompt in the sidebar.
### Root-cause evidence
Orca's current managed Pi/OMP status extension posts every `before_agent_start` prompt to the pane:
https://github.com/stablyai/orca/blob/d8629c41c832436463d5f0b4e4deb95f867fdc42/src/main/pi/agent-status-handler-source.ts#L50-L64
It also forwards assistant `message_end` events into the same pane preview:
https://github.com/stablyai/orca/blob/d8629c41c832436463d5f0b4e4deb95f867fdc42/src/main/pi/agent-status-handler-source.ts#L86-L95
The extension ownership guard is PID-based. OMP task subagents run in-process, so the root and child share that PID and event surface. The extension currently has no public root/subagent identity with which to filter those events.
OMP is tracking the missing lifecycle identity API here:
https://github.com/can1357/oh-my-pi/issues/5985
Upstream triage confirms the identity already exists internally and recommends exposing it on each lifecycle event payload.
### Suggested direction
Once OMP exposes event-level session identity, Orca should ensure that child lifecycle events do not mutate the visible root row:
- child `before_agent_start` must not replace the root prompt;
- child `message_end` must not replace the root assistant preview;
- child working/tool/completion events must not drive the root status or notification unless Orca intentionally models the child separately.
Filtering only child `agent_end` would fix the false completion notification but leave this sidebar corruption intact.
Related: #9181 and https://github.com/can1357/oh-my-pi/issues/5985
Contributor guide
Assessment
This issue has not been assessed yet.