Skip to content

sessions: Fix external session publication state - #331115

Merged
Benjamin Christopher Simmonds (benibenj) merged 1 commit into
mainfrom
benibenj/agents/external-session-banner-feedback
Aug 16, 2026
Merged

Benjamin Christopher Simmonds (benibenj) merged 1 commit into
mainfrom
benibenj/agents/external-session-banner-feedback

Conversation

@benibenj

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #331083 addressing post-merge review feedback:

  • forward external-session provenance through the visible-session and resource-override wrappers used by the Agents Window chat view
  • distinguish Agent Host summaries retained as diff baselines from summaries actually published to clients
  • publish a restored external session when the visibility setting changes from hidden to visible
  • add regression coverage for both wrapped-session and None → restore → All paths

Testing

  • npm run typecheck-client
  • targeted VisibleSessions and AgentService regression tests
  • full AgentHostStateManager unit suite
  • ESLint and changed-file hygiene

Forward external provenance through visible session wrappers and distinguish summaries recorded for diffing from summaries actually published to clients. This restores the banner in the Agents Window and allows hidden restored sessions to appear when the setting changes.

Co-authored-by: Copilot <[email protected]>
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Sandeep Somavarapu (@sandy081)

Matched files:

  • src/vs/sessions/services/sessions/browser/visibleSessions.ts
  • src/vs/sessions/services/sessions/test/browser/visibleSessions.test.ts

Ladislau Szomoru (@lszomoru)

Matched files:

  • src/vs/sessions/services/sessions/browser/visibleSessions.ts
  • src/vs/sessions/services/sessions/test/browser/visibleSessions.test.ts

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 external session publication tracking across Agents Window wrappers and Agent Host state.

Changes:

  • Forwards external-session metadata through session wrappers.
  • Separates published summaries from retained diff baselines.
  • Adds restoration and visibility regression coverage.
Show a summary per file
File Description
visibleSessions.test.ts Tests metadata forwarding.
visibleSessions.ts Forwards external provenance.
AGENT_HOST_SESSIONS_PROVIDER.md Documents publication tracking.
agentService.test.ts Tests hidden-to-visible restoration.
agentHostStateManager.ts Tracks published summaries separately.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Suppressed comments (1)

src/vs/platform/agentHost/node/agentHostStateManager.ts:1146

  • A restored session that was returned by listSessions() is visible to clients, but restoreSession() deliberately emits no sessionAdded and never inserts it into this set. Consequently this check suppresses sessionRemoved when that restored session is deleted (and the same missing membership makes an external visibility transition fail to unpublish it), leaving clients with a stale catalog entry. The restore path needs to record whether the session was visible under the current external-session mode, while preserving false for sessions restored while hidden.
		const wasPublished = this._publishedSessionSummaries.has(session.toString());
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

@benibenj
Benjamin Christopher Simmonds (benibenj) merged commit 6519072 into main Aug 16, 2026
28 checks passed
@benibenj
Benjamin Christopher Simmonds (benibenj) deleted the benibenj/agents/external-session-banner-feedback branch August 16, 2026 20:15
@vs-code-engineering vs-code-engineering Bot added this to the 1.134.0 milestone Aug 16, 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 Sep 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants