Skip to content

Add diagnostic report generation for troubleshooting extension issues#103

Merged
rajbos merged 8 commits intomainfrom
copilot/add-logging-report-feature
Jan 6, 2026
Merged

Add diagnostic report generation for troubleshooting extension issues#103
rajbos merged 8 commits intomainfrom
copilot/add-logging-report-feature

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

Users report extension failures without diagnostic context, making troubleshooting difficult. This adds a diagnostic report feature that captures environment state, file discovery results, and aggregated statistics without exposing code or conversation content.

Changes

New Command & UI

  • copilot-token-tracker.generateDiagnosticReport command via Command Palette
  • "Diagnostics" button in details panel footer
  • Webview panel with copy-to-clipboard and GitHub issue link

Report Contents

  • Extension/VS Code versions, OS, Node version, environment (Codespaces/Remote/Local)
  • Copilot extension status and versions (attempts tier detection via API)
  • Session file locations (first 20) with sizes and timestamps - no content
  • Token statistics: today/month totals, model breakdown, sessions, interactions
  • Cache hit/miss rates

Implementation

  • Async file stat operations (Promise.all) to avoid blocking
  • Repository URL helper method to centralize GitHub links
  • Structured status display instead of raw JSON dump

Example Report Output

## Session Files Discovery
Total Session Files Found: 15

Session File Locations (first 20):
  1. /home/user/.config/Code/User/workspaceStorage/.../session1.json
     - Size: 12458 bytes
     - Modified: 2026-01-06T14:30:00.000Z

## Token Usage Statistics
### Today
  - Total Tokens: 12,458
  - Sessions: 5
  - Models Used:
    * gpt-4o: 8,234 tokens (↑4,117 ↓4,117)
    * claude-sonnet-3.5: 4,224 tokens (↑2,112 ↓2,112)

Report contains only file metadata and aggregated statistics - safe for public sharing.

Original prompt

Sometimes users report that the extension does not work. Add a way to report back the logs from the output panel for the extension and let the user either directly add that to an issue in GitHub or share privately

I want to see the files we found (only their locations), if we found matching json files, and what we pulled out of them in terms of tokens, models, sessions and such. If possible, report if this is a copilot free/pro/pro+/business/enterprise user or not. Add information about extension version, VS Code version, OS, and perhaps other things you can think of.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits January 6, 2026 14:44
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
…handling

Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Copilot AI changed the title [WIP] Add logging report feature for extension issues Add diagnostic report generation for troubleshooting extension issues Jan 6, 2026
Copilot AI requested a review from rajbos January 6, 2026 15:00
@rajbos rajbos marked this pull request as ready for review January 6, 2026 17:27
@rajbos rajbos merged commit d9c6f4a into main Jan 6, 2026
13 checks passed
@rajbos rajbos deleted the copilot/add-logging-report-feature branch January 6, 2026 17:27
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.

2 participants

Comments