Add local timestamps to Copilot Chat diagnostics files for improved traceability
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Description
When troubleshooting issues with GitHub Copilot Chat in VS Code, exporting or collecting multiple diagnostic files lacks chronological metadata. This makes it difficult to correlate events across multiple diagnostic runs and establish a clear timeline of chat-related issues.
## Problem
Currently, the Copilot Chat diagnostics feature generates diagnostic files and output without timestamps in:
- **Filenames**: Generated diagnostic files have UUIDs or generic names but lack temporal information
- **File contents**: Diagnostic reports don't include when diagnostics were collected or when individual events occurred
- **Debug logs**: Individual event logs lack precise timestamps for correlation across multiple exports
When debugging multiple Copilot Chat issues over time, users must manually track when each diagnostic was collected, leading to:
- Difficulty correlating events across multiple diagnostic exports
- Loss of chronological context when files are moved or shared
- Inefficient troubleshooting workflows with unclear timelines
- Inability to match Chat events with system logs or other diagnostics that have timestamps
## Solution
Add ISO 8601 local timestamps throughout the Chat diagnostics system:
1. **Filename Timestamps**: Include ISO 8601 timestamp in diagnostic export filenames
- Example: `copilot-chat-diagnostics-2026-08-19T14-30-45Z.json`
- Enables quick visual identification of when diagnostics were collected
2. **Report Header Timestamps**: Add timestamp metadata to diagnostics report
- Collection start time and completion time
- Local timezone for user context
- Reporter user info and session identifiers
3. **Per-Event Timestamps**: Add precise timestamps for individual chat events
- Message send/receive times
- Tool execution start/end times
- Permission/approval event times
- Debug log entry times
## Related Code Files
- `extensions/copilot/src/extension/log/vscode-node/loggingActions.ts` - Diagnostics collection and formatting
- `src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.ts` - Reference implementation with ISO timestamps
- `extensions/copilot/docs/monitoring/agent_monitoring_arch.md` - Monitoring and traceability documentation
- `extensions/copilot/src/extension/chatSessions/copilotcli/vscode-node/tools/getDiagnostics.ts` - Diagnostics tool implementation
## Benefits
- ✅ Improved traceability when troubleshooting Chat connectivity and functionality issues
- ✅ Better correlation of events across multiple diagnostic exports
- ✅ Easier timeline reconstruction for debugging complex Chat issues
- ✅ Enhanced ability to match Chat diagnostics with system logs (which already have timestamps)
- ✅ Clearer understanding of when issues occurred and their sequence
- ✅ More professional diagnostic reports with complete temporal context
- ✅ Better support experience for development and support teams
## Example Impact
**Before**: "I have 5 Copilot Chat diagnostic exports - which one captured the issue I'm debugging?"
**After**: "The diagnostic from 2026-08-19T14:30:45Z shows the exact failure point with clear event sequence"
## Acceptance Criteria
- [ ] All Copilot Chat diagnostic export files include ISO 8601 timestamp in filename
- [ ] Diagnostic report header includes collection start/end times and timezone
- [ ] All individual events in diagnostic logs include precise timestamps
- [ ] Timestamps work correctly across different timezones and locales
- [ ] Timestamps are preserved when diagnostic files are shared or moved
- [ ] Documentation updated to explain timestamp format and usage
Contributor guide
Assessment
This issue has not been assessed yet.