Skip to content

copilot-cli sessions trigger save right on startup #304443

@jrieken

Description

@jrieken
  • configure "chat.restoreLastPanelSession": true,
  • have a copilot-cli session with changes to files in your workspace
  • have a local session without any changes (e.g plan mode, simple question)
  • reload window
  • 🐛 you get a bunch of save-participant notifications which is because the copilot-cli integration "restores/finds" the worktree and triggers save on each file
Screen.Recording.2026-03-24.at.13.08.50.mov
AI Investigation


Root Cause (from log analysis)

A stale copilotcli chat session is restored at window startup. The restore/close cycle
triggers a file save in a Copilot git worktree, which runs save participants (e.g., ESLint).

Timeline from logs (20260324T111939/window1)

11:19:43.140  ext host starts
              GitHub.copilot-chat activated via "onChatSession:copilotcli"
11:19:47.213  [MainThreadChatSessions] untitled-style sessionResource detected
              copilotcli:/untitled-973a2487-f022-4304-bbf6-95a7420ed5fb
11:19:47.338  [CopilotCLI] Workspace initialized: 9329111c... (checkpoints: 0)
11:19:47.936  [CopilotCLI] Closing session 9329111c...
11:19:48.435  copilotcli session resource detected AGAIN
~11:19:48.4   ← FILE SAVE TRIGGERED (back-calculated: 54.079s − 5.625s)
11:19:51.118  ESLint library loaded from worktree node_modules/
11:19:54.079  ESLint "Computing fixes during save" warning (5625ms)

Key observations

  1. Only copilotcli sessions affected — windows 2–5 activated via onChatSession:claude-code and showed no save activity.
  2. Saved file was in a Copilot git worktree: vscode.worktrees/copilot-steep-weasel/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.ts
  3. No editor was open — ESLint loaded from worktree first (11:19:51), main repo ESLint not until 11:36:02.
  4. Session initialized and closed in ~600ms with checkpoints: 0 — stale session restored and immediately torn down.
  5. ESLint ran as save participant taking 5625ms — causing visible progress/notification.

Expected Behavior

Restoring/closing a stale copilotcli session at startup should not trigger file saves or save participants.

VS Code Version

VS Code Insiders 1.113.0, Copilot Chat 0.41.2026032301

Metadata

Metadata

Labels

importantIssue identified as high-priority

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions