Skip to content

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

Description

@scaryrawr

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.

This is intended to only be ran by the main agent, which 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

Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions