claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Closing a /btw side pane stopped an unrelated background agent, recorded it as "stopped by user", and resume was then refused

Open voidfreud opened this issue 1 month ago • 0 comments

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

A long-running background subagent (launched with the Agent tool, run_in_background: true) was terminated when I closed a /btw side-question pane. I did not stop the agent.

  • The task notification reported: status: killed, summary Agent "…" was stopped by user.
  • When the main session tried to resume the agent with SendMessage, it was refused: Agent "<id>" was stopped by the user and was not resumed. Treat its work as cancelled; only start a new agent for it if the user explicitly asks.

So closing an unrelated UI pane (1) killed a different agent and (2) was attributed to me, which (3) then blocked resuming it. Its in-progress work had to be recovered from its transcript by a new agent.

What Should Happen?

Closing a /btw pane should only close that pane. Background agents should keep running. If an agent does get stopped by a UI action, it shouldn't be labelled as an explicit user stop, and resuming should remain possible.

Error Messages/Logs

<task-notification> … <status>killed</status> <summary>Agent "Round 4 record coordinator" was stopped by user</summary>
SendMessage → {"success":false,"message":"Agent \"<id>\" was stopped by the user and was not resumed. Treat its work as cancelled; only start a new agent for it if the user explicitly asks."}

Steps to Reproduce

  1. Start Claude Code 2.1.304 in a terminal.
  2. Have the main session launch a background subagent that runs for several minutes (Agent tool, run in background).
  3. While it runs, open a side question with /btw …, wait for the answer, then close the /btw pane.
  4. Observe the background agent's notification: killed / "stopped by user".
  5. Ask the main session to resume it (SendMessage to the agent id) → refused as above.

Is this a regression?

I don't know

Claude Code Version

2.1.304

Platform

Anthropic API

Operating System

macOS (26.x)

Terminal/Shell

Other (Ghostty)

Additional Information

Related /btw issues: #96019, #95521.

voidfreud avatar Oct 20 '26 17:10 voidfreud