microsoft / microsoft/vscode

Add local timestamps to Agent Host network diagnostics files for traceability

Open
#331,677 0 comments 0 reactions 1 assignee Assigned to @chrmarti View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Description
When troubleshooting issues with Agent Host network diagnostics in VS Code, generating multiple diagnostic files lacks chronological metadata. This makes it difficult to correlate events across multiple diagnostic runs and establish a clear timeline of connectivity issues.

## Problem
Currently, the Agent Host network diagnostics feature generates diagnostic files and output without timestamps in:
- **Filenames**: Generated files have UUIDs but no temporal information
- **File contents**: Diagnostic reports don't include when each test was executed
- **Log entries**: Individual probe results lack precise timestamps

When debugging multiple connectivity issues over time, users must manually track when each diagnostic was run, 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

## Solution
Add ISO 8601 local timestamps throughout the diagnostics system:

1. **Filename Timestamps**: Include ISO 8601 timestamp in diagnostic archive names
- Current: `agent-host-debug-logs-{uuid}.zip`
- Proposed: `agent-host-debug-logs-2026-08-19T14-30-45Z-{uuid}.zip`

2. **Report Header Timestamps**: Add timestamp metadata to diagnostics report
- Include when diagnostics collection started and completed
- Show local timezone for user context

3. **Per-Probe Timestamps**: Add precise timestamps for each network connectivity test
- DNS probe start/end times
- HTTP fetch start/end times
- Individual endpoint test timings

## Related Code Files
- `src/vs/workbench/contrib/chat/electron-browser/actions/networkDiagnosticsAction.ts` - Network diagnostics collection and formatting
- `src/vs/platform/agentHost/node/networkDiagnosticsService.ts` - Network diagnostics service
- `src/vs/platform/agentHost/node/agentHostDebugLogs.ts` - Debug logs artifact generation

## Benefits
- ✅ Improved traceability when troubleshooting connectivity issues
- ✅ Better correlation of events across multiple diagnostic runs
- ✅ Clearer understanding of when issues occurred
- ✅ Enhanced debugging workflow for support and development teams
- ✅ Easier identification of time-based patterns in network issues

## Example Impact
Before: "Found 5 network diagnostic files - which one is from the issue I'm debugging?"
After: "File from 2026-08-19T14:30:45Z shows the connectivity failure clearly"

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.