Agents enabled.

This commit is contained in:
Christian Gunderman
2026-02-16 12:37:40 -08:00
parent 02bf9db95c
commit 8a075a1ed9
4 changed files with 20 additions and 13 deletions
+15 -8
View File
@@ -751,7 +751,7 @@ export class Config {
this.model = params.model;
this.disableLoopDetection = params.disableLoopDetection ?? false;
this._activeModel = params.model;
this.enableAgents = params.enableAgents ?? false;
this.enableAgents = params.enableAgents ?? true;
this.agents = params.agents ?? {};
this.disableLLMCorrection = params.disableLLMCorrection ?? true;
this.planEnabled = params.plan ?? false;
@@ -2357,6 +2357,7 @@ export class Config {
const maybeRegister = (
toolClass: { name: string; Name?: string },
registerFn: () => void,
defaultEnabled = true,
) => {
const className = toolClass.name;
const toolName = toolClass.Name || className;
@@ -2364,7 +2365,7 @@ export class Config {
// On some platforms, the className can be minified to _ClassName.
const normalizedClassName = className.replace(/^_+/, '');
let isEnabled = true; // Enabled by default if coreTools is not set.
let isEnabled = defaultEnabled; // Use provided default if coreTools is not set.
if (coreTools) {
isEnabled = coreTools.some(
(tool) =>
@@ -2396,18 +2397,24 @@ export class Config {
errorString = String(error);
}
if (useRipgrep) {
maybeRegister(RipGrepTool, () =>
registry.registerTool(new RipGrepTool(this, this.messageBus)),
maybeRegister(
RipGrepTool,
() => registry.registerTool(new RipGrepTool(this, this.messageBus)),
false,
);
} else {
logRipgrepFallback(this, new RipgrepFallbackEvent(errorString));
maybeRegister(GrepTool, () =>
registry.registerTool(new GrepTool(this, this.messageBus)),
maybeRegister(
GrepTool,
() => registry.registerTool(new GrepTool(this, this.messageBus)),
false,
);
}
} else {
maybeRegister(GrepTool, () =>
registry.registerTool(new GrepTool(this, this.messageBus)),
maybeRegister(
GrepTool,
() => registry.registerTool(new GrepTool(this, this.messageBus)),
false,
);
}
+2 -2
View File
@@ -95,7 +95,7 @@ describe('Core System Prompt (prompts.ts)', () => {
},
isInteractive: vi.fn().mockReturnValue(true),
isInteractiveShellEnabled: vi.fn().mockReturnValue(true),
isAgentsEnabled: vi.fn().mockReturnValue(false),
isAgentsEnabled: vi.fn().mockReturnValue(true),
getPreviewFeatures: vi.fn().mockReturnValue(true),
getModel: vi.fn().mockReturnValue(DEFAULT_GEMINI_MODEL_AUTO),
getActiveModel: vi.fn().mockReturnValue(DEFAULT_GEMINI_MODEL),
@@ -375,7 +375,7 @@ describe('Core System Prompt (prompts.ts)', () => {
},
isInteractive: vi.fn().mockReturnValue(false),
isInteractiveShellEnabled: vi.fn().mockReturnValue(false),
isAgentsEnabled: vi.fn().mockReturnValue(false),
isAgentsEnabled: vi.fn().mockReturnValue(true),
getModel: vi.fn().mockReturnValue('auto'),
getActiveModel: vi.fn().mockReturnValue(PREVIEW_GEMINI_MODEL),
getPreviewFeatures: vi.fn().mockReturnValue(true),