Make it so the debug logging is more useful#152
Open
richardpark-msft wants to merge 3 commits intomicrosoft:mainfrom
Open
Make it so the debug logging is more useful#152richardpark-msft wants to merge 3 commits intomicrosoft:mainfrom
richardpark-msft wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #152 +/- ##
=======================================
Coverage ? 73.70%
=======================================
Files ? 141
Lines ? 15905
Branches ? 0
=======================================
Hits ? 11722
Misses ? 3333
Partials ? 850
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Improves the usefulness of Copilot session debug logging by filtering noisy events and emitting richer structured attributes, with golden testdata to validate the output format.
Changes:
- Introduce
NewSessionToSlog()to filter/shape Copilot session events before logging. - Expand logged fields (model/producer/session/context + tool arguments/results) and add golden NDJSON fixtures.
- Update call sites to use the new handler and add tests that validate the produced slog JSON.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/utils/logging.go | Adds NewSessionToSlog() wrapper, expands logged attributes, and introduces map/group helpers. |
| internal/utils/logging_test.go | Updates existing tests and adds golden-output and helper tests for slog formatting. |
| internal/utils/testdata/sample_events.jsonl | Adds session event fixture input (NDJSON). |
| internal/utils/testdata/sample_events_slog.jsonl | Adds expected slog JSON output fixture (NDJSON). |
| internal/graders/prompt_grader.go | Switches session event handler registration to NewSessionToSlog(). |
| internal/execution/copilot.go | Switches session event handler registration to NewSessionToSlog(). |
- Omits some entries, like report_intent, that just add noise to the debugging process. Had to have some state to do this since only the tool.execution_start indicates that it's a report_intent event. - Dive into the arguments, input and context parameters, which usually contain important information. - Output the selected model, and the producer (ie: the agent)
fe4fa2d to
5e55f45
Compare
…does the event testing a bit to make it more readable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prior to this we were just logging some common attributes, but were missing some important fields. We also didn't skip/omit any events, which meant the display was cluttered with things like report_intent events, etc..
We're also now diving into the arguments, input and context dictionaries, which usually contain important information and output the session chosen model and agent (ie: producer).