Skip to content

pass in the URL for the proxy to the CLI session#4070

Merged
amunger merged 1 commit intomainfrom
aamunger/proxyUrlForCli
Feb 27, 2026
Merged

pass in the URL for the proxy to the CLI session#4070
amunger merged 1 commit intomainfrom
aamunger/proxyUrlForCli

Conversation

@amunger
Copy link
Contributor

@amunger amunger commented Feb 27, 2026

pass through the authentication info into the cli session so that it can successfully be used for evals

@amunger amunger marked this pull request as ready for review February 27, 2026 21:31
Copilot AI review requested due to automatic review settings February 27, 2026 21:31
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 27, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR passes the proxy URL and associated HMAC authentication info through to CLI sessions so that evals using the CLI can successfully authenticate when a debug proxy URL is configured. When ConfigKey.Shared.DebugOverrideProxyUrl is set, the SDK now uses hmac auth (with a placeholder HMAC value) and includes the proxy URL as the Copilot API endpoint, rather than attempting real GitHub token-based authentication.

Changes:

  • getAuthInfo() in CopilotCLISDK now returns type: 'hmac' with the configured proxy URL as the API endpoint when a debug proxy URL is set (instead of type: 'token' with an empty token)
  • createSession() in CopilotCLISessionService explicitly calls sdkSession.setAuthInfo() with the same HMAC auth info immediately after session creation, and copilotUrl is threaded through CopilotCLISessionOptions to be included in SessionOptions
  • Tests are updated to reflect the new HMAC auth type and to pass configurationService to CopilotCLISessionService

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/extension/agents/copilotcli/node/copilotCli.ts Auth info return changed from token to hmac with proxy URL when debug proxy is configured; copilotUrl added to CopilotCLISessionOptions
src/extension/agents/copilotcli/node/copilotcliSessionService.ts IConfigurationService injected; createSession and getSession now read DebugOverrideProxyUrl; setAuthInfo called explicitly after session creation
src/extension/agents/copilotcli/node/test/copilotCliAuth.spec.ts Test updated to assert hmac auth type and proxy URL endpoint instead of empty token
src/extension/agents/copilotcli/node/test/copilotCliSessionService.spec.ts configurationService added as constructor argument in test setup
src/extension/chatSessions/vscode-node/test/copilotCLIChatSessionParticipant.spec.ts configurationService added as constructor argument in test setup
Comments suppressed due to low confidence (1)

src/extension/agents/copilotcli/node/copilotcliSessionService.ts:330

  • The createSession method calls sdkSession.setAuthInfo(...) when copilotUrl is configured, but the getSession method (lines 317–334) does not include a corresponding setAuthInfo call after retrieving an existing session from disk via sessionManager.getSession. If the session manager restores a persisted session without the HMAC auth info, that session may be used with incorrect authentication until the next handleRequest call sets it. Consider applying the same setAuthInfo logic in getSession after the sdkSession is retrieved (lines 324–330), for consistency with createSession.
			const copilotUrl = this.configurationService.getConfig(ConfigKey.Shared.DebugOverrideProxyUrl) || undefined;
			const options = await this.createSessionsOptions({ model, workingDirectory, agent, isolationEnabled, mcpServers, copilotUrl });

			const sdkSession = await sessionManager.getSession({ ...options.toSessionOptions(), sessionId }, !readonly);
			if (!sdkSession) {
				this.logService.error(`[CopilotCLISession] CopilotCLI failed to get session ${sessionId}.`);
				return undefined;
			}

			return this.createCopilotSession(sdkSession, options, sessionManager);

@amunger amunger added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit 177647e Feb 27, 2026
23 checks passed
@amunger amunger deleted the aamunger/proxyUrlForCli branch February 27, 2026 22:01
mexicodxnmexico-create added a commit to mexicodxnmexico-create/vscode-copilot-chat that referenced this pull request Feb 28, 2026
* Revert "cli - do not trust empty changes (microsoft/vscode#297975) (microsoft#4036)" (microsoft#4063)

This reverts commit 420c26f.

* Run command tool should include command result (microsoft#4061)

* Run command tool should include command result
Part of microsoft/vscode#298181

* CCR feedback

* Support CAPI WebSocket connections (microsoft#4068) (microsoft#4069)

* Add a maximum date of the comparison commit for the 1p repo telemetry info (microsoft#3774)

* initial passes with copilot before testing

* only pass on successful date

* add tests for new functionality

* return tooOld for all date failures

* remove extra logging, info is already in telemetry and may be too noisy

* fix test that used custom repo mock

---------

Co-authored-by: Ian Huff <ianhuff@Mac.home>
Co-authored-by: Ian Huff <ianhuff@Ians-MacBook-Pro-2.local>

* 0.39.0 (microsoft#4057)

* Make auto have provider affiniy (microsoft#4072)

* Pipe vendor from CAPI through to chat endpoint

* Adopt discussed auto mode behavior

* Update src/platform/endpoint/node/test/automodeService.spec.ts

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

---------

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

* Hold external repo info telemetry (microsoft#4075)

* Hold external repo info telemetry

* Update src/extension/prompt/node/repoInfoTelemetry.ts

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

* Update test to reflect no external telemetry for non-internal users

---------

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

* pass in the URL for the proxy to the CLI session (microsoft#4070)

* Update telemetry pkg (microsoft#4078)

* Merge agents and chatsession folder (microsoft#4058)

* Remove duplicated memory tool in picker (microsoft#4079)

* fixes microsoft/vscode#297010

* address feedback

* 🎨 Palette: Add aria-busy state to webview loading container

💡 What: Toggles `aria-busy` attribute on the `solutionsContainer` during async loading phases.
🎯 Why: To prevent screen reader users from experiencing silent, disorienting DOM changes when dynamic webview content updates.
♿ Accessibility: Improves loading state communication to assistive technologies.

Co-authored-by: mexicodxnmexico-create <245638303+mexicodxnmexico-create@users.noreply.github.com>

* Background - clean worktree changes cache at the end of the turn (microsoft#4083)

* 🎨 Palette: Add aria-busy state to webview loading container

💡 What: Toggles `aria-busy` attribute on the `solutionsContainer` during async loading phases.
🎯 Why: To prevent screen reader users from experiencing silent, disorienting DOM changes when dynamic webview content updates.
♿ Accessibility: Improves loading state communication to assistive technologies.

Co-authored-by: mexicodxnmexico-create <245638303+mexicodxnmexico-create@users.noreply.github.com>

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
Co-authored-by: Alex Ross <38270282+alexr00@users.noreply.github.com>
Co-authored-by: Christof Marti <chrmarti@microsoft.com>
Co-authored-by: Ian Huff <ian.huff@gmail.com>
Co-authored-by: Ian Huff <ianhuff@Mac.home>
Co-authored-by: Ian Huff <ianhuff@Ians-MacBook-Pro-2.local>
Co-authored-by: Ben Villalobos <bevillal@microsoft.com>
Co-authored-by: Logan Ramos <loganramos@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Zhichao Li <57812115+zhichli@users.noreply.github.com>
Co-authored-by: Aaron Munger <2019016+amunger@users.noreply.github.com>
Co-authored-by: Vijay Upadya <41652029+vijayupadya@users.noreply.github.com>
Co-authored-by: Don Jayamanne <don.jayamanne@outlook.com>
Co-authored-by: SteVen Batten <sbatten@microsoft.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: mexicodxnmexico-create <245638303+mexicodxnmexico-create@users.noreply.github.com>
Co-authored-by: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com>
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