Background agents are cancelled when a new user turn emits user.abort
まだ誰も着手していません。
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
Describe the bug
Submitting a new user turn can send notifications/copilot -> user.abort to the active turn and cancel background subagents launched by that turn. The agents then appear as cancelled in the background-agent list, and their IDs later become unreadable after the aborted turn is garbage-collected.
This prevents the intended orchestration workflow where long-running background agents continue working while the user asks unrelated questions in the main session.
Affected version
GitHub Copilot CLI 1.0.71-1
Steps to reproduce the behavior
- Start two or more native task agents in
backgroundmode for long-running work. - Confirm that the agents are running.
- Submit another user message to the main session while the agents are still running.
- Inspect the background-agent list.
- Observe that agents associated with the previous turn are marked
cancelled; after turn cleanup, reading their IDs can returnAgent not found.
The behavior reproduced in two separate waves in one session. Repository worktrees and partial edits survived, but the agents had to be relaunched manually with reconstructed context.
Expected behavior
Per Steering agents in GitHub Copilot CLI, a new user message should steer the active task rather than implicitly trigger a full abort.
Background agents should continue running unless the new instruction explicitly cancels them or makes their assigned work obsolete. Unrelated background work should survive the new parent turn and remain readable.
If the CLI cannot preserve background agents across a new user turn, it should warn before submission that the message will cancel them and retain a resumable checkpoint for each cancelled agent.
Additional context
- macOS on Apple Silicon
- The cancellation was not caused by Computer Use interruption, model unavailability, agent duration limits, or session compaction.
- Runtime logs correlated both cancellation waves with explicit
user.abortnotifications. - For comparison, equivalent workflows in the GitHub Copilot desktop app and OpenCode 1.17.15 preserve background tasks across ordinary new user messages. This is supporting behavioral context; the Copilot CLI steering documentation above remains the expected-contract basis.
- This is related to, but distinct from, https://github.com/github/copilot-cli/issues/3344: in this case the new turn proceeds, but prior background agents are cancelled.
- Partial filesystem work persisted, so relaunching agents was possible, but parent-side progress and agent conversation state were lost.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、2つ以上のバックグラウンドエージェントを使うワークフローを再現し、新しいユーザーターン中に notifications/copilot user.abort イベントが発生していないかランタイムログを調べます。その通知の処理とターンのクリーンアップを追跡します。完了の条件は、無関係なバックグラウンドエージェントが実行中のまま読み取り可能であるか、キャンセル前に警告と再開可能なチェックポイントを受け取ることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- shell
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100