Copilot telemetry hook write replaces all of ~/.copilot/hooks/aspire-telemetry.json
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read src/Aspire.Cli/Agents/Copilot/CopilotAgentClient.cs, especially ConfigureTelemetryHookAsync, and compare how the Claude settings.json path merges existing content. Check the existing tests for Copilot hook configuration and add coverage for preserving a hand-added hook across aspire agent init. Done means Aspire-managed entries are updated while other file content remains intact.
Written by the indexing model from the issue text.
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: https://github.com/microsoft/aspire/pull/22078#discussion_r4555641036
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
- Run
aspire agent initand configure Copilot so~/.copilot/hooks/aspire-telemetry.jsonis created. - Add a custom hook entry to that file by hand.
- Run
aspire agent initagain. - 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).
- Dominant language
- C#
- Stars
- 6.4k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 435
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/aspire
-
needs-area-label
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
microsoft/aspire#22144 · 1 comment ·
Maintainers usually reply within 2 days
-
Aspire.Hosting.Yarp flattens TimeSpan cluster settings (ActivityTimeout, health-check intervals) into per-property env vars the YARP container ignoresPossibly taken @itsrayeedscodespace claimed this 5 days ago. Openarea-integrations
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Dashboard structured logs toolbar overlaps the resource name and wraps poorly in constrained layoutsOpenarea-dashboard
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
area-dashboard
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
area-templates
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 2 days
All issues in microsoft/aspire
Similar issues
-
bug emitter:client:csharp
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/typespec#12572 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
AWS Lambda: KeyNotFoundException drops HTTP-triggered transactions when allowAllHeaders is disabledOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
newrelic/newrelic-dotnet-agent#3949 · 1 comment ·
Maintainers usually reply within 1 day
-
area-networking
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/aspnetcore#70545 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 80/100