Skip to content

[Perf] agentHost: Improve debug log export responsiveness - #334524

Merged
roblourens merged 2 commits into
mainfrom
roblou/agents/debug-log-export-responsiveness
Sep 8, 2026
Merged

roblourens merged 2 commits into
mainfrom
roblou/agents/debug-log-export-responsiveness

Conversation

@roblourens

Copy link
Copy Markdown
Member

Summary

  • limit Copilot debug exports to the current process log and one previous matching log
  • prompt for the export destination immediately while log collection runs concurrently
  • keep collection progress visible and separate destination selection from writing for desktop and browser exports

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-client
  • npm run typecheck-client
  • npm 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"
  • pre-commit hygiene

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)

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>
Copilot AI balanced review requested due to automatic review settings September 4, 2026 15:19

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.

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.

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.

Copilot review overview

🟢 Approval recommended

The reviewed changes have no unresolved approval-blocking issues.

Review tier: Balanced
Findings: None

@roblourens
roblourens marked this pull request as ready for review September 8, 2026 18:51
@roblourens
roblourens enabled auto-merge (squash) September 8, 2026 18:51
@roblourens
roblourens merged commit 318c8e6 into main Sep 8, 2026
35 checks passed
@roblourens
roblourens deleted the roblou/agents/debug-log-export-responsiveness branch September 8, 2026 18:57
@vs-code-engineering vs-code-engineering Bot added this to the 1.138.0 milestone Sep 8, 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