mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 21:14:35 -07:00
refactor: deprecate legacy confirmation settings and enforce Policy Engine (#15626)
This commit is contained in:
@@ -96,7 +96,6 @@ describe('BuiltinCommandLoader', () => {
|
||||
vi.clearAllMocks();
|
||||
mockConfig = {
|
||||
getFolderTrust: vi.fn().mockReturnValue(true),
|
||||
getEnableMessageBusIntegration: () => false,
|
||||
getEnableExtensionReloading: () => false,
|
||||
getEnableHooks: () => false,
|
||||
} as unknown as Config;
|
||||
@@ -172,7 +171,6 @@ describe('BuiltinCommandLoader', () => {
|
||||
it('should include policies command when message bus integration is enabled', async () => {
|
||||
const mockConfigWithMessageBus = {
|
||||
...mockConfig,
|
||||
getEnableMessageBusIntegration: () => true,
|
||||
getEnableHooks: () => false,
|
||||
} as unknown as Config;
|
||||
const loader = new BuiltinCommandLoader(mockConfigWithMessageBus);
|
||||
@@ -180,18 +178,6 @@ describe('BuiltinCommandLoader', () => {
|
||||
const policiesCmd = commands.find((c) => c.name === 'policies');
|
||||
expect(policiesCmd).toBeDefined();
|
||||
});
|
||||
|
||||
it('should exclude policies command when message bus integration is disabled', async () => {
|
||||
const mockConfigWithoutMessageBus = {
|
||||
...mockConfig,
|
||||
getEnableMessageBusIntegration: () => false,
|
||||
getEnableHooks: () => false,
|
||||
} as unknown as Config;
|
||||
const loader = new BuiltinCommandLoader(mockConfigWithoutMessageBus);
|
||||
const commands = await loader.loadCommands(new AbortController().signal);
|
||||
const policiesCmd = commands.find((c) => c.name === 'policies');
|
||||
expect(policiesCmd).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('BuiltinCommandLoader profile', () => {
|
||||
@@ -202,7 +188,6 @@ describe('BuiltinCommandLoader profile', () => {
|
||||
mockConfig = {
|
||||
getFolderTrust: vi.fn().mockReturnValue(false),
|
||||
getCheckpointingEnabled: () => false,
|
||||
getEnableMessageBusIntegration: () => false,
|
||||
getEnableExtensionReloading: () => false,
|
||||
getEnableHooks: () => false,
|
||||
} as unknown as Config;
|
||||
|
||||
@@ -81,9 +81,7 @@ export class BuiltinCommandLoader implements ICommandLoader {
|
||||
modelCommand,
|
||||
...(this.config?.getFolderTrust() ? [permissionsCommand] : []),
|
||||
privacyCommand,
|
||||
...(this.config?.getEnableMessageBusIntegration()
|
||||
? [policiesCommand]
|
||||
: []),
|
||||
policiesCommand,
|
||||
...(isDevelopment ? [profileCommand] : []),
|
||||
quitCommand,
|
||||
restoreCommand(this.config),
|
||||
|
||||
Reference in New Issue
Block a user