Skip to content

Agent Host: Export debug logs for the active chat - #332067

Draft
roblourens wants to merge 5 commits into
microsoft:mainfrom
roblourens:roblou/agents/export-active-chat-logs
Draft

Agent Host: Export debug logs for the active chat#332067
roblourens wants to merge 5 commits into
microsoft:mainfrom
roblourens:roblou/agents/export-active-chat-logs

Conversation

@roblourens

@roblourens roblourens commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

  • route Agent Host debug-log collection to the active default, peer, side, or subagent chat
  • include events.jsonl and shell logs from that selected SDK chat instead of always collecting the default chat
  • preserve session-scoped sidecars, host-wide fallback behavior, and compatibility with older Agent Hosts

Stack

Builds on #332062, which has merged. The active-chat implementation is contained in commits 62bd134d683 and 6aa2662243c; d97fa5aebee merges the updated main.

Validation

  • focused active-chat export regressions (11 passing)
  • npm run typecheck-client
  • targeted ESLint for all net changed TypeScript files
  • pre-commit hygiene checks

(Written by Copilot)

Skip unavailable supplementary log sources and remove the debug-log byte limit while retaining manifest and entry-count validation.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Route debug-log collection to the selected default, peer, side, or subagent chat while preserving session ownership and host-wide fallback behavior.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 21, 2026 23:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Routes Agent Host debug-log exports to the active chat while incorporating the stacked best-effort ZIP changes.

Changes:

  • Propagates active chat identity through the debug-log protocol and services.
  • Selects the correct Copilot SDK chat, including subagents.
  • Removes size limits and skips unavailable supplementary files during ZIP creation.
Show a summary per file
File Description
src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.ts Forwards chat identity remotely.
src/vs/workbench/contrib/chat/test/browser/exportAgentHostDebugLogs.test.ts Tests chat URI conversion.
src/vs/workbench/contrib/chat/electron-browser/actions/exportAgentHostDebugLogsService.ts Enables best-effort, unbounded export.
src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.ts Selects the active chat for export.
src/vs/sessions/contrib/providers/agentHost/browser/exportDebugLogsAction.ts Reads the active Sessions chat.
src/vs/platform/native/electron-main/nativeHostMainService.ts Handles optional size limits and unavailable files.
src/vs/platform/native/common/native.ts Extends native ZIP contracts.
src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts Tests protocol chat validation.
src/vs/platform/agentHost/test/node/copilotAgent.test.ts Tests peer-chat log routing.
src/vs/platform/agentHost/test/node/agentHostDebugLogs.test.ts Tests chat forwarding and large artifacts.
src/vs/platform/agentHost/test/electron-browser/agentHostProtocolClient.test.ts Tests client requests and large manifests.
src/vs/platform/agentHost/node/protocolServerHandler.ts Validates and forwards chat URIs.
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Targets the selected SDK chat.
src/vs/platform/agentHost/node/agentService.ts Resolves provider chat routing.
src/vs/platform/agentHost/node/agentHostManagementService.ts Forwards chat identity.
src/vs/platform/agentHost/node/agentHostDebugLogs.ts Passes chat context to providers.
src/vs/platform/agentHost/electron-browser/localAgentHostService.ts Forwards local chat identity.
src/vs/platform/agentHost/common/state/sessionState.ts Adds chat-ID URI construction.
src/vs/platform/agentHost/common/agentService.ts Extends debug-log service APIs.
src/vs/platform/agentHost/common/agentHostExtensionProtocol.ts Adds the optional protocol chat field.
src/vs/platform/agentHost/common/agent.ts Extends provider diagnostics API.
src/vs/platform/agentHost/browser/nullAgentHostService.ts Updates the null implementation.
src/vs/platform/agentHost/browser/agentHostProtocolClient.ts Sends chat identity and accepts large artifacts.
src/vs/base/test/node/zip/zip.test.ts Tests best-effort ZIP behavior.
src/vs/base/node/zip.ts Supports optional size validation and skipped sources.

Review details

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 25/25 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.ts Outdated
Comment thread src/vs/platform/agentHost/node/agentService.ts
Use host-published chat resources and cover subagent-to-parent debug-log routing.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve the stacked branch after the prerequisite debug-log export PR merged.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Define the debug-log extension request with the shared validation library and leave semantic URI checks in the protocol handler.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Well done. The optimization reduces unnecessary allocations.

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