diff --git a/src/platform/github/common/githubService.ts b/src/platform/github/common/githubService.ts index 83c543facd..67c915b158 100644 --- a/src/platform/github/common/githubService.ts +++ b/src/platform/github/common/githubService.ts @@ -341,7 +341,7 @@ export class BaseOctoKitService { return getPullRequestFromGlobalId(this._fetcherService, this._logService, this._telemetryService, this._capiClientService.dotcomAPIURL, token, globalId); } - protected async getCustomAgentsWithToken(owner: string, repo: string, token: string): Promise { + protected async getCustomAgentsWithToken(owner: string, repo: string, token: string): Promise { const queryParams = '?exclude_invalid_config=true'; return makeGitHubAPIRequest(this._fetcherService, this._logService, this._telemetryService, 'https://api.githubcopilot.com', `agents/swe/custom-agents/${owner}/${repo}${queryParams}`, 'GET', token, undefined, undefined, 'json', 'vscode-copilot-chat'); } diff --git a/src/platform/github/common/octoKitServiceImpl.ts b/src/platform/github/common/octoKitServiceImpl.ts index 127c041735..69beb34960 100644 --- a/src/platform/github/common/octoKitServiceImpl.ts +++ b/src/platform/github/common/octoKitServiceImpl.ts @@ -148,7 +148,7 @@ export class OctoKitService extends BaseOctoKitService implements IOctoKitServic if (!authToken) { return []; } - const { agents } = await this.getCustomAgentsWithToken(owner, repo, authToken); + const { agents } = (await this.getCustomAgentsWithToken(owner, repo, authToken)) ?? {}; if (!Array.isArray(agents)) { return []; }