sessions: add command to collect agent host debug logs as zip#314626
Merged
roblourens merged 6 commits intoMay 6, 2026
Conversation
…session
Adds a new command `agentHost.openSessionEventsFile` ('Copilot CLI: Open
Session Events File') accessible from the Command Palette. It opens the
`events.jsonl` file for the currently active Copilot CLI chat session.
Supported session types:
- Local AH (scheme `agent-host-copilotcli`): opens
`~/.copilot/session-state/<id>/events.jsonl` via IPathService.userHome.
- Remote AH (scheme `remote-<auth>-copilotcli`): looks up the connection
via IRemoteAgentHostService, uses the host's `defaultDirectory` (reported
during AHP handshake) to build a `vscode-agent-host://` URI, served by
the existing remote AH filesystem provider. No new RPC needed.
- EH CLI extension (scheme `copilotcli`): same local path as local AH.
The command is gated on `ChatContextKeys.enabled && IsAgentHostSession` so
it only appears when an AH session is active. The logic is in
`openSessionEventsFileActions.ts` (pure `resolveEventsUri` helper +
exported `Action2`) registered from `remoteAgentHost.contribution.ts`,
which is loaded on both desktop and web. Unit tests cover all cases.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… Developer category (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace IChatWidgetService.lastFocusedWidget lookup with ISessionsManagementService.activeSession, matching the source of the IsAgentHostSession precondition so they cannot diverge. - Reword buildRemoteEventsUri JSDoc: URI-path concatenation works on both POSIX and Windows hosts, not just POSIX. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ng-log-collection-command-239c786f
Adds a new 'Developer: Collect Agent Host Debug Logs' command that gathers all logs relevant to debugging agent host issues and packages them as a zip file. Collected files: - events.jsonl for the active Copilot CLI session - IPC traffic output channel for the current session's agent host connection - Agent host process log (local sessions only) - Window log (rendererLog) - Shared process log The save dialog defaults to `ah-logs-<session-title>.zip`. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Screenshot ChangesBase: Changed (21) |
auto-merge was automatically disabled
May 6, 2026 02:46
Pull request was converted to draft
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new Developer command in the Agents window (“Collect Agent Host Debug Logs”) to gather session-specific Agent Host troubleshooting artifacts (Copilot CLI events.jsonl plus relevant Output/log channels) and save them as a zip for easy sharing/debugging.
Changes:
- Introduces
CollectAgentHostDebugLogsActionthat aggregates Copilot CLI session events and multiple log/output channels into an in-memory file list. - Adds a save flow that suggests
ah-logs-<session-title>.zipand uses the native zip creation API. - Registers the new action alongside the existing “Open Copilot CLI State File” action.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHost.contribution.ts | Registers the new “Collect Agent Host Debug Logs” developer action. |
| src/vs/sessions/contrib/agentHost/browser/openSessionEventsFileActions.ts | Implements the new action to collect events/output logs and write them into a zip via INativeHostService. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
…layer violation INativeHostService cannot be used from browser/ layer files. Extracted the action to a new electron-browser/ file and register it from the existing electron-browser chat contribution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
osortega
approved these changes
May 6, 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.
Adds a new
Developer: Collect Agent Host Debug Logscommand that gathers all logs relevant to debugging agent host issues and packages them as a zip file.Collected files:
events.jsonlfor the active Copilot CLI sessionchat.agentHost.ipcLoggingEnabledis on)rendererLog)The save dialog defaults to
ah-logs-<session-title>.zip.(Written by Copilot)