fix(ui): handle headless execution in credits and upgrade dialogs (#21850)

This commit is contained in:
Gaurav
2026-03-10 07:54:15 -07:00
committed by GitHub
parent 94ab449e65
commit 47e4f6b13f
7 changed files with 129 additions and 7 deletions
@@ -7,6 +7,7 @@
import {
AuthType,
openBrowserSecurely,
shouldLaunchBrowser,
UPGRADE_URL_PAGE,
} from '@google/gemini-cli-core';
import type { SlashCommand } from './types.js';
@@ -35,6 +36,14 @@ export const upgradeCommand: SlashCommand = {
};
}
if (!shouldLaunchBrowser()) {
return {
type: 'message',
messageType: 'info',
content: `Please open this URL in a browser: ${UPGRADE_URL_PAGE}`,
};
}
try {
await openBrowserSecurely(UPGRADE_URL_PAGE);
} catch (error) {