chat: Add default Agent Host log export location - #336501
Draft
roblourens wants to merge 1 commit into
Draft
roblourens wants to merge 1 commit into
roblourens wants to merge 1 commit into
Conversation
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]>
Contributor
There was a problem hiding this comment.
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
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'); | ||
| } |
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
chat.agentHost.debugLogs.defaultExportLocationsettingTesting
npm run compilenpm run hygienenpm 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)