8000 handle subprocess status · Issue #272 · amirlehmam/wmux · GitHub
[go: up one dir, main page]

Skip to content
10BC8

handle subprocess status #272

Closed
Closed

Description

@arnonuem

Any ideas on how to get there?

Image

Activity

  1. self-assigned this
    on Oct 7, 2026
  2. amirlehmam commented on Oct 7, 2026

    @amirlehmam
    Owner

    Thanks for the screenshot, it shows the problem well: the planner is still calling create_file while the row above says Inaktiv.

    Shipped in v2.19.0. Subagents now get their own lines under the parent workspace row, and the row reads Orchestrating · N agents (green dot) for as long as any of them is still running. The parent's turn ending no longer clears them.

    How it works depends on the agent:

    • Claude Code: automatic. wmux registers the SubagentStart hook and reads the agent_id Claude Code attaches to every hook fired from inside a subagent. Each subagent therefore gets its own line (├ Explore ⚒3 · Bash), and that line ends on its own SubagentStop. Restart wmux once after updating so the hook gets written.
    • Anything else (from the >>> prompt and the BACKGROUND badge, your harness doesn't look like Claude Code): it can declare its subagents with one command. Call it from wherever it starts or updates a background task:
      wmux report-subagent planner-1 --name planner --detail "calling create_file"   # start / update
      wmux report-subagent planner-1 --done                                          # finish
      Reusing the same id updates the line, and every call also counts as a heartbeat. A running line that stays silent for 10 minutes stops being drawn, so a missed --done won't leave a ghost. The command only affects the display: it never sets or clears Needs you on the pane. The pane id comes from $WMUX_SURFACE_ID, which every wmux pane already has.

    What are you running in that pane? If it's an agent with a hook or plugin system (pi, OpenCode, Grok…), I can wire its subagent events to this directly so you don't have to.

  3. arnonuem commented on Oct 8, 2026

    @arnonuem
    Author

    Thanks, v2.19.0 looks great!

    What's running in that pane is a Python-based agent CLI that I extend with my own plugins, so it's not something you'd need to support directly. The Claude Code path can't kick in for it: it doesn't read ~/.claude/settings.json, has no SubagentStart-style event,
    and its sub-agent runs don't go through its normal run-start/end hooks.

    I already have my own plugin for it that talks to wmux over the named pipe (pane.report_agent_state, agent.activity, pane.release_agent), so I'll wire agent.subagent in myself: id = the sub-agent's session id, name = agent name, detail = current tool/thinking
    state, done on completion. Background sub-agents outlive the parent turn, which your 10-minute heartbeat timeout already covers nicely.

    Two quick questions:

    1. Is agent.subagent considered a stable v2 RPC I can call directly over the pipe, or should I go through wmux report-subagent?
    2. Is there a rate limit or recommended max frequency for detail updates?
  4. arnonuem commented on Oct 8, 2026

    @arnonuem
    Author

    Small thing I noticed while wiring agent.subagent: the doc comment on endDeclaredSubagents says it runs on "SessionEnd, release-agent", but as far as I can see only the Claude Code SessionEnd hook path calls it. pane.release_agent doesn't. So a harness that declares sub-agents via report-subagent and then just releases the pane leaves those lines "running" until the 10-minute silence cutoff. I work around it by sending --done for every line before the release, so it's not blocking me. Either the comment or the release handler might want a look.

  5. arnonuem commented on Oct 8, 2026

    @arnonuem
    Author
    Image

    Just awesome !!!
    exactly how i expected it to be - love it

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

    0