mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-12 15:10:59 -07:00
fix: ensure folderTrust returns true in headless mode
This commit is contained in:
@@ -449,6 +449,14 @@ describe('Trusted Folders', () => {
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
it('should return true for isPathTrusted when isHeadlessMode is true', async () => {
|
||||
const geminiCore = await import('@google/gemini-cli-core');
|
||||
vi.spyOn(geminiCore, 'isHeadlessMode').mockReturnValue(true);
|
||||
|
||||
const folders = loadTrustedFolders();
|
||||
expect(folders.isPathTrusted('/any-untrusted-path')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Trusted Folders Caching', () => {
|
||||
|
||||
@@ -128,6 +128,9 @@ export class LoadedTrustedFolders {
|
||||
location: string,
|
||||
config?: Record<string, TrustLevel>,
|
||||
): boolean | undefined {
|
||||
if (isHeadlessMode()) {
|
||||
return true;
|
||||
}
|
||||
const configToUse = config ?? this.user.config;
|
||||
|
||||
// Resolve location to its realpath for canonical comparison
|
||||
|
||||
Reference in New Issue
Block a user