Skip to content

Add VS Code extension for Copilot chat session health tracking#1

Draft
Copilot wants to merge 8 commits intomainfrom
copilot/track-chat-session-health
Draft

Add VS Code extension for Copilot chat session health tracking#1
Copilot wants to merge 8 commits intomainfrom
copilot/track-chat-session-health

Conversation

Copy link

Copilot AI commented Jan 12, 2026

Implements a VS Code extension to prevent GitHub Copilot context window exhaustion by tracking message count, warning at threshold, and enabling session handoff.

Implementation

  • Message tracking: Monitors text document changes (>10 chars) as proxy for chat interactions, persists count and session start time to workspace state
  • Status bar indicator: 💬 Chat: N (normal) / ⚠️ Chat: N (warning with orange background)
  • Threshold warning: Configurable limit (default: 20), shows notification with Export/Reset/Dismiss actions
  • Session export: Generates markdown summary with duration, count, status, and handoff recommendations
  • Commands: Copilot: Export Session Summary and Copilot: Reset Session Count

Configuration

"copilot-handoff.messageThreshold": 20,    // Warning threshold (min: 1)
"copilot-handoff.enableTracking": true,    // Toggle tracking
"copilot-handoff.showStatusBar": true      // Toggle status bar visibility

Architecture

Extension activates on startup, restores state from workspaceState, and tracks via onDidChangeTextDocument. Warning triggers once per threshold crossing. Session start time persists across restarts for accurate duration calculation.

Known Limitation

Uses text edits as proxy for Copilot chat events since VS Code Extension API doesn't expose chat-specific events. Provides best-effort approximation within API constraints.

Original prompt

VS Code extension that helps developers manage GitHub Copilot chat session health. Track the number of user messages/exchanges in active chat sessions. Display current count in status bar. Warn users at configurable threshold (default 20) that context may degrade. Provide command to export session summary for handoff to new chat. Goal: prevent context window exhaustion and lost work by prompting timely session refresh.


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

Copilot AI and others added 7 commits January 12, 2026 07:58
Co-authored-by: chf3198 <5415358+chf3198@users.noreply.github.com>
Co-authored-by: chf3198 <5415358+chf3198@users.noreply.github.com>
Co-authored-by: chf3198 <5415358+chf3198@users.noreply.github.com>
…on display

Co-authored-by: chf3198 <5415358+chf3198@users.noreply.github.com>
Co-authored-by: chf3198 <5415358+chf3198@users.noreply.github.com>
Co-authored-by: chf3198 <5415358+chf3198@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub Copilot chat session health tracking Add VS Code extension for Copilot chat session health tracking Jan 12, 2026
Copilot AI requested a review from chf3198 January 12, 2026 08:12
@chf3198
Copy link
Owner

chf3198 commented Jan 12, 2026

@copilot We must design a VS Code extension that helps developers manage GitHub Copilot chat session health. Track the number of user messages/exchanges in active chat sessions. Display current count in status bar. Warn users at configurable threshold (default 20) that context may degrade. Provide command to export session summary for handoff to new chat. Goal: prevent context window exhaustion and lost work by prompting timely session refresh.

@chf3198
Copy link
Owner

chf3198 commented Jan 26, 2026

@copilot Another AI Agent helped me move and organize all development tools and local repositories to the USB Drive. It also helped to clean up the Chromebook's local drive in order to increase available drive space to the system. I now cannot find the copilot-handoff project folder. If you cannot find the repo on either drive or as a backup, then we will need to recreate the local repo from the github master repo.

Copy link
Author

Copilot AI commented Jan 26, 2026

@copilot Another AI Agent helped me move and organize all development tools and local repositories to the USB Drive. It also helped to clean up the Chromebook's local drive in order to increase avail...

The copilot-handoff repository is already available and working in the current environment at /home/runner/work/copilot-handoff/copilot-handoff. All 8 commits from the PR are present and the project is fully functional.

If you need to recover it on your local Chromebook, you can clone it fresh from GitHub:

git clone https://github.com/chf3198/copilot-handoff.git
cd copilot-handoff
git checkout copilot/track-chat-session-health
npm install
npm run compile

The repository contains the complete VS Code extension with all source files, documentation, and build configurations intact.

@chf3198
Copy link
Owner

chf3198 commented Jan 26, 2026

@copilot Can we switch you from a Cloud Agent to a local Agent?

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