feat: add GitHub Copilot Chat (VS Code) agent support#171
feat: add GitHub Copilot Chat (VS Code) agent support#171vakovalskii merged 7 commits intovakovalskii:mainfrom
Conversation
|
Still conflicts. Please rebase on latest main (v7.1.0+). |
b5493d5 to
109da75
Compare
|
Rebased on latest main (v7.2.3). All conflicts resolved — Kilo, WSL, Linux focus, collapse/expand, analytics sub-tabs are preserved alongside Copilot Chat additions. Verified locally:
|
NovakPAai
left a comment
There was a problem hiding this comment.
Code Review
_isCopilotLineRelevant is called but not visible in the diff — scanCopilotJsonlMetadata calls _isCopilotLineRelevant(line) as a filter, but this function is not defined anywhere in the diff. If it's missing from the submitted code, calling it will throw ReferenceError at runtime and crash the entire session scan (silently swallowed by the outer try/catch, so all Copilot sessions will silently disappear). Please verify this function exists in the submitted branch.
~/.config/Code/User/workspaceStorage/ Copilot Chat (JSON/JSONL)
But the code correctly handles all three platforms (macOS: Library/Application Support/Code, Windows: AppData/Roaming/Code, Linux: .config/Code). The README should reflect this or use a cross-platform note like <vscode-user-data>/workspaceStorage/.
/tmp — COPILOT_WS_MAP_CACHE_FILE is in os.tmpdir(). On macOS, /tmp is periodically cleaned by the OS, which is fine for a cache. But the 10-minute TTL (COPILOT_WS_MAP_TTL) means a stale entry could cause new workspaces to be missed for up to 10 minutes after creation. Consider a shorter TTL or invalidating when workspaceStorage dir mtime changes.
ℹ️ Potential conflict with PR #167 — both PRs add Copilot support with tool: 'copilot' but use different storage paths (CLI sessions vs VS Code extension). Once both are merged, the tool identifier needs to be unique per source, or sessions from both will appear under the same label.
|
Привет! Отличный PR, хочу взять в мерж. Только что вмержили поддержку Qwen (#201 + #202 + #203), из-за чего твоя ветка теперь конфликтует с main в нескольких frontend-файлах ( Основная вещь, которая изменилась и скорее всего подменит твои правки — в Сможешь сделать rebase на свежий main? После этого смерджу. Если упрётся во что-то непонятное — пинганите, помогу. |
Scan VS Code workspaceStorage for Copilot Chat sessions (JSON and JSONL mutation format). Includes workspace-to-project mapping with disk cache, targeted JSONL replay for request/response extraction, and integration into loadSessions/findSessionFile/loadSessionDetail/computeSessionCost.
Add sidebar item with copilot-only filter, .tool-copilot CSS class, calendar filter toggle, analytics label, heatmap color, and AGENT_INSTALL entry for GitHub Copilot.
Update agent counts and tables in README.md, CLAUDE.md, ARCHITECTURE.md, README_RU.md, and README_ZH.md. Add Copilot storage section to ARCHITECTURE.md with session format details.
- Skip irrelevant JSONL lines (inputState, attachments) before JSON.parse - Add disk cache for parsed Copilot session metadata - Use peek-based extraction for large JSON files (>1MB) - Cold scan: 46s -> 5s, warm scan: 120ms, detail 232MB: 1.1s
_computeSessionDailyBreakdown now uses parseCopilotJsonl/parseCopilotJson for Copilot sessions instead of generic line-by-line JSONL scan that would read entire multi-hundred-MB files without extracting any data. Fixes leaderboard hanging on projects with large Copilot sessions.
…opilot CLI PR vakovalskii#167 adds Copilot CLI support with tool: 'copilot'. Our implementation covers Copilot Chat (VS Code extension) — a different agent with different storage format. Rename to 'copilot-chat' so both can coexist.
109da75 to
32b9c24
Compare
|
Rebased on latest main (v7.4.0). Qwen merge conflicts resolved. Key change: added Verified locally (v7.4.0):
|
- README.md: replace Linux-only Copilot Chat path with cross-platform notation - src/data.js: invalidate workspace map cache when VSCODE_WORKSPACE_STORAGE mtime changes, not just on 10-min TTL expiry — catches new workspaces created within TTL window - docs/ARCHITECTURE.md: update stale tool name "copilot" → "copilot-chat"
|
Thanks for the review @NovakPAai! Addressed in 1. 2. README cross-platform paths — fixed. Replaced the Linux-only path with a 3. Workspace map cache invalidation — fixed. Added mtime-based check: cache is now invalidated when 4. Conflict with PR #167 — already handled. This branch uses Bonus: also fixed a stale |
NovakPAai
left a comment
There was a problem hiding this comment.
Code Review
Good implementation overall — addressed all previous review points. One item to verify before merge.
_isCopilotLineRelevant is present in the submitted branch
scanCopilotJsonlMetadata calls _isCopilotLineRelevant(line) as a filter. The previous review flagged this as missing from the diff. Author stated it's at src/data.js:1405 — please confirm the function exists in the current HEAD of this branch (e.g. grep -n '_isCopilotLineRelevant' src/data.js). If absent, the entire Copilot session scan silently returns empty (swallowed by outer try/catch).
✅ Previous review points addressed:
- README now uses
<vscode-user-data>/workspaceStorage/with per-platform notes (macOS/Linux/Windows) — correct - Workspace map cache now invalidated on
VSCODE_WORKSPACE_STORAGEmtime change, not just TTL — correct tool: 'copilot-chat'is distinct from PR #167'stool: 'copilot'— no collision
ℹ️ Merge order note
PR #198 also modifies src/data.js (loadSessionDetail) and styles.css. Merging this PR first avoids a conflict for #198's author — they will need to rebase over the Copilot additions regardless, but a clean base makes that easier.
✅ What's good:
- Dual cache invalidation (TTL + mtime) for workspace mapping
- JSONL line prefix check before
JSON.parseavoids parsing irrelevant mutations — smart optimization 'copilot-chat'entry added to centralizedTOOL_METAinapp.jsper #202 architecture- Cross-platform paths handled correctly for macOS/Linux/Windows
|
Thanks for the review @NovakPAai! Confirmed — the function is present on current branch HEAD ( Also verified end-to-end: |
NovakPAai
left a comment
There was a problem hiding this comment.
Thanks for the quick response and the grep output — that settles it. Merge approved, passing to the maintainer.
Summary
Добавляет GitHub Copilot Chat (расширение VS Code) как поддерживаемый агент в CodeDash — загрузка сессий, детальный просмотр, поиск, leaderboard, полная интеграция в UI.
Использует tool name
copilot-chat, чтобы не конфликтовать с PR #167 (Copilot CLI, tool:copilot).Closes #166
What changed
workspaceStorage/*/chatSessions/*.jsonи*.jsonlс маппингом workspace → проект черезworkspace.json(декодирование file URI, нормализация путей Windows)request.message.text, текст ассистента конкатенируется изresponse[]items где kind отсутствует,textилиmarkdownContentpath|mtime|size— холодный скан ~5с для 300+ сессий, тёплый скан ~120мсJSON.parse, сокращение загрузки detail для 200+ МБ файлов с зависания до ~1с_computeSessionDailyBreakdown()черезparseCopilotJsonl/parseCopilotJsonвместо построчного сканирования — фикс зависания leaderboard на больших сессияхcomputeSessionCost()возвращает пустую стоимость (нет локальных данных о токенах, как Cursor/Kiro).tool-copilot-chat/#8b6fc0), фильтр в календаре, метка в аналитике, цвет в heatmap, запись вAGENT_INSTALL%APPDATA%/Code(Windows),~/Library/Application Support/Code(macOS),~/.config/Code(Linux)Validation
Проверено локально на реальных данных VS Code (319 сессий, 50+ проектов):
node -c src/data.js— синтаксис ОКnode bin/cli.js version— CLI стартуетloadSessions()— 319 Copilot Chat сессий с корректными путями проектов из.jsonи.jsonlформатовloadSessionDetail()— сообщения с корректными ролями user/assistantcomputeSessionCost()— возвращает пустую стоимостьgetLeaderboardStats()— Copilot Chat в разбивке по агентам, leaderboard загружается без зависанийKnown limitations
Code - Insidersпока не сканируется (только стандартная директорияCode)