Skip to content

agentHost: add Copilot SDK log level setting#325525

Merged
roblourens merged 7 commits into
mainfrom
roblou/agents/add-log-level-setting-sdk-config
Jul 13, 2026
Merged

agentHost: add Copilot SDK log level setting#325525
roblourens merged 7 commits into
mainfrom
roblou/agents/add-log-level-setting-sdk-config

Conversation

@roblourens

@roblourens roblourens commented Jul 13, 2026

Copy link
Copy Markdown
Member

Adds chat.agentHost.copilotSdk.logLevel to 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-client
  • npm run valid-layers-check
  • focused node and browser unit tests
  • pre-commit hygiene

(Written by Copilot)

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>
Copilot AI review requested due to automatic review settings July 13, 2026 02:55

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.

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 ILogService level).
  • 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>

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.

Review details

  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts
Comment thread src/vs/platform/agentHost/node/copilot/copilotAgent.ts Outdated
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>

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.

Review details

  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread src/vs/platform/agentHost/node/copilot/copilotAgent.ts Outdated
Comment thread src/vs/platform/agentHost/node/copilot/copilotAgent.ts Outdated
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>

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.

Review details

  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Medium

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>

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.

Review details

  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Medium

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

Review details

  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Medium

@roblourens roblourens marked this pull request as ready for review July 13, 2026 23:14
Restore the separator accidentally removed while resolving merge hygiene.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens roblourens enabled auto-merge (squash) July 13, 2026 23:15
@roblourens roblourens merged commit 3f5c62a into main Jul 13, 2026
29 checks passed
@roblourens roblourens deleted the roblou/agents/add-log-level-setting-sdk-config branch July 13, 2026 23:40
@vs-code-engineering vs-code-engineering Bot added this to the 1.130.0 milestone Jul 13, 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