[BUG] Monitor usage creates fake Subagent completion events
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Whenever a subagent uses a monitor (good they should) and yield to wait for any of the running monitors to create an event, the main agent gets a wrong "Agent ({name}) completed." message.
This can confuse the hell out of as well as annoy the main agent, as they get spammed with completion reports, to the extend that they can no longer focus on their own work.
What Should Happen?
If a subagent is alive and yielding due to awaiting monitor events, a completion message MUST NOT be generated. This is incorrect and spammy.
Instead if a subagent has been yielding while staying alive due to active monitors for some time span (e.g. 5min, 15min, 1h) without waking this should generate a message:
"Agent ({name}) has been waiting on monitor events for {} minutes without waking"
the main agent should have a tool to force a wake of the subagent with a message in case the main agent suspects the subagent to be stuck, due to an incorrectly configured monitor.
Steps to Reproduce
- ask the main agent to spawn a subagent with the task to configure a monitor that wakes then every 30 seconds.
- spam ensues.
Claude Model
All models
Is this a regression?
No, this never worked
Claude Code Version
2.1.165 (Claude Code)
Platform
Anthropic API
Operating System
Other Linux (any, does not matter)
Terminal/Shell
Other (any does not matter)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗