Merge pull request #9 from nandanadileep/fix/issue-8-concurrency-ripgrep

fix: getMaxToolUseConcurrency ReferenceError and ripgrep ENOENT fallback (#8)
This commit is contained in:
Lucas Valbuena
2026-04-30 09:57:12 +02:00
committed by GitHub
Unverified
2 changed files with 9 additions and 1 deletions

View File

@@ -4,10 +4,11 @@ import { findToolByName, type ToolUseContext } from '../../Tool.js'
import type { AssistantMessage, Message } from '../../types/message.js'
import { all } from '../../utils/generators.js'
import { type MessageUpdateLazy, runToolUse } from './toolExecution.js'
export {
import {
DEFAULT_MAX_TOOL_USE_CONCURRENCY,
getMaxToolUseConcurrency,
} from './toolConcurrency.js'
export { DEFAULT_MAX_TOOL_USE_CONCURRENCY, getMaxToolUseConcurrency }
export type MessageUpdate = {
message?: Message

View File

@@ -1,5 +1,6 @@
import type { ChildProcess, ExecFileException } from 'child_process'
import { execFile, spawn } from 'child_process'
import { existsSync } from 'fs'
import memoize from 'lodash-es/memoize.js'
import { homedir } from 'os'
import * as path from 'path'
@@ -61,6 +62,12 @@ const getRipgrepConfig = memoize((): RipgrepConfig => {
? path.resolve(rgRoot, `${process.arch}-win32`, 'rg.exe')
: path.resolve(rgRoot, `${process.arch}-${process.platform}`, 'rg')
// Fall back to system rg when the vendor binary is absent (e.g. npm installs
// that don't ship the vendor/ directory alongside dist/cli.mjs).
if (!existsSync(command)) {
return { mode: 'system', command: 'rg', args: [] }
}
return { mode: 'builtin', command, args: [] }
})