anthropics / anthropics/claude-code

[Bug] Subagent duplicate spawning due to misinterpreted watch-armed status reports

Open
#95,612 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:agents bug platform:macos
Dominant language
TypeScript
Stars
147k
Forks
24k
PR merge metrics
PR metrics pending

Description

Bug Description
Fable spawned two subagents to execute on the same task. As it describes it

"Duplicate seats. The harness sends me a "finished" notice every time a subagent ends its turn, including when it only stops to wait on a watch it armed. Three times I read "finished" as "dead" and spawned a replacement without checking. The check was available and cheap: each of those reports literally said "holding on the armed watch" or "monitor armed". I did not read for that; I pattern-matched the status line and applied the "never message a stopped agent, spawn fresh" rule reflexively. The old seats then woke on their watches and worked the same worktree as the new ones. Cost: roughly three full Opus seats of duplicated work plus the OOM and false-red churn. Rule I now follow: a report that names a wake source is not a dead seat; wait for the wake, never replace it."

The "never message a stopped agent" rule is due to another bug where resuming a subagent reattaches it under the main session instead of its proper parent.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.270
  • Feedback ID: cd5e179c-1f99-4f56-832d-d2b2a8354521

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the duplicate-spawn flow described in the report, then trace how “finished” reports containing “holding on the armed watch” or “monitor armed” are classified. Done means watch-armed seats are not replaced while genuinely ended seats still are.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai-infra-agents, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.