Repository navigation
sessions: Fix external session publication state - #331115
Merged
Benjamin Christopher Simmonds (benibenj) merged 1 commit intoAug 16, 2026
Merged
Benjamin Christopher Simmonds (benibenj) merged 1 commit into
Benjamin Christopher Simmonds (benibenj) merged 1 commit into
Conversation
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]>
Benjamin Christopher Simmonds (benibenj)
enabled auto-merge (squash)
August 16, 2026 19:56
Copilot started reviewing on behalf of
Benjamin Christopher Simmonds (benibenj)
August 16, 2026 19:56
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Sandeep Somavarapu (@sandy081)Matched files:
Ladislau Szomoru (@lszomoru)Matched files:
|
Dmitriy Vasyura (dmitrivMS)
approved these changes
Aug 16, 2026
Contributor
There was a problem hiding this comment.
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, butrestoreSession()deliberately emits nosessionAddedand never inserts it into this set. Consequently this check suppressessessionRemovedwhen 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 preservingfalsefor sessions restored while hidden.
const wasPublished = this._publishedSessionSummaries.has(session.toString());
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Balanced
Benjamin Christopher Simmonds (benibenj)
merged commit Aug 16, 2026
6519072
into
main
28 checks passed
Benjamin Christopher Simmonds (benibenj)
deleted the
benibenj/agents/external-session-banner-feedback
branch
August 16, 2026 20:15
This was referenced 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').
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #331083 addressing post-merge review feedback:
None → restore → AllpathsTesting
npm run typecheck-client