Skip to content

BYOK: Show error message when there is no provider#2714

Merged
vijayupadya merged 2 commits intomainfrom
vijayu/gemini-ghe
Jan 5, 2026
Merged

BYOK: Show error message when there is no provider#2714
vijayupadya merged 2 commits intomainfrom
vijayu/gemini-ghe

Conversation

@vijayupadya
Copy link
Contributor

If BYOK provider is undefined, currently it fails silently and there is no indicator to the user.
This change adds log and shows msg.

@vijayupadya vijayupadya marked this pull request as ready for review January 5, 2026 21:09
@vs-code-engineering vs-code-engineering bot added this to the December 2025 milestone Jan 5, 2026
@vijayupadya vijayupadya enabled auto-merge January 5, 2026 21:13
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 improves error handling in the BYOK (Bring Your Own Key) feature by adding user-visible error messages when a BYOK provider is not available, instead of failing silently.

Key Changes

  • Added error handling with user notification when a BYOK provider is undefined in the manageBYOK command
  • Simplified conditional logic after the early return check

Comment on lines +46 to +53
if (!provider) {
this._logService.warn(`BYOK: Provider ${vendor} not registered; BYOK may be disabled for this account or environment.`);
void window.showInformationMessage(
`The "${vendor}" BYOK provider isn't available in this environment. ` +
'This can happen if BYOK is not enabled for your account or this GitHub instance.'
);
return;
}
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The error handling for missing providers is inconsistent between the two commands in this file. The manageBYOK command now shows a user-facing message and uses warn level logging, while the manageBYOKAPIKey command (lines 67-69) only logs an error without showing any user message. Consider showing a similar informational message to users in the manageBYOKAPIKey command for consistency.

Copilot uses AI. Check for mistakes.
@vijayupadya vijayupadya added this pull request to the merge queue Jan 5, 2026
Merged via the queue into main with commit aac7442 Jan 5, 2026
25 checks passed
@vijayupadya vijayupadya deleted the vijayu/gemini-ghe branch January 5, 2026 21:41
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.

2 participants