agentHost: add Copilot SDK log level setting#325525
Merged
Merged
Conversation
Forward a VS Code setting through agent host root configuration and restart the Copilot SDK client when the startup-only value changes. Preserve the existing agent host log level mapping as the default.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new chat.agentHost.copilotSdk.logLevel setting to control Copilot SDK runtime logging for the local agent host, without requiring VS Code to run in verbose/trace mode globally. The setting is forwarded into the agent host root config and applied when constructing the Copilot SDK client; changing it triggers a client restart so the new level can take effect.
Changes:
- Register
chat.agentHost.copilotSdk.logLevel(enum) and document its restart behavior in the chat configuration contribution. - Forward the setting into the local agent host root config and apply it to Copilot SDK client creation (with default behavior still mapping from VS Code/agent-host
ILogServicelevel). - Extend unit tests to cover forwarding, default/explicit resolution, and restart behavior when the setting changes.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostCopilotCliSettingsContribution.test.ts | Extends forwarding tests to include the new Copilot SDK log level setting/key. |
| src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts | Registers the new chat.agentHost.copilotSdk.logLevel setting (enum + localized descriptions). |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.ts | Forwards chat.agentHost.copilotSdk.logLevel into the agent host root config. |
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Adds coverage for passing/resolving the log level and restarting the client when it changes. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Resolves the effective SDK log level and treats the setting as a startup-only value that triggers restart when changed. |
| src/vs/platform/agentHost/common/copilotCliConfig.ts | Adds the new root-config key, setting ID constant, log level value unions, and schema registration. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Low
(Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make the shared setting application-scoped and resolve the default log level immediately before creating the SDK client. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the same captured values to construct startup-only SDK options and detect stale starts. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Limit the setting to info and trace while preserving VS Code trace logging as an additional way to enable full SDK diagnostics. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore the separator accidentally removed while resolving merge hygiene. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
kycutler
approved these changes
Jul 13, 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.
Adds
chat.agentHost.copilotSdk.logLevelto control Copilot SDK runtime logging without launching VS Code in verbose mode.The application-scoped setting is forwarded through the local agent host root configuration and offers two values:
info(default): SDK info logging; VS Code trace logging still enables full SDK diagnostics.trace: full SDK diagnostics.Because the SDK cannot update this dynamically, changing the setting restarts the client and reloads active sessions when next used. Startup snapshots ensure transient configuration changes cannot leave the running SDK client stale.
Tests cover forwarding, both setting values, the VS Code trace override, restart behavior, and unrelated configuration changes.
Validation:
npm run typecheck-clientnpm run valid-layers-check(Written by Copilot)