Skip to content

Rename Collect Agent Host Debug Logs action to Export, download remote agenthost.log#314884

Merged
roblourens merged 5 commits intomainfrom
agents/c83da338-ab09-47b1-ba0f-a6b69e2d6269
May 7, 2026
Merged

Rename Collect Agent Host Debug Logs action to Export, download remote agenthost.log#314884
roblourens merged 5 commits intomainfrom
agents/c83da338-ab09-47b1-ba0f-a6b69e2d6269

Conversation

@roblourens
Copy link
Copy Markdown
Member

Changes

  • Rename the Collect Agent Host Debug Logs action to Export Agent Host Debug Logs... (added trailing ellipsis since it opens a save dialog)
  • Rename command id agentHost.collectDebugLogsagentHost.exportDebugLogs
  • For remote agent host sessions, also download the remote agenthost.log from the server's logs directory and include it in the zip as remote-agenthost.log

Remote 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's serverDataFolderName first 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.

…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>
Copilot AI review requested due to automatic review settings May 6, 2026 23:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.exportDebugLogs and 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 as remote-agenthost.log when 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.resource is already a vscode-agent-host:// URI (returned from fileService.resolve). Wrapping dir.resource.path again via toRemote(...) double-encodes the path (e.g. /file/-/file/-/...) and will cause readFile to fail. Build the log URI by joining onto the existing dir.resource (or by joining logsDirUri + dir.name) rather than re-wrapping the path string.
    src/vs/sessions/contrib/agentHost/electron-browser/exportDebugLogsAction.ts:216
  • The code returns early when serverDataFolderName is undefined, so it will never attempt the documented fallbacks (.vscode-server / .vscode-server-insiders). If productService.serverDataFolderName can 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

roblourens and others added 4 commits May 7, 2026 10:58
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>
@roblourens roblourens marked this pull request as ready for review May 7, 2026 22:41
@roblourens roblourens enabled auto-merge (squash) May 7, 2026 22:41
@roblourens roblourens merged commit e689a23 into main May 7, 2026
40 of 41 checks passed
@roblourens roblourens deleted the agents/c83da338-ab09-47b1-ba0f-a6b69e2d6269 branch May 7, 2026 23:09
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants