Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/platform/github/common/githubService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<GetCustomAgentsResponse> {
protected async getCustomAgentsWithToken(owner: string, repo: string, token: string): Promise<GetCustomAgentsResponse | undefined> {
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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform/github/common/octoKitServiceImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
}
Expand Down