Support session reference attachment for agent host copilot#323773
Draft
anthonykim1 wants to merge 5 commits into
Draft
Support session reference attachment for agent host copilot#323773anthonykim1 wants to merge 5 commits into
anthonykim1 wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enables attaching session references for the agent-host Copilot flow by round-tripping session-reference variables through agent-host “simple” attachments, and enriching those attachments with referenced session transcript content when available.
Changes:
- Add a session-reference attachment format (displayKind + metadata) and restoration helper.
- Update agent-host variable→attachment conversion to hydrate referenced session transcripts via
IChatSessionsService, with a debug-events fallback viaIChatDebugService. - Expand session picker filtering to include agent-host Copilot sessions and add targeted tests for restore/convert paths.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts | Adds tests for restoring session-reference attachments and for converting sessionReference variables into agent-host simple attachments (including transcript hydration scenarios). |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/stateToProgressAdapter.ts | Restores session-reference variable entries from simple attachments during state→variable reconstruction. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionReferenceAttachment.ts | New helper module defining the session-reference attachment shape, metadata, transcript rendering helpers, and restoration logic. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts | Hydrates and serializes session-reference variables into attachments, including transcript embedding from session history or debug events. |
| src/vs/workbench/contrib/chat/browser/actions/chatContext.ts | Includes AgentHostCopilot in the session provider filter for the session reference picker. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 3
- Review effort level: Low
anthonykim1
commented
Jun 30, 2026
| @IWorkspaceTrustRequestService private readonly _workspaceTrustRequestService: IWorkspaceTrustRequestService, | ||
| @IChatResponseFileChangesService private readonly _chatResponseFileChangesService: IChatResponseFileChangesService, | ||
| @IChatSessionsService private readonly _chatSessionsService: IChatSessionsService, | ||
| @IChatDebugService private readonly _chatDebugService: IChatDebugService, |
Contributor
Author
There was a problem hiding this comment.
@roblourens @connor4312 Copilot is having me add ChatDebugService to cover the scenario:
- Type some message and send + get response from session A
- Try to attach session from session A in session B.
- In ideal scenario, it would know the content, but without this fallback to ChatDebugService way, this "relatively fresh session" scenario leads to:
I don't really feel great adding both ChatSessionService and ChatDebugService, but it seems like ChatSessionService alone in the above scenario is not sufficient.
Could I get some wisdom
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of: #315193 (comment)
#session:completions.sessionReferencevariables into Agent HostSimpleattachments instead of dropping them.kind: 'sessionReference'.modelRepresentationwhen available, with debug-event fallback for sessions whose transcript is exposed that way.Inspirations from:
sessionReferencevariable shape comes from the Sessions picker attachment entry inchatContext.ts.chatSessionResourceToId.sessionReferenceAttachmentAttrs.MAX_TITLE_CONTEXT_CHARS.#session:completion provider filtering is kept aligned with the session picker behavior inchatInputCompletions.ts.