mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 11:34:44 -07:00
fix(plan): update persistent approval mode setting (#18638)
Co-authored-by: Sandy Tao <sandytao520@icloud.com>
This commit is contained in:
@@ -2624,7 +2624,7 @@ describe('loadCliConfig approval mode', () => {
|
||||
it('should use approvalMode from settings when no CLI flags are set', async () => {
|
||||
process.argv = ['node', 'script.js'];
|
||||
const settings = createTestMergedSettings({
|
||||
tools: { approvalMode: 'auto_edit' },
|
||||
general: { defaultApprovalMode: 'auto_edit' },
|
||||
});
|
||||
const argv = await parseArguments(settings);
|
||||
const config = await loadCliConfig(settings, 'test-session', argv);
|
||||
@@ -2636,7 +2636,7 @@ describe('loadCliConfig approval mode', () => {
|
||||
it('should prioritize --approval-mode flag over settings', async () => {
|
||||
process.argv = ['node', 'script.js', '--approval-mode', 'auto_edit'];
|
||||
const settings = createTestMergedSettings({
|
||||
tools: { approvalMode: 'default' },
|
||||
general: { defaultApprovalMode: 'default' },
|
||||
});
|
||||
const argv = await parseArguments(settings);
|
||||
const config = await loadCliConfig(settings, 'test-session', argv);
|
||||
@@ -2648,7 +2648,7 @@ describe('loadCliConfig approval mode', () => {
|
||||
it('should prioritize --yolo flag over settings', async () => {
|
||||
process.argv = ['node', 'script.js', '--yolo'];
|
||||
const settings = createTestMergedSettings({
|
||||
tools: { approvalMode: 'auto_edit' },
|
||||
general: { defaultApprovalMode: 'auto_edit' },
|
||||
});
|
||||
const argv = await parseArguments(settings);
|
||||
const config = await loadCliConfig(settings, 'test-session', argv);
|
||||
@@ -2658,7 +2658,7 @@ describe('loadCliConfig approval mode', () => {
|
||||
it('should respect plan mode from settings when experimental.plan is enabled', async () => {
|
||||
process.argv = ['node', 'script.js'];
|
||||
const settings = createTestMergedSettings({
|
||||
tools: { approvalMode: 'plan' },
|
||||
general: { defaultApprovalMode: 'plan' },
|
||||
experimental: { plan: true },
|
||||
});
|
||||
const argv = await parseArguments(settings);
|
||||
@@ -2669,7 +2669,7 @@ describe('loadCliConfig approval mode', () => {
|
||||
it('should throw error if plan mode is in settings but experimental.plan is disabled', async () => {
|
||||
process.argv = ['node', 'script.js'];
|
||||
const settings = createTestMergedSettings({
|
||||
tools: { approvalMode: 'plan' },
|
||||
general: { defaultApprovalMode: 'plan' },
|
||||
experimental: { plan: false },
|
||||
});
|
||||
const argv = await parseArguments(settings);
|
||||
|
||||
Reference in New Issue
Block a user