mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 21:32:56 -07:00
fix(cli): do not override GOOGLE_CLOUD_PROJECT in Cloud Shell when using Vertex AI (#24455)
Co-authored-by: David Pierce <davidapierce@google.com>
This commit is contained in:
@@ -173,7 +173,6 @@ import {
|
||||
QUEUE_ERROR_DISPLAY_DURATION_MS,
|
||||
EXPAND_HINT_DURATION_MS,
|
||||
} from './constants.js';
|
||||
import { LoginWithGoogleRestartDialog } from './auth/LoginWithGoogleRestartDialog.js';
|
||||
import { NewAgentsChoice } from './components/NewAgentsNotification.js';
|
||||
import { isSlashCommand } from './utils/commandUtils.js';
|
||||
import { parseSlashCommand } from '../utils/commands.js';
|
||||
@@ -756,7 +755,7 @@ export const AppContainer = (props: AppContainerProps) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (authState === AuthState.Authenticated && authContext.requiresRestart) {
|
||||
setAuthState(AuthState.AwaitingGoogleLoginRestart);
|
||||
setAuthState(AuthState.AwaitingLoginRestart);
|
||||
setAuthContext({});
|
||||
}
|
||||
}, [authState, authContext, setAuthState]);
|
||||
@@ -2185,8 +2184,13 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
|
||||
const nightly = props.version.includes('nightly');
|
||||
|
||||
const isAwaitingLoginRestart = authState === AuthState.AwaitingLoginRestart;
|
||||
const loginRestartMessage =
|
||||
settings.merged.security.auth.selectedType === AuthType.USE_VERTEX_AI
|
||||
? 'Authenticating to Vertex AI in Cloud Shell requires a restart to apply project settings.'
|
||||
: undefined;
|
||||
|
||||
const dialogsVisible =
|
||||
shouldShowIdePrompt ||
|
||||
shouldShowIdePrompt ||
|
||||
isFolderTrustDialogOpen ||
|
||||
isPolicyUpdateDialogOpen ||
|
||||
@@ -2214,6 +2218,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
!!emptyWalletRequest ||
|
||||
isSessionBrowserOpen ||
|
||||
authState === AuthState.AwaitingApiKeyInput ||
|
||||
isAwaitingLoginRestart ||
|
||||
!!newAgents;
|
||||
|
||||
const hasPendingToolConfirmation = useMemo(
|
||||
@@ -2447,6 +2452,8 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
accountSuspensionInfo,
|
||||
isAuthDialogOpen,
|
||||
isAwaitingApiKeyInput: authState === AuthState.AwaitingApiKeyInput,
|
||||
isAwaitingLoginRestart,
|
||||
loginRestartMessage,
|
||||
apiKeyDefaultValue,
|
||||
editorError,
|
||||
isEditorDialogOpen,
|
||||
@@ -2652,6 +2659,8 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
customDialog,
|
||||
apiKeyDefaultValue,
|
||||
authState,
|
||||
isAwaitingLoginRestart,
|
||||
loginRestartMessage,
|
||||
transientMessage,
|
||||
bannerData,
|
||||
bannerVisible,
|
||||
@@ -2726,6 +2735,10 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
setActiveBackgroundTaskPid,
|
||||
setIsBackgroundTaskListOpen,
|
||||
setAuthContext,
|
||||
dismissLoginRestart: () => {
|
||||
setAuthContext({});
|
||||
setAuthState(AuthState.Updating);
|
||||
},
|
||||
onHintInput: () => {},
|
||||
onHintBackspace: () => {},
|
||||
onHintClear: () => {},
|
||||
@@ -2832,18 +2845,6 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
],
|
||||
);
|
||||
|
||||
if (authState === AuthState.AwaitingGoogleLoginRestart) {
|
||||
return (
|
||||
<LoginWithGoogleRestartDialog
|
||||
onDismiss={() => {
|
||||
setAuthContext({});
|
||||
setAuthState(AuthState.Updating);
|
||||
}}
|
||||
config={config}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<UIStateContext.Provider value={uiState}>
|
||||
<QuotaContext.Provider value={quotaState}>
|
||||
|
||||
Reference in New Issue
Block a user