8000 Sidebar shows Claude Code `web-fetch` subagent as running forever (no SubagentStart/SubagentStop for it) · Issue #464 · amirlehmam/wmux · GitHub
[go: up one dir, main page]

Skip to content

Sidebar shows Claude Code web-fetch subagent as running forever (no SubagentStart/SubagentStop for it) #464

Closed

Description

@alexboost222

What happens

After a Claude Cod 8000 e turn that used the built-in web-fetch subagent, the pane's sidebar keeps a web-fetch subagent line in the running state. The session is idle at its prompt, and the line stays until the session ends (SessionEnd).

Why

Claude Code (2.1.302) fires no SubagentStart and no SubagentStop for the built-in web-fetch subagent. Its tool calls still fire PreToolUse with agent_id and agent_type: "web-fetch".

In wmux 2.64.0:

  • PreToolUse with an agent_id → reportSubagent(sid, { id, name, toolUse: true }), which creates a declared line.
  • The line ends only on SubagentStop with that agent_id, on SessionEnd, or on a fresh SessionStart.
  • markAllAgentsDone on the parent's Stop leaves declared lines alone (handle subprocess status #272).

So the line gets created and nothing ever ends it.

Repro (hook logger, no wmux needed)

hooks.json logs SubagentStart / SubagentStop / PreToolUse / Stop payloads to a file. Then run:

echo "Use the Agent tool with subagent_type web-fetch to fetch https://example.com and report its title." \
  | claude -p --settings hooks.json --allowedTools Agent WebFetch

Logged events:

subagent_type SubagentStart PreToolUse inside (agent_id) SubagentStop
web-fetch — WebFetch, agent_type: web-fetch —
general-purpose (same setup, Glob) ✓ ✓ ✓

The subagent's subagents/agent-<id>.meta.json has "finished": true, "requestShape": "foreground", so Claude Code considers it done.

Possible fixes (your call)

  • A declared line that was created from a tool event and never had a SubagentStart could end on the parent's Stop. A subagent with no SubagentStart can't be the background kind that handle subprocess status #272 keeps alive.
  • Or end the line on the parent's PostToolUse for Agent, if its tool_response carries the agentId.

The missing hooks are arguably a Claude Code bug. Even so, wmux would need a fallback for any subagent type that skips the lifecycle hooks.

Environment

  • wmux 2.64.0, Windows 11 Pro (26200)
  • Claude Code 2.1.302

Activity

  1. amirlehmam commented on Nov 19, 2026

    @amirlehmam
    Owner

    Thanks for the trace, it made this quick. I reproduced it with the same hook logger on Claude Code 2.1.323: web-fetch still fires no SubagentStart and no SubagentStop.

    Fixed in 2.64.1, with both of your suggestions:

    • The line ends when the parent's Agent call returns. The parent's PostToolUse for Agent does carry the id: tool_response.agentId, with status: "completed". The hook helper forwards that id and nothing else from the response. A background launch answers with another status, so it keeps running.
    • Backstop: the parent's Stop ends a line that was never announced. A line created by a tool event, with no SubagentStart, ends with the turn. A subagent that did fire SubagentStart, or one declared with wmux report-subagent, keeps the handle subprocess status #272 rule and outlives the turn. SubagentStart is an async hook, so one that lands after the subagent's first tool call still counts.

    So a web-fetch line now goes away as soon as the subagent hands back, not only at the end of the turn.

    One limit: the first path needs tool_response.agentId, which I only checked on 2.1.323. On a Claude Code version without it, the line ends at the parent's Stop.

    The missing hooks do look like a Claude Code bug, and worth reporting there. This fallback covers any subagent type that skips them.

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

      0