anthropics / anthropics/claude-code

Stop/interrupt kills in-flight background agents — should interrupt the turn, not the workers

オープン
#88,942 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:agents duplicate
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

## Problem

Pressing stop/interrupt during a turn cascades the kill to background subagents spawned via the Agent tool (run_in_background: true). In a long-running orchestration session (multi-agent engine-porting project), the user pressed stop intending only to interject — to stop the assistant's current output — and the harness killed a background fixer agent that was mid-iteration on a build-and-verify loop, discarding its in-context state.

The user's mental model: **stop = interrupt the conversation turn; background workers keep working.** The actual behavior: stop = kill the turn *and* its spawned background tasks. The user compared this unfavorably to other tools' handling of long-running work.

## Why it matters

Sessions that orchestrate background agents treat them as durable workers, not disposable turn-scoped calls. When stop kills them:
- work in the agent's context (not yet committed/written) is lost;
- the operator becomes afraid to interject, which defeats the point of interactive steering;
- there is no way to say "pause output, let the workers finish."

We now defensively require every agent to checkpoint to disk every ~25 tool uses purely because a user interjection can kill it — that's workaround, not design.

## Suggested behavior (any of)
1. Stop interrupts the assistant's turn only; background tasks keep running (with a visible way to stop them individually — they already appear as tasks).
2. If a stop would kill running background tasks, prompt: "3 background agents are running — stop them too? [interrupt only / stop everything]".
3. A distinct 'pause' affordance that quiesces background agents (signal them to checkpoint and stand down) instead of SIGKILL semantics.

## Environment
Claude Code desktop app, macOS (Darwin 25.5.0), long-running session with Workflow + Agent background tasks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start by tracing the desktop app's stop/interrupt handling and the Agent tool's run_in_background task lifecycle. Done means interrupting the current turn no longer kills background agents, or presents an explicit choice to stop them, with a visible way to stop individual tasks.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
macos
領域
desktop, devtools
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。