mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 13:04:49 -07:00
fix: remove stale code re-introduced during rebase
Remove syncPlanModeTools(), getExperimentalZedIntegration(), and all zedIntegration references that were re-introduced by conflict resolution but had already been deleted on main. Fix stale doc path in package.json lint-staged config.
This commit is contained in:
@@ -2647,62 +2647,6 @@ describe('loadCliConfig approval mode', () => {
|
||||
expect(plansDir).toContain('.custom-plans');
|
||||
});
|
||||
|
||||
describe('Feature Gates', () => {
|
||||
it('should parse --feature-gates CLI flag', async () => {
|
||||
process.argv = [
|
||||
'node',
|
||||
'script.js',
|
||||
'--feature-gates',
|
||||
'plan=true,enableAgents=false',
|
||||
];
|
||||
const argv = await parseArguments(createTestMergedSettings());
|
||||
expect(argv.featureGates).toBe('plan=true,enableAgents=false');
|
||||
});
|
||||
|
||||
it('should respect "features" setting in loadCliConfig', async () => {
|
||||
process.argv = ['node', 'script.js'];
|
||||
const settings = createTestMergedSettings({
|
||||
features: { plan: true },
|
||||
});
|
||||
const argv = await parseArguments(settings);
|
||||
const config = await loadCliConfig(settings, 'test-session', argv);
|
||||
expect(config.isFeatureEnabled('plan')).toBe(true);
|
||||
});
|
||||
|
||||
it('should prioritize --feature-gates flag over settings', async () => {
|
||||
process.argv = ['node', 'script.js', '--feature-gates', 'plan=true'];
|
||||
const settings = createTestMergedSettings({
|
||||
features: { plan: false },
|
||||
});
|
||||
const argv = await parseArguments(settings);
|
||||
const config = await loadCliConfig(settings, 'test-session', argv);
|
||||
expect(config.isFeatureEnabled('plan')).toBe(true);
|
||||
});
|
||||
|
||||
it('should allow plan approval mode when features.plan is enabled', async () => {
|
||||
process.argv = ['node', 'script.js', '--approval-mode', 'plan'];
|
||||
const settings = createTestMergedSettings({
|
||||
features: { plan: true },
|
||||
});
|
||||
const argv = await parseArguments(settings);
|
||||
const config = await loadCliConfig(settings, 'test-session', argv);
|
||||
expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.PLAN);
|
||||
});
|
||||
|
||||
it('should throw error when --approval-mode=plan is used but features.plan is disabled', async () => {
|
||||
process.argv = ['node', 'script.js', '--approval-mode', 'plan'];
|
||||
const settings = createTestMergedSettings({
|
||||
features: { plan: false },
|
||||
});
|
||||
const argv = await parseArguments(settings);
|
||||
await expect(
|
||||
loadCliConfig(settings, 'test-session', argv),
|
||||
).rejects.toThrow(
|
||||
'Approval mode "plan" is only available when experimental.plan is enabled.',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
// --- Untrusted Folder Scenarios ---
|
||||
describe('when folder is NOT trusted', () => {
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -767,7 +767,6 @@ export async function loadCliConfig(
|
||||
bugCommand: settings.advanced?.bugCommand,
|
||||
model: resolvedModel,
|
||||
maxSessionTurns: settings.model?.maxSessionTurns,
|
||||
experimentalZedIntegration: argv.experimentalAcp || false,
|
||||
features: settings.features,
|
||||
featureGates: argv.featureGates,
|
||||
listExtensions: argv.listExtensions || false,
|
||||
|
||||
@@ -2389,15 +2389,6 @@ const SETTINGS_SCHEMA = {
|
||||
description: 'Enable planning features (Plan Mode and tools).',
|
||||
showInDialog: true,
|
||||
},
|
||||
zedIntegration: {
|
||||
type: 'boolean',
|
||||
label: 'Zed Integration',
|
||||
category: 'Features',
|
||||
requiresRestart: true,
|
||||
default: false,
|
||||
description: 'Enable Zed integration.',
|
||||
showInDialog: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const satisfies SettingsSchema;
|
||||
|
||||
@@ -2473,7 +2473,6 @@ describe('FeatureGate Integration', () => {
|
||||
extensionManagement: true,
|
||||
plan: true,
|
||||
enableAgents: true,
|
||||
zedIntegration: true,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -2482,7 +2481,6 @@ describe('FeatureGate Integration', () => {
|
||||
expect(config.getExtensionManagement()).toBe(true);
|
||||
expect(config.isPlanEnabled()).toBe(true);
|
||||
expect(config.isAgentsEnabled()).toBe(true);
|
||||
expect(config.getExperimentalZedIntegration()).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -733,8 +733,6 @@ export class Config implements McpContext {
|
||||
private readonly useBackgroundColor: boolean;
|
||||
private readonly useAlternateBuffer: boolean;
|
||||
private shellExecutionConfig: ShellExecutionConfig;
|
||||
private readonly extensionManagement: boolean = true;
|
||||
private readonly enablePromptCompletion: boolean = false;
|
||||
private readonly truncateToolOutputThreshold: number;
|
||||
private compressionTruncationCounter = 0;
|
||||
private initialized = false;
|
||||
@@ -788,7 +786,6 @@ export class Config implements McpContext {
|
||||
overageStrategy: OverageStrategy;
|
||||
};
|
||||
|
||||
private readonly enableAgents: boolean;
|
||||
private agents: AgentSettings;
|
||||
private readonly enableEventDrivenScheduler: boolean;
|
||||
private readonly skillsSupport: boolean;
|
||||
@@ -913,7 +910,6 @@ export class Config implements McpContext {
|
||||
extensionManagement: params.extensionManagement,
|
||||
plan: params.plan,
|
||||
jitContext: params.experimentalJitContext,
|
||||
zedIntegration: params.experimentalZedIntegration,
|
||||
};
|
||||
for (const [key, value] of Object.entries(legacyMap)) {
|
||||
if (value !== undefined && params.features?.[key] === undefined) {
|
||||
@@ -931,7 +927,6 @@ export class Config implements McpContext {
|
||||
this.featureGate = gate;
|
||||
|
||||
this.modelAvailabilityService = new ModelAvailabilityService();
|
||||
this.experimentalJitContext = params.experimentalJitContext ?? false;
|
||||
this.modelSteering = params.modelSteering ?? false;
|
||||
this.userHintService = new UserHintService(() =>
|
||||
this.isModelSteeringEnabled(),
|
||||
@@ -1215,7 +1210,7 @@ export class Config implements McpContext {
|
||||
}
|
||||
});
|
||||
|
||||
if (!this.interactive || this.acpMode || this.getExperimentalZedIntegration()) {
|
||||
if (!this.interactive || this.acpMode) {
|
||||
await this.mcpInitializationPromise;
|
||||
}
|
||||
|
||||
@@ -2092,42 +2087,6 @@ export class Config implements McpContext {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronizes enter/exit plan mode tools based on current mode.
|
||||
*/
|
||||
syncPlanModeTools(): void {
|
||||
const isPlanMode = this.getApprovalMode() === ApprovalMode.PLAN;
|
||||
const registry = this.getToolRegistry();
|
||||
|
||||
if (isPlanMode) {
|
||||
if (registry.getTool(ENTER_PLAN_MODE_TOOL_NAME)) {
|
||||
registry.unregisterTool(ENTER_PLAN_MODE_TOOL_NAME);
|
||||
}
|
||||
if (!registry.getTool(EXIT_PLAN_MODE_TOOL_NAME)) {
|
||||
registry.registerTool(new ExitPlanModeTool(this, this.messageBus));
|
||||
}
|
||||
} else {
|
||||
if (registry.getTool(EXIT_PLAN_MODE_TOOL_NAME)) {
|
||||
registry.unregisterTool(EXIT_PLAN_MODE_TOOL_NAME);
|
||||
}
|
||||
if (this.isPlanEnabled()) {
|
||||
if (!registry.getTool(ENTER_PLAN_MODE_TOOL_NAME)) {
|
||||
registry.registerTool(new EnterPlanModeTool(this, this.messageBus));
|
||||
}
|
||||
} else {
|
||||
if (registry.getTool(ENTER_PLAN_MODE_TOOL_NAME)) {
|
||||
registry.unregisterTool(ENTER_PLAN_MODE_TOOL_NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.geminiClient?.isInitialized()) {
|
||||
this.geminiClient.setTools().catch((err) => {
|
||||
debugLogger.error('Failed to update tools', err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs the duration of the current approval mode.
|
||||
*/
|
||||
@@ -2334,10 +2293,6 @@ export class Config implements McpContext {
|
||||
}
|
||||
}
|
||||
|
||||
getExperimentalZedIntegration(): boolean {
|
||||
return this.isFeatureEnabled('zedIntegration');
|
||||
}
|
||||
|
||||
getListExtensions(): boolean {
|
||||
return this.listExtensions;
|
||||
}
|
||||
|
||||
@@ -311,13 +311,6 @@ export const FeatureDefinitions: Record<string, FeatureSpec[]> = {
|
||||
description: 'Enable planning features (Plan Mode and tools).',
|
||||
},
|
||||
],
|
||||
zedIntegration: [
|
||||
{
|
||||
preRelease: FeatureStage.Alpha,
|
||||
since: '0.30.0',
|
||||
description: 'Enable Zed integration.',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// Register core features
|
||||
|
||||
Reference in New Issue
Block a user