Agent Window: constant errors from old sessions

Open
#320,373 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
git, typescript, vscode
Domain
devtools

Research direction

Start at ChatSessionWorktreeService._getWorktreeChanges and GitServiceImpl.exec, using the logged worktree path and git diff command as entry points. Reproduce the repeated errors after sessions are marked done or their branches are deleted; done means stale sessions no longer spam the log with worktree or revision errors.

Written by the indexing model from the issue text.

Description

  • Copilot Chat Extension Version:
  • VS Code Version: 1.123.0 (Universal)
  • OS Version: Darwin arm64 25.5.0
  • Feature (e.g. agent/edit/ask mode): N/A
  • Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): N/A
  • Logs:
2026-06-08 09:28:05.199 [warning] [ChatSessionWorktreeService][_getWorktreeChanges] Unable to open worktree repository for session 9d923807-9e37-48d0-9b1a-669ad5697f2a at path /XXX/YYYY.worktrees/agents-....
2026-06-08 09:28:05.248 [error] [GitServiceImpl][exec] git diff --cached --raw --numstat --diff-filter=ADMR -z --merge-base main -- [8ms] Error: Command failed: /opt/homebrew/bin/git diff --cached --raw --numstat --diff-filter=ADMR -z --merge-base main --
fatal: bad revision 'main'

Steps to Reproduce:

  1. Seems to be triggered after marking sessions as done.

The listed sessions don't exist in the sessions menu any more, so I can't see a way of fixing the issue, I have three with the work tree error and one with the revision error, that branch was deleted long time ago, all are constantly spamming the log every few seconds.

Dominant language
TypeScript
Stars
193k
Forks
42.9k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.