Support Agent Host session attachments with Copilot CLI events.jsonl#323773
Merged
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
This was referenced Jul 2, 2026
…entSessionJune30 # Conflicts: # src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts
dmitrivMS
approved these changes
Jul 2, 2026
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
events.jsonl.sessionReferencevariables into a smallSimpleattachment with replay metadata.Resourceattachment pointing atevents.jsonl, instead of packing transcript text intoSimple.modelRepresentation.Sessions...picker to only show attachable Copilot CLI sessions when the current chat is Agent Host-backed.#session:completion behavior; this PR does not change non-Agent-Host session attachment behavior.Supported session matrix:
events.jsonlpath?copilotcli:/<id>agent-host-copilotcli:/<id>remote-<authority>-copilotcli:/<id>events.jsonlcontractevents.jsonlcontractInspirations from:
events.jsonlresolution comes frombuildHostLocalEventsPath.Simple.modelRepresentationto atext/plainSDK blob andResourceattachments to SDK file/directory attachments in_toSdkAttachment.messageAttachmentToVariableEntry.