Skip to content

chat: Add default Agent Host log export location - #336501

Draft
roblourens wants to merge 1 commit into
mainfrom
roblou/agents/set-default-log-export-location
Draft

roblourens wants to merge 1 commit into
mainfrom
roblou/agents/set-default-log-export-location

Conversation

@roblourens

Copy link
Copy Markdown
Member

Summary

  • add a machine-scoped chat.agentHost.debugLogs.defaultExportLocation setting
  • use the configured folder as the initial Agent Host debug-log export destination on desktop and web
  • fall back to the normal file-dialog location when the configured path is missing, relative, or not a directory

Testing

  • npm run compile
  • npm run hygiene
  • npm run eslint -- src/vs/workbench/contrib/chat/common/constants.ts src/vs/workbench/contrib/chat/browser/chat.shared.contribution.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

(Written by Copilot)

Add a machine-scoped setting that controls the initial destination for Agent Host debug log exports across desktop and web. Fall back to the normal file-dialog location when the configured folder is unavailable.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 17, 2026 00:20

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

🟡 Changes recommended

Remote settings are ignored, the native web picker does not honor the configured folder, and directory validation performs unnecessary enumeration.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)
What changed in this PR

Adds a machine-scoped default location for exporting Agent Host debug logs.

Changes:

  • Registers the export-location setting.
  • Applies it to desktop and web export dialogs with fallback handling.
  • Adds browser-side coverage for valid and missing folders.
File Description
constants.ts Defines the setting key.
chat.shared.contribution.ts Registers the setting and validation.
exportAgentHostDebugLogsAction.ts Resolves and applies the configured directory.
exportAgentHostDebugLogsService.ts Uses the directory for desktop ZIP exports.
exportAgentHostDebugLogs.test.ts Tests configured and fallback destinations.

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

canSelectFiles: false,
canSelectFolders: true,
canSelectMany: false,
defaultUri,
fileService: IFileService,
logService: ILogService,
): Promise<URI> {
const configuredPath = configurationService.inspect<string>(ChatConfiguration.AgentHostDebugLogsDefaultExportLocation).userLocalValue;
Comment on lines +132 to +140
if (await fileService.exists(configuredDirectory)) {
const stat = await fileService.resolve(configuredDirectory);
if (stat.isDirectory) {
return configuredDirectory;
}
logService.warn('[ExportAgentHostDebugLogs] Configured default export location is not a folder; using the default file-dialog location');
} else {
logService.warn('[ExportAgentHostDebugLogs] Configured default export location does not exist; using the default file-dialog location');
}
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.

2 participants