Make it so the debug logging is more useful#152
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:
|
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.
spboyer
left a comment
There was a problem hiding this comment.
Looks nice improvements to debug logging. Approving.
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).