Repository navigation
agents window: fix sessions list progress - #331394
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes stale session-list progress by deriving session status and activity from the authoritative chat catalog.
Changes:
- Extracts shared chat-summary aggregation logic.
- Reconciles Agent Host session observables from subscribed session state.
- Adds regression coverage for stale session summaries.
Show a summary per file
| File | Description |
|---|---|
sessionState.ts |
Adds shared chat-summary aggregation. |
agentHostStateManager.ts |
Reuses the shared aggregation helper. |
baseAgentHostSessionsProvider.ts |
Synchronizes displayed session progress with chat state. |
localAgentHostSessionsProvider.test.ts |
Tests running and completed reconciliation. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
|
Do you know what the root cause of this is? The agent host should be publishing the right thing, we shouldn't have to recompute it in the UI |
|
hmmm, i thought it was a UX sync thing, but looking deeper, i think something changed recently where consumers of logs for my run show that the session publishes edit 5:53pm: draft below, gonna revisit this eod |
Co-authored-by: Copilot <[email protected]>
|
Copilot Resolve merge conflicts |
Co-authored-by: dmitrivMS <[email protected]>
c6d507f
Resolved. I merged |
|
Copilot Resolve conflicts |
Co-authored-by: dmitrivMS <[email protected]>
Conflicts are resolved. I merged |
…sions push live status Backport of upstream's sessions-list progress fix (upstream main e6ac244, squashing PR microsoft#331394), which landed two days after our merge point. The external-session visibility gate (microsoft#331115/microsoft#331117) drops root/sessionSummaryChanged notifications for sessions not in _publishedSessionSummaries, but restoreSession never populated that set — so any session restored after a window reload or agent-host restart stopped pushing live status to the sidebar, which then showed only the relative timestamp while the agent was actively working. Port prepareSessionSummariesForListing + _mergeLiveSummaryForListing (every listed session is announced/published and the response merges live status), wire it into the protocolServerHandler listSessions handler, and carry the companion _addedSessionSummaries set so listing-published provisional sessions still get their deferred sessionAdded upsert from markSessionPersisted. TEMPORARY: remove this patch wholesale when an upstream merge brings in e6ac244 (see docs/picode-patches.md, 'Temporary backports').
Summary
Fixes Sessions list progress indicators becoming stale in either direction:
Root cause
The Agent Host correctly aggregated chat activity into the session status, but did not publish the resulting session-summary updates for sessions initially returned by
root/listSessions.A recent publication filter only emitted
root/sessionSummaryChangedfor sessions recorded as published. That record was updated forroot/sessionAdded, but not forroot/listSessions. As a result, restored/listed sessions were visible to the client while the host still treated their summaries as unpublished.The subscribed chat continued receiving live
session/chatUpdatedactions, so the chat content showed the correct state. The Sessions list depended on the suppressed root summary update and retained its previous state, producing the mismatch.Fix
root/listSessionsas published without emitting redundantroot/sessionAddednotifications.listSessionsand its subsequent transition to in progress.