[Perf] agentHost: Improve debug log export responsiveness - #334524
Merged
Merged
Conversation
Limit Copilot debug exports to one previous process log and collect logs while the user selects the export destination. Split destination selection from saving so desktop and browser exports share the concurrent flow.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
All reviewed changes have coverage, with no unresolved issues.
Review tier: Balanced
Findings: None
What changed in this PR
Improves Agent Host debug-log export responsiveness while reducing exported Copilot log volume.
Changes:
- Limits exports to one previous Copilot process log.
- Runs destination selection and log collection concurrently.
- Separates destination selection from writing and adds ordering coverage.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/test/browser/exportAgentHostDebugLogs.test.ts |
Tests concurrent workflow ordering. |
src/vs/workbench/contrib/chat/electron-browser/actions/exportAgentHostDebugLogsService.ts |
Separates native destination selection from writing. |
src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.ts |
Coordinates concurrent selection and collection. |
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Verifies the process-log collection limit. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Limits collection to one previous process log. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
roblourens
marked this pull request as ready for review
September 8, 2026 18:51
roblourens
enabled auto-merge (squash)
September 8, 2026 18:51
Paul (pwang347)
approved these changes
Sep 8, 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.
Summary
Why
Trace-level Copilot process logs can grow to hundreds of megabytes per process. The runtime default collected up to five previous logs, making collection and compression take over a minute for long-lived sessions. Selecting the destination only after collection also made the command appear unresponsive before the save prompt.
On a recent session, limiting collection to one previous process log reduced the data from 1.35 GiB to 285 MiB and reduced collection plus compression from about 67 seconds to about 13 seconds.
Validation
npm run transpile-clientnpm run typecheck-clientnpm run eslint -- src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.ts src/vs/workbench/contrib/chat/electron-browser/actions/exportAgentHostDebugLogsService.ts src/vs/workbench/contrib/chat/test/browser/exportAgentHostDebugLogs.test.ts./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/exportAgentHostDebugLogs.test.ts./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts --grep "collects SDK debug logs with process logs"The native OS save dialog cannot be driven by the automated UI scenario harness; promise-ordering coverage verifies that destination selection starts first and collection begins without waiting for it.
(Written by Copilot)