Skip to content

[Bug]: Async workflow workers are missing from sidebar child rows #39120

Closed

Description

@mmarabel

Operating system

macOS client paired to a Linux execution host.

Orca version

Execution host: 1.4.251. Client version not independently verified. The same listener gap is present on upstream/main at 586d214.

Details

A Pi worker launched inside an asynchronous pi-subagents workflow runs successfully but does not appear as a subagent in Orca's sidebar. The parent terminal says the workflow is running, while the sidebar has no corresponding worker row.

Reproduction

  1. Run Pi in an Orca terminal with pi-subagents 0.86.0 installed.
  2. Launch an asynchronous script workflow using subagent({ workflow: "/path/to/workflow.js", async: true, args: { ... } }).
  3. Have that script await a worker with const result = await runs.run("example-work", { agent: "worker", model: "<configured provider/model>", task: "<task long enough to observe>" }); return result;.
  4. While the child is working, inspect the sidebar beneath the parent agent.

Expected: the running worker appears as a child row, then stops appearing as active when it finishes.

Actual: the worker is missing even though the workflow's event log records its start and successful completion. A later worker launched through a different path did appear in the host's status snapshot, so this does not affect every subagent launch.

Evidence and likely cause

Verified the affected workflow's workspace/session association and its persisted events. It recorded a subagent.child-status event with status: "started", agent: "worker", a workflow key and a distinct childRunId, followed by subagent.workflow.child_settled with outcome: "completed".

In pi-subagents 0.86.0, src/runs/foreground/subagent-executor.js:5612-5629 builds and emits subagent:child-status for these workflow children.

Orca's src/main/pi/agent-status-subagent-roster-source.ts:87-89 subscribes to task:subagent:lifecycle, subagent:async-started and subagent:async-complete, but not subagent:child-status. The same file at line 22 deliberately excludes workflow wrappers from visible child rows. Consequently, the wrapper is hidden and the actual worker's announcement is not consumed. This is also true in the installed execution-host extension.

The likely fix belongs in the execution-host Pi status integration: consume the workflow-child lifecycle, associate the actual child with its parent, and clear it correctly on completion/failure/cancellation without exposing the wrapper or leaving stale rows. Preserve remote-host status ownership rather than inferring worker activity in the client.

Related merged work: #23201 added background child rows; #26909 improved workflow-child labels. Fresh searches found no issue or PR specifically covering this missing event subscription.

Activity

  1. mmarabel commented on Nov 13, 2026

    @mmarabel
    ContributorAuthor

    Update with a live trace. The cause is not the event gap I described above: the host has every child, and what paired desktop clients receive drops them. It also affects plain async subagents, not only workflow children, and the parent row itself shows Done.

    What happens (host: Linux orca serve 1.4.258; client: paired macOS desktop 1.4.258; pi-subagents 0.88.1)

    • A Pi pane starts async subagents, then ends its own reply. Two cases, both fail: 4 plain async single runs, and one async parallel workflow with 2 children.
    • On the host, orca worktree ps --json is correct: the pane is working, sidebarStatus: working, subagentObservation: live, and subagents lists every child (4 worker rows; 2 scout rows named task-1 / task-2).
    • The paired desktop sidebar shows the pane as Done (green check) with no child rows, for as long as the children run.

    Why (traced on upstream/main 048eefd; the live host data matches each step)

    1. When the parent's reply ends, Pi writes its OSC 7501 root record as done. programStatusActivity reads only the root record (src/shared/program-status/activity.ts:5), so the PTY's activity becomes idle even though the pi-subagents child records are still working.
    2. That status-only apply sets pty.lastAgentStatus = 'idle' and stamps lastAgentStatusRichInvalidatedAtEpochMs (src/main/runtime/terminal/output/terminal-title-observation.ts:144, :160).
    3. The hook's last update lands 1–2 ms before that (host data: hook updatedAt …712 vs program-status observedAt …713 in one pane, …172 vs …174 in the other). While the Pi extension holds the turn open for children it posts nothing newer, so the hook never wins back.
    4. The session-tab projection (runtime-mobile-session-projection.ts:215) runs renewRuntimeMobileAgentStatusFromPtyTitle (src/main/runtime/session-lifecycle/projection/runtime-mobile-agent-status-projection.ts:138-197). The hook can't own the idle title interval, so it publishes buildTitleOnlyStatus('done', …). That entry carries no subagents, children or subagentObservation, so the client shows Done with no children.

    #33738 fixed the same hold in the OSC projector lane (row state). The activity lane above still reads only the root, and it is the one paired clients see. orca worktree ps reads the hook store directly, which is why it disagrees with the client.

    Fix direction (host side, no renderer inference): keep program activity working while a live child record of the root's program exists (the fold #33738 added to agent-status-projector.ts), or let a fresh hook status that is held open by live child work own the idle title interval in renewRuntimeMobileAgentStatusFromPtyTitle. Either way, the published entry should keep its subagents.

    No open PR touches these files.

  2. mmarabel commented on Nov 18, 2026

    @mmarabel
    ContributorAuthor

    Still reproduces on newer builds: Linux orca serve host 1.4.263, paired macOS desktop 1.4.264 (hourly), pi-subagents 0.89.0.

    Same pattern as the trace above: a Pi pane starts 4 async subagents and ends its reply. On the host, orca worktree ps --json reports the worktree as working, while the paired desktop sidebar shows the parent as Done with no child rows. This is after #38207 and #38911 merged, so neither covers this case.

  3. added 2 commits that reference this issue on Nov 19, 2026
    95722f0
    a7108b2
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