sessions: Preserve explicit unread marks on the active session #336744

Merged
benibenj opened 3:51am on September 18, 2026 wanted to merge 200 Ξ” into microsoft/vscode main from
benibenj/agents/fix-active-session-read-unread-issue

Steps to reproduce: * Open the Agents window and focus a session. * While that session remains focused, use Mark as Unread on it. * Observe the session's unread state.

Expected: The focused session is marked as unread and displays its unread indicator.

Actual: Nothing changes; the session remains read. This appears to reproduce only when the session being marked as unread is currently focused.

Additional context: See the attached screen recording.

https://github.com/user-attachments/assets/2ef1bf40-1ff1-44f3-9d39-a702009599ac

Version: 1.139.0-insider
Commit: 046944034292b5479b4e9a50ad1a508033ffb64f
Date: 2026-09-17T03:41:14Z
Electron: 43.6.0
ElectronBuildId: 15274685
Chromium: 150.0.7871.250
Node.js: 24.20.0
V8: 15.0.245.31-electron.0
@github/copilot: 1.0.84-5
@github/copilot-sdk: 1.0.13
OS: Darwin arm64 25.6.0
Diff Delta:
200
About 71 Diff Delta/hour
Classified as:  General

benibenj's Description of Work #336721 Mark as Unread does not mark the currently focused session as unread

Closes #336721.

Summary

The active-session watcher immediately marked explicit unread updates as read again. Preserve that user intent until the user switches away and returns, or explicitly marks the session read.


  • Keep normal automatic reading of active-session updates and existing inactive-session behavior.

  • Preserve the unread mark when reopening the already-active session from the main or flat sessions list.

  • Add regression coverage for navigation, provider updates, and Mark as Read / Mark All as Read.

Validation


  • Client compilation completed with zero errors (npm run gulp compile-client).

  • Hygiene passed for all six changed files.

  • Both affected test suites passed: 293 passing, 2 pending.

6 total changed files
Loading changes...
Loading changes...
Loading changes...
Loading changes...
You’ve completed the full review pass
Approve, request changes, or stare into the void (reviewer's choice) πŸ˜