Skip to content

agents window: fix sessions list progress - #331394

Merged
Dmitriy Vasyura (dmitrivMS) merged 7 commits into
mainfrom
justin/fuecoco
Aug 19, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 7 commits into
mainfrom
justin/fuecoco

Conversation

@justschen

@justschen Justin Chen (justschen) commented Aug 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes Sessions list progress indicators becoming stale in either direction:

  • a session is running, but the list does not show a spinner;
  • a session has completed, but the list continues showing a spinner.

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/sessionSummaryChanged for sessions recorded as published. That record was updated for root/sessionAdded, but not for root/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/chatUpdated actions, 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

  • Record summaries returned by root/listSessions as published without emitting redundant root/sessionAdded notifications.
  • Preserve the listed summary as the notification-diff baseline so subsequent status and activity changes are emitted normally.
  • Keep filtered sessions unpublished, preserving the existing external-session visibility behavior.
  • Remove the client-side status recomputation workaround; the UI now consumes the status published by the Agent Host.
  • Add a protocol-level regression test covering a restored session returned by listSessions and its subsequent transition to in progress.

Copilot AI balanced review requested due to automatic review settings August 18, 2026 00:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@justschen
Justin Chen (justschen) marked this pull request as ready for review August 18, 2026 00:31
@justschen
Justin Chen (justschen) enabled auto-merge (squash) August 18, 2026 00:31
@connor4312

Copy link
Copy Markdown
Member

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

@justschen

Justin Chen (justschen) commented Aug 18, 2026 •

Copy link
Copy Markdown
Collaborator Author

hmmm, i thought it was a UX sync thing, but looking deeper, i think something changed recently where consumers of session/chatUpdated were getting old session status instead of the latest (so running sessions looked stopped, but finished sessions kept running and never got updated).

logs for my run show that the session publishes InProgress and never changed or emitted sessionSummaryChanged. maybe something with listing sessions changed over the weekend?

edit 5:53pm: draft below, gonna revisit this eod

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

roblourens
roblourens previously approved these changes Aug 19, 2026
@dmitrivMS

Copy link
Copy Markdown
Collaborator

Copilot Resolve merge conflicts

Copilot AI commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Copilot Resolve merge conflicts

Resolved. I merged origin/main, fixed the conflict in src/vs/platform/agentHost/test/node/agentService.test.ts, and pushed commit c6d507fa67b.

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Copilot Resolve conflicts

Copilot AI commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Copilot Resolve conflicts

Conflicts are resolved. I merged origin/main, fixed the conflict in src/vs/platform/agentHost/test/node/agentService.test.ts, and pushed commit eb8abfac0b5.

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit a5ff91e into main Aug 19, 2026
27 checks passed
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) deleted the justin/fuecoco branch August 19, 2026 20:06
@vs-code-engineering vs-code-engineering Bot added this to the 1.135.0 milestone Aug 19, 2026
Misha Damjanic (mdamjanic7) added a commit to mdamjanic7/pihub that referenced this pull request Aug 24, 2026
…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').
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Oct 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Start Over in chat in editor window does not show progress in sessions list

9 participants