Skip to content

sessions: add command to collect agent host debug logs as zip#314626

Merged
roblourens merged 6 commits into
mainfrom
roblou/agents/debugging-log-collection-command-239c786f
May 6, 2026
Merged

sessions: add command to collect agent host debug logs as zip#314626
roblourens merged 6 commits into
mainfrom
roblou/agents/debugging-log-collection-command-239c786f

Conversation

@roblourens
Copy link
Copy Markdown
Member

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 (when chat.agentHost.ipcLoggingEnabled is on)
  • 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)

roblourens and others added 5 commits May 5, 2026 17:11
…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>
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>
Copilot AI review requested due to automatic review settings May 6, 2026 02:42
@roblourens roblourens enabled auto-merge (squash) May 6, 2026 02:42
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Screenshot Changes

Base: 88fa3d91 Current: 96794e44

Changed (21)

chat/input/chatInput/Default/Light
Before After
before after
chat/input/chatInput/WithArtifacts/Dark
Before After
before after
chat/input/chatInput/WithFileChanges/Dark
Before After
before after
chat/input/chatInput/WithFileChanges/Light
Before After
before after
chat/input/chatInput/WithTodos/Dark
Before After
before after
chat/input/chatInput/WithTodos/Light
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Dark
Before After
before after
chat/input/chatInput/Full/Dark
Before After
before after
chat/input/chatInput/Full/Light
Before After
before after
chat/widget/chatWidget/SimpleQA/Light
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Dark
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Light
Before After
before after
chat/widget/chatWidget/MultiTurn/Light
Before After
before after
agentSessionsViewer/CompletedRead/Dark
Before After
before after
agentSessionsViewer/CompletedRead/Light
Before After
before after
agentSessionsViewer/WithFileChangesList/Dark
Before After
before after
agentSessionsViewer/WithFileChangesList/Light
Before After
before after
agentSessionsViewer/BackgroundProvider/Dark
Before After
before after
agentSessionsViewer/BackgroundProvider/Light
Before After
before after
agentSessionsViewer/ClaudeProvider/Dark
Before After
before after
agentSessionsViewer/ClaudeProvider/Light
Before After
before after

@roblourens roblourens marked this pull request as draft May 6, 2026 02:46
auto-merge was automatically disabled May 6, 2026 02:46

Pull request was converted to draft

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 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 CollectAgentHostDebugLogsAction that 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>.zip and 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

Comment thread src/vs/sessions/contrib/agentHost/browser/openSessionEventsFileActions.ts Outdated
…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>
@roblourens roblourens marked this pull request as ready for review May 6, 2026 04:03
@roblourens roblourens enabled auto-merge (squash) May 6, 2026 04:03
@roblourens roblourens merged commit fa89094 into main May 6, 2026
26 checks passed
@roblourens roblourens deleted the roblou/agents/debugging-log-collection-command-239c786f branch May 6, 2026 04:36
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 6, 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