Add Copilot auth token to router decision fetcher for CAPI proxy auth#3980
Merged
TylerLeonhardt merged 1 commit intomicrosoft:mainfrom Feb 25, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Copilot authentication token support to the router decision fetcher to enable authentication with the CAPI router endpoint. The router decision fetcher is used to determine which AI model should handle a query based on reasoning classification.
Changes:
- Added
IAuthenticationServicedependency toRouterDecisionFetcherconstructor - Modified
getRoutedModelto retrieve Copilot auth token and include it in Authorization header - Updated
AutomodeServiceto pass the authentication service when instantiatingRouterDecisionFetcher
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/platform/endpoint/node/routerDecisionFetcher.ts | Added IAuthenticationService parameter to constructor, retrieved Copilot token, and added Bearer token to Authorization header |
| src/platform/endpoint/node/automodeService.ts | Updated RouterDecisionFetcher instantiation to pass the authentication service |
000375e to
3218638
Compare
TylerLeonhardt
requested changes
Feb 25, 2026
| for (let attempt = 0; attempt < MAX_RETRIES; attempt++) { | ||
| let response: Response; | ||
| try { | ||
| response = await this._fetcherService.fetch(routerApiUrl, { |
Member
There was a problem hiding this comment.
The URI here is user configured. If they put something that isn't a GitHub url, their Copilot token will be still sent there.
We should check if the url is a GitHub url and only send the copilot token in that case
3218638 to
f235976
Compare
TylerLeonhardt
previously approved these changes
Feb 25, 2026
f235976 to
ae6f9c3
Compare
TylerLeonhardt
approved these changes
Feb 25, 2026
connor4312
approved these changes
Feb 25, 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.
No description provided.