Skip to content

Make it so the debug logging is more useful#152

Open
richardpark-msft wants to merge 3 commits intomicrosoft:mainfrom
richardpark-msft:wz-logging
Open

Make it so the debug logging is more useful#152
richardpark-msft wants to merge 3 commits intomicrosoft:mainfrom
richardpark-msft:wz-logging

Conversation

@richardpark-msft
Copy link
Member

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).

Copilot AI review requested due to automatic review settings March 19, 2026 23:39
@richardpark-msft richardpark-msft marked this pull request as draft March 19, 2026 23:39
@codecov-commenter
Copy link

codecov-commenter commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 96.55172% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@52e123f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/graders/prompt_grader.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #152   +/-   ##
=======================================
  Coverage        ?   73.70%           
=======================================
  Files           ?      141           
  Lines           ?    15905           
  Branches        ?        0           
=======================================
  Hits            ?    11722           
  Misses          ?     3333           
  Partials        ?      850           
Flag Coverage Δ
go-implementation 73.70% <96.55%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copilot AI review requested due to automatic review settings March 20, 2026 00:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

…does the event testing a bit to make it more readable.
@richardpark-msft richardpark-msft marked this pull request as ready for review March 21, 2026 04:14
Copilot AI review requested due to automatic review settings March 21, 2026 04:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants