Skip to content

Copilot telemetry hook write replaces all of ~/.copilot/hooks/aspire-telemetry.json #22218

Open

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

CopilotAgentClient.ConfigureTelemetryHookAsync builds a new JSON object and writes it over the whole ~/.copilot/hooks/aspire-telemetry.json file. Any entries a user adds to that file by hand are lost each time aspire agent init runs, including a global refresh where no agents are selected. This whole-file write has been on main since #18009 and moved into CopilotAgentClient in #20946.

The file is named for Aspire and owned by it, and Copilot reads every file in ~/.copilot/hooks, so users can keep their own hooks in other files. Even so, merging into existing content (as the Claude settings.json path already does) would be safer.

Raised in review on #22078: #22078 (comment)

Expected Behavior

Running aspire agent init updates only the Aspire-managed hook entries in aspire-telemetry.json and preserves any other content in the file.

Steps To Reproduce

  1. Run aspire agent init and configure Copilot so ~/.copilot/hooks/aspire-telemetry.json is created.
  2. Add a custom hook entry to that file by hand.
  3. Run aspire agent init again.
  4. The custom entry is gone.

Exceptions (if any)

N/A

Aspire doctor output

N/A

Anything else?

Relevant code: src/Aspire.Cli/Agents/Copilot/CopilotAgentClient.cs (ConfigureTelemetryHookAsync).

Activity

  1. added
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions