github / github/copilot-cli

Cancelled user input is still delivered to the agent and processed as a valid turn (autopilot mode)

オープン
#4,336 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

area:agents area:input-keyboard
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

Describe the bug

Summary

When I cancel a queued input before it is sent, the cancelled text is not discarded. It reappears later — bundled into a subsequent message block, carrying its original (older) timestamp — and the agent processes it as a normal user turn, with no indication it was ever cancelled. This happened in autopilot mode, in a session that also showed unstable tool availability (see "Possibly related" below).

Possibly related (same session, may share a root cause in turn/tool scheduling):

  • The session was running in autopilot mode the whole time.
  • The task_complete tool was repeatedly present and then absent across turns. The autopilot reminder text ("You have not yet marked the task as complete using the task_complete tool...") kept firing on turns where task_complete was NOT actually in the available tool list, so the agent could not comply and got stuck re-confirming that it was idle.
  • Both symptoms look like state being assembled from stale/mismatched snapshots between turns (a stale queued input on one side, a stale tool list / reminder on the other), so they may be the same underlying issue.

Impact:

  • The agent wastes a turn acting on something I explicitly cancelled.
  • Cancel doesn't actually cancel, which is confusing and erodes trust.
  • Potentially risky in autopilot mode: autopilot acts without waiting for confirmation, so a cancelled input containing a destructive command could be executed.
  • The task_complete reminder loop wastes turns and tokens.

Suggested fix:

  • Discard cancelled inputs at the delivery/queue layer so they never reach the agent context. If a cancelled input must still be forwarded, tag it explicitly (e.g. [cancelled]) so the agent can safely ignore it.
  • Only emit the autopilot "mark the task complete" reminder on turns where the task_complete tool is actually exposed to the model.
Affected version

GitHub Copilot CLI v1.0.77

Steps to reproduce the behavior
  1. Run the CLI in autopilot mode (/autopilot), inside tmux over SSH.
  2. Type an input (in my case "captain setup flyte") and cancel it before/while it is being submitted.
  3. Continue the session with a different, unrelated message some time later.
  4. The cancelled input is delivered to the agent alongside the new message, and the agent starts acting on it.
Expected behavior

A cancelled input should be dropped at the delivery layer and never enter the conversation history. The agent should never see it.

Additional context
  • GitHub Copilot CLI v1.0.77
  • Model: Claude Opus 4.8
  • Autopilot mode: ON
  • OS: Linux, running inside tmux over SSH

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず autopilot モードでキャンセルされた入力のフローを再現し、その後のメッセージブロックを組み立てる queue/delivery 経路を追跡します。キャンセルされた入力が決して会話履歴に入らないことを確認し、さらに task_complete リマインダーがそのツールを利用できる場合にのみ発行されることを個別に確認します。

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

評価

技術スタック
shell
領域
cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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