github / github/copilot-cli

`agentStop` triggering on subagent turns causing `/review` to never finish/return

オープン
#3,894 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
area:agents area:plugins
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

### Describe the bug

I have a custom hook registered to `agentStop` that instructs the agent to improve instructions files based on the work it did and issues it ran into (if instructions were out-of-date) [digivolution](https://github.com/scaryrawr/scarypilot/tree/main/plugins/digivolution).

This is intended to only be ran by the main agent, which [hook events](https://docs.github.com/en/copilot/reference/hooks-reference#hook-events) mentions the `agentStop` fires when:
> The main agent finishes a turn.

When running subagents lately, I see that `/review` never succeeds because the subagent is running main agent stop hooks:

![Image](https://github.com/user-attachments/assets/480bc829-0f9b-40c6-a2e9-e408b59a984f)

![Image](https://github.com/user-attachments/assets/b43664c2-dd3e-4e07-9090-8f79ba8bdd67)

Since the stop hook can trigger the agent to keep working, it ends up the subagent never submits the review response, even though it finished the stop hook condition as well.

### Affected version

GitHub Copilot CLI 1.0.64-3

### Steps to reproduce the behavior

1. Register a `stopAgent` hook that can block the agent turn from ending
2. Do a `/review` in a codebase where it uses subagents

### Expected behavior

The subagent should not run the `stopAgent` hook since there is a separate `subagentStop` hook and `stopAgent` is documented as not being used for subagents.

The actual behavior is that `stopAgent` is also picked up by subagents and ran.

### Additional context

_No response_

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

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

調査の方向性

Start by reproducing `/review` with a blocking `stopAgent` hook on GitHub Copilot CLI 1.0.64-3, then compare the documented `agentStop` and separate `subagentStop` behavior. Trace hook handling during subagent turns; done means subagents no longer run `stopAgent`, while the main agent still does and `/review` returns.

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

評価

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

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

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