feat(core): Enable ripgrep by default. (#7427)

This commit is contained in:
joshualitt
2025-09-11 16:46:07 -07:00
committed by GitHub
parent 557dba4a32
commit 68035591da
5 changed files with 29 additions and 27 deletions
+13 -13
View File
@@ -490,21 +490,12 @@ describe('Server Config (config.ts)', () => {
});
describe('UseRipgrep Configuration', () => {
it('should default useRipgrep to false when not provided', () => {
it('should default useRipgrep to true when not provided', () => {
const config = new Config(baseParams);
expect(config.getUseRipgrep()).toBe(false);
});
it('should set useRipgrep to true when provided as true', () => {
const paramsWithRipgrep: ConfigParameters = {
...baseParams,
useRipgrep: true,
};
const config = new Config(paramsWithRipgrep);
expect(config.getUseRipgrep()).toBe(true);
});
it('should set useRipgrep to false when explicitly provided as false', () => {
it('should set useRipgrep to false when provided as false', () => {
const paramsWithRipgrep: ConfigParameters = {
...baseParams,
useRipgrep: false,
@@ -513,13 +504,22 @@ describe('Server Config (config.ts)', () => {
expect(config.getUseRipgrep()).toBe(false);
});
it('should default useRipgrep to false when undefined', () => {
it('should set useRipgrep to true when explicitly provided as true', () => {
const paramsWithRipgrep: ConfigParameters = {
...baseParams,
useRipgrep: true,
};
const config = new Config(paramsWithRipgrep);
expect(config.getUseRipgrep()).toBe(true);
});
it('should default useRipgrep to true when undefined', () => {
const paramsWithUndefinedRipgrep: ConfigParameters = {
...baseParams,
useRipgrep: undefined,
};
const config = new Config(paramsWithUndefinedRipgrep);
expect(config.getUseRipgrep()).toBe(false);
expect(config.getUseRipgrep()).toBe(true);
});
});
+1 -1
View File
@@ -390,7 +390,7 @@ export class Config {
this.chatCompression = params.chatCompression;
this.interactive = params.interactive ?? false;
this.trustedFolder = params.trustedFolder;
this.useRipgrep = params.useRipgrep ?? false;
this.useRipgrep = params.useRipgrep ?? true;
this.shouldUseNodePtyShell = params.shouldUseNodePtyShell ?? false;
this.skipNextSpeakerCheck = params.skipNextSpeakerCheck ?? true;
this.shellExecutionConfig = {
+4 -2
View File
@@ -45,6 +45,7 @@ vi.mock('../ide/ide-client.js');
async function createMockConfig(
toolRegistryMocks = {},
configParameters: Partial<ConfigParameters> = {},
): Promise<{ config: Config; toolRegistry: ToolRegistry }> {
const configParams: ConfigParameters = {
sessionId: 'test-session',
@@ -52,6 +53,7 @@ async function createMockConfig(
targetDir: '.',
debugMode: false,
cwd: process.cwd(),
...configParameters,
};
const config = new Config(configParams);
await config.initialize();
@@ -767,7 +769,7 @@ describe('subagent.ts', () => {
// Use fake timers to reliably test timeouts
vi.useFakeTimers();
const { config } = await createMockConfig();
const { config } = await createMockConfig({}, { useRipgrep: false });
const runConfig: RunConfig = { max_time_minutes: 5, max_turns: 100 };
// We need to control the resolution of the sendMessageStream promise to advance the timer during execution.
@@ -812,7 +814,7 @@ describe('subagent.ts', () => {
});
it('should terminate with ERROR if the model call throws', async () => {
const { config } = await createMockConfig();
const { config } = await createMockConfig({}, { useRipgrep: false });
mockSendMessageStream.mockRejectedValue(new Error('API Failure'));
const scope = await SubAgentScope.create(