Skip to content

OMP provider: show subagents spawned by OMP's task tool #30

Backlog

Description

@Mokson

Summary

When the OMP provider (omp --mode rpc) spawns subagents with its built-in task tool, the thread shows the call as one generic tool row. No subagent cards appear and no child work is listed, although the Pi adapter it reuses already emits subagent.updated events for pi-subagents.

Why it happens

Checked against m3code ed18486 and oh-my-pi 0b04850.

  • packages/provider-omp reuses the Pi adapter (createPiAdapterV2Driver with OMP_FLAVOR). The adapter projects subagents only when toolName === "subagent" (packages/provider-pi/src/server/adapter.ts:1539), which is the pi-subagents extension's tool name. OMP's tool is named task (oh-my-pi/packages/coding-agent/src/task/index.ts:674), so it falls through to the generic dynamic_tool item.
  • Changing the name check alone is not enough, because OMP's TaskToolDetails (src/task/task-details.ts:420) differs from the pi-subagents shape in three ways:
    • Result text: a successful subagent's text is in SingleResult.output. piSubagentOutput reads only messages (and errorMessage/stderr on failure), so finished cards would show no result.
    • Live progress: while a call runs, its updates carry details.progress[] (AgentProgress), and results[] stays empty until subagents finish. emitSubagentTasks reads only results, so running subagents never appear.
    • Background runs: these report details.async = { state, jobId, type: "task" }. The adapter tracks only details.asyncId plus the subagent-async widget, so background OMP tasks are not tracked.
  • On the ACP route (OMP as an ACP agent), provider-acp-registry gives OMP only extractElicitationForm. There is no extractSubagentUpdate as there is for Claude, Devin and Copilot, so task calls are plain tool calls there too.

Proposal

  1. In the Pi adapter, treat task like subagent. Gate on the flavor (OMP only) or on the details shape, so a Pi user's custom task tool is not misread.
  2. Map OMP's SingleResult fields: output for the result text, exitCode for the status, and agent, task and description/assignment for the title.
  3. Build running cards from details.progress[] on tool_execution_update.
  4. Track background runs by details.async.jobId until they settle, and keep the existing background_work.updated pending signal.
  5. Add a test that replays a recorded OMP task start, update and end sequence: foreground, parallel and async.

Optional follow-up: OMP keeps a session per subagent (SessionObserverRegistry, registerPersistedSubagents). If RPC exposes those session ids, set exposesSubagentThreadIds and pass childThreadId, so each subagent opens as its own child thread as ACP-Claude's do.

Expected result

An OMP turn that calls task shows one subagent card per spawned agent. Each card shows the agent name, the task, a live status (running, completed, failed or interrupted), its progress and its final output, and background tasks keep updating after the coordinator's turn ends.

Activity

  1. MiaAI-Lab commented on Nov 26, 2026

    @MiaAI-Lab
    Owner

    Thanks for the detailed write-up — the analysis matches the code: on main, packages/provider-pi/src/server/adapter.ts projects subagent cards only for toolName === "subagent", so OMP's task calls fall through to a generic tool row. #31 implements this proposal and is in review; its remaining blocker is that background task runs are marked interrupted when omp's turn settles instead of staying tracked until they finish. Leaving this open until #31 lands.

    (Review notes prepared with Claude Code on behalf of the maintainer.)

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