Rename Collect Agent Host Debug Logs action to Export, download remote agenthost.log#314884
Merged
roblourens merged 5 commits intomainfrom May 7, 2026
Merged
Conversation
…host.log - Rename action 'Collect Agent Host Debug Logs' to 'Export Agent Host Debug Logs...' - Rename command id agentHost.collectDebugLogs -> agentHost.exportDebugLogs - For remote agent host sessions, also download the remote agenthost.log from the server's logs directory ($HOME/<serverDataFolderName>/data/logs/<latest>/agenthost.log) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Agents window’s developer command for gathering agent host diagnostics by renaming the action/command from “Collect” to “Export…” (to reflect the save dialog), and extends the export for remote agent hosts to also attempt to include the server-side agenthost.log in the resulting zip.
Changes:
- Renames the action and command id to
agentHost.exportDebugLogsand updates the UI title to “Export Agent Host Debug Logs...”. - Registers the renamed action in the Sessions chat contribution.
- Adds remote log discovery/downloading via the
vscode-agent-host://filesystem proxy and includes it asremote-agenthost.logwhen available.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/chat/electron-browser/chat.contribution.ts | Updates action registration/import to the renamed Export action. |
| src/vs/sessions/contrib/agentHost/electron-browser/exportDebugLogsAction.ts | Renames the action/command and adds remote agenthost.log download + inclusion in the zip. |
Copilot's findings
Comments suppressed due to low confidence (2)
src/vs/sessions/contrib/agentHost/electron-browser/exportDebugLogsAction.ts:237
dir.resourceis already avscode-agent-host://URI (returned fromfileService.resolve). Wrappingdir.resource.pathagain viatoRemote(...)double-encodes the path (e.g./file/-/file/-/...) and will causereadFileto fail. Build the log URI by joining onto the existingdir.resource(or by joininglogsDirUri+dir.name) rather than re-wrapping the path string.
src/vs/sessions/contrib/agentHost/electron-browser/exportDebugLogsAction.ts:216- The code returns early when
serverDataFolderNameis undefined, so it will never attempt the documented fallbacks (.vscode-server/.vscode-server-insiders). IfproductService.serverDataFolderNamecan be missing (e.g. dev/custom products), consider still trying the fallback folder names instead of bailing out.
- Files reviewed: 2/2 changed files
- Comments generated: 0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
benvillalobos
approved these changes
May 7, 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.
Changes
agentHost.collectDebugLogs→agentHost.exportDebugLogsagenthost.logfrom the server's logs directory and include it in the zip asremote-agenthost.logRemote log discovery
The remote log is fetched via the
vscode-agent-host://filesystem proxy from<home>/<serverDataFolderName>/data/logs/<latest>/agenthost.log. We try the product'sserverDataFolderNamefirst and fall back to.vscode-server/.vscode-server-insiders. The most recent date-stamped subdirectory (by mtime) is used. Failure is non-fatal — it's logged and the rest of the export continues.