mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 14:04:41 -07:00
Override Gemini CLI trust with VScode workspace trust when in IDE (#7433)
This commit is contained in:
@@ -43,6 +43,7 @@ import {
|
||||
import { shouldAttemptBrowserLaunch } from '../utils/browser.js';
|
||||
import type { MCPOAuthConfig } from '../mcp/oauth-provider.js';
|
||||
import { IdeClient } from '../ide/ide-client.js';
|
||||
import { ideContext } from '../ide/ideContext.js';
|
||||
import type { Content } from '@google/genai';
|
||||
import type { FileSystemService } from '../services/fileSystemService.js';
|
||||
import { StandardFileSystemService } from '../services/fileSystemService.js';
|
||||
@@ -749,6 +750,11 @@ export class Config {
|
||||
// restarts in the more common path. If the user chooses to mark the folder
|
||||
// as untrusted, the CLI will restart and we will have the trust value
|
||||
// reloaded.
|
||||
const context = ideContext.getIdeContext();
|
||||
if (context?.workspaceState?.isTrusted !== undefined) {
|
||||
return context.workspaceState.isTrusted;
|
||||
}
|
||||
|
||||
return this.trustedFolder ?? true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user