Repository navigation
Description
Does this issue occur when all extensions are disabled?: Yes. The defect is in the Agent Host process (src/vs/platform/agentHost); see the root cause below.
- VS Code Version: 1.144.0-insider, commit
7cc5e738(2026-10-23T22:36:25Z), Electron 43.8.3 - OS Version: macOS 26.7.1 (25G241), arm64
- Agent: Copilot CLI on the local Agent Host (AHP protocol
1.0.0) - Setting:
"chat.agentHost.moveChats.enabled": true
A session created with Promote to Session from a nested chat goes back to unread constantly. Opening it clears the indicator, but every sessions-list refresh marks it unread again. In my logs that happened on all 18 refreshes between the promotion at 09:32Z and 12:22Z, 8 of them in the last 80 minutes.
Steps to Reproduce:
- Set
"chat.agentHost.moveChats.enabled": true. - In the Agents window, open a Copilot CLI session and add a second chat to it, so it shows as a nested chat in the sessions list.
- Send a prompt in that nested chat and wait for the turn to finish while it is open, so the chat is read. Promotion requires a started turn.
- In the sessions list, right-click the nested chat and choose Promote to Session.
- The new session opens and appears read.
- Wait for the next sessions-list refresh (usually a few minutes apart in my logs).
Expected: the promoted session stays read.
Actual: the promoted session shows as unread again after every refresh. Opening it, or Mark as Read (Shift+I), clears the indicator only until the next refresh.
Evidence
Excerpt from the client's AHP transport log (logs/<timestamp>/ahp/ahp-…-<clientId>.2.jsonl and .3.jsonl). I removed titles, prompts and paths. Status bits: Idle = 1, IsRead = 32, IsArchived = 64.
- Promoted chat (now the new session's default chat):
ahp-chat:/48642fc3-5dd0-447c-be84-c32e14aa2bad - New session:
ahp-session:/0a50b35b-23e4-41b4-aeba-d18baad2e983
| Time (UTC) | Dir | Message | Session status |
Chat status |
|---|---|---|---|---|
| 09:32:51.659 | c2s | moveChat ahp-chat:/48642fc3… → { kind: "newSession" } |
||
| 09:32:51.929 | s2c | root/sessionAdded ahp-session:/0a50b35b… |
1 (Idle, unread) |
33 (Idle, IsRead) |
| 09:32:51.930 | c2s | dispatchAction chat/isReadChanged { isRead: true } on ahp-chat:/48642fc3… |
||
| 09:32:52.433 | s2c | echo of chat/isReadChanged. No session/isReadChanged follows. |
||
| 09:42:50 → 12:22:50 | s2c | 18 listSessions results |
1 every time |
33 every time |
| 09:46:13, 10:24:29, 10:46:13, 12:06:43 | c2s | Session opened again → chat/isReadChanged { isRead: true }. Echoed each time; still no session/isReadChanged. |
||
| 12:13:36.364 | s2c | next listSessions after the 12:06:43 open, 7 minutes later: unread again |
1 |
33 |
The session starts out unread while its only chat is read, and it never leaves that state. The renderer applies each listSessions result (baseAgentHostSessionsProvider.ts#L2592), which flips the session back to unread. The wrong flag exists only in the host's in-memory summary from the promotion: listSessions overlays it via prepareSessionSummariesForListing, while the persisted read state is correct. That's why a host restart clears it (see Workarounds).
Root cause
- Promotion creates the session as unread.
AgentService._promoteMovedChatsAndStatepassesstatus: SessionStatus.Idlewith noIsReadbit.AgentHostStateManager.promoteChatskeeps the chat's summary, including its ownIsReadbit._mergeSessionStatusthen keeps the session's unset flag. Everywhere else, a session with a single chat has the same read state as that chat. The catalog resolver,SessionIsReadChanged, and restore all keep them in sync; promotion is the only path that doesn't. - Nothing repairs it. Since agentHost: Synchronize session read state from chats #339732, the Agents window marks a session read only through its main chat (
markRead→markChatRead→chat/isReadChanged) and relies on the host to update the session. The host only does that when the chat goes from unread to read (loaded session, unloaded session). This chat is already read, so the read is a no-op and the session stays unread.
Introduced by the combination of #339732 (session read state synced from chats) and #341788 (promote a chat to its own session). Both are in the Insiders build above.
Workarounds (verified)
I verified these against the unfixed host code with a probe that reproduces this exact state: listSessions reports session 1 and chat 33.
- Right-click the session's section header → Mark All as Read. This sends
session/isReadChanged, which marks the session read, and it stays read whether or not the host has the session loaded. Opening the session or using Mark as Read (Shift+I) doesn't help, because both send onlychat/isReadChanged. Note: this marks every unread session in that section read. - Developer: Restart Local Agent Host (or quit and reopen). After a restart the session is listed read with no other action. The wrong flag exists only in the host's in-memory summary created at promotion; the persisted read state is correct. Restarting interrupts any running turns.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
agentHost: assert the listed read state of promoted sessions
agentHost: keep a promoted session's read state in sync with its chat (…
agentHost: keep session read state consistent when chats move (#344244)