github / github/copilot-cli

Autopilot background-task timeout exits active parent after subagent completes

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

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

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

説明

Describe the bug

In autopilot mode, the 600-second background-task wait timeout terminates the
entire Copilot CLI process even after the background subagent has completed and
the parent agent has resumed work.

The timeout appears to start from when the parent first becomes idle.
It is not cancelled or reset when the background task completes.

The process exits with code 0, causing automation to treat the interrupted run
as successful.

Affected version

1.0.80

Steps to reproduce the behavior
  1. Start Copilot CLI in autopilot mode.
  2. Launch a background subagent that remains active for several minutes.
  3. Allow the parent agent to become idle while awaiting that subagent.
  4. Let the subagent complete before the configured COPILOT_TASK_WAIT_TIMEOUT_SECONDS deadline.
  5. Allow the parent to resume work.
  6. Original timer still fires and exits the entire process, even though the parent is active and the subagent has finished.

Observed timeline from one run:

06:07:40 - background subagent started
06:10:52 - parent became idle while waiting
06:19:12 - subagent completed; parent resumed
06:20:48 - parent was actively streaming an edit tool call
06:20:52 - exactly 600 seconds after the parent became idle, Copilot emitted:
"Timed out after 600s waiting for background tasks to finish; exiting.
Set COPILOT_TASK_WAIT_TIMEOUT_SECONDS to change the limit."

The process then returned exitCode: 0.
The in-progress edit was never executed.

Expected behavior

When a background-task timeout is reached, Copilot CLI should:

  1. Cancel only background tasks that are still running.
  2. Return control to the parent with a timeout notification.
  3. Cancel the wait timer when all background tasks complete.
  4. Not terminate an active parent because of a stale background-task timer.

If a session-level deadline intentionally terminates the process, it should be reported as a timeout with a nonzero exit status rather than successful completion.

Additional context

copilot-cli-timeout-redacted-logs.zip

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

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

はじめの一歩

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

調査の方向性

まず、autopilot mode における COPILOT_TASK_WAIT_TIMEOUT_SECONDS の処理とバックグラウンドタスク完了のライフサイクルを追跡します。6 段階のシナリオを再現し、サブエージェントが完了して親が再開したときに待機タイマーがキャンセルされるかを検証し、意図的なセッションタイムアウトがゼロ以外の終了ステータスを報告することを確認します。

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

評価

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

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

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