mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 18:44:30 -07:00
fix(cli) : fixed bug #8310 where /memory refresh will create discrepancies with initial memory load ignoring settings/config for trusted folder and file filters (#10611)
Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
This commit is contained in:
@@ -7,7 +7,11 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import type { Mock } from 'vitest';
|
||||
import type { ConfigParameters, SandboxConfig } from './config.js';
|
||||
import { Config, ApprovalMode } from './config.js';
|
||||
import {
|
||||
Config,
|
||||
ApprovalMode,
|
||||
DEFAULT_FILE_FILTERING_OPTIONS,
|
||||
} from './config.js';
|
||||
import * as path from 'node:path';
|
||||
import { setGeminiMdFilename as mockSetGeminiMdFilename } from '../tools/memoryTool.js';
|
||||
import {
|
||||
@@ -318,7 +322,9 @@ describe('Server Config (config.ts)', () => {
|
||||
|
||||
it('should set default file filtering settings when not provided', () => {
|
||||
const config = new Config(baseParams);
|
||||
expect(config.getFileFilteringRespectGitIgnore()).toBe(true);
|
||||
expect(config.getFileFilteringRespectGitIgnore()).toBe(
|
||||
DEFAULT_FILE_FILTERING_OPTIONS.respectGitIgnore,
|
||||
);
|
||||
});
|
||||
|
||||
it('should set custom file filtering settings when provided', () => {
|
||||
|
||||
@@ -144,14 +144,14 @@ export interface ExtensionInstallMetadata {
|
||||
|
||||
import type { FileFilteringOptions } from './constants.js';
|
||||
import {
|
||||
DEFAULT_MEMORY_FILE_FILTERING_OPTIONS,
|
||||
DEFAULT_FILE_FILTERING_OPTIONS,
|
||||
DEFAULT_MEMORY_FILE_FILTERING_OPTIONS,
|
||||
} from './constants.js';
|
||||
|
||||
export type { FileFilteringOptions };
|
||||
export {
|
||||
DEFAULT_MEMORY_FILE_FILTERING_OPTIONS,
|
||||
DEFAULT_FILE_FILTERING_OPTIONS,
|
||||
DEFAULT_MEMORY_FILE_FILTERING_OPTIONS,
|
||||
};
|
||||
|
||||
export const DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD = 4_000_000;
|
||||
@@ -405,8 +405,12 @@ export class Config {
|
||||
this.usageStatisticsEnabled = params.usageStatisticsEnabled ?? true;
|
||||
|
||||
this.fileFiltering = {
|
||||
respectGitIgnore: params.fileFiltering?.respectGitIgnore ?? true,
|
||||
respectGeminiIgnore: params.fileFiltering?.respectGeminiIgnore ?? true,
|
||||
respectGitIgnore:
|
||||
params.fileFiltering?.respectGitIgnore ??
|
||||
DEFAULT_FILE_FILTERING_OPTIONS.respectGitIgnore,
|
||||
respectGeminiIgnore:
|
||||
params.fileFiltering?.respectGeminiIgnore ??
|
||||
DEFAULT_FILE_FILTERING_OPTIONS.respectGeminiIgnore,
|
||||
enableRecursiveFileSearch:
|
||||
params.fileFiltering?.enableRecursiveFileSearch ?? true,
|
||||
disableFuzzySearch: params.fileFiltering?.disableFuzzySearch ?? false,
|
||||
@@ -885,6 +889,9 @@ export class Config {
|
||||
return this.ideMode;
|
||||
}
|
||||
|
||||
/***
|
||||
* TODO: Review if this is actually used at it seems it is only used but the FileCommandLoader
|
||||
*/
|
||||
getFolderTrustFeature(): boolean {
|
||||
return this.folderTrustFeature;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user