mirror of
https://github.com/jeffusion/gitea-ai-assistant.git
synced 2026-03-27 10:05:50 +00:00
fix(agent): fix rg args ordering in function reference search tool
The --type-add and --type options were placed after the path argument, causing ripgrep to treat them as additional paths rather than flags. Moved option flags before the -e pattern and path arguments. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -80,12 +80,8 @@ export function createFunctionReferenceSearchTool(sandbox: SandboxExec): Tool {
|
||||
const pattern = task.patterns.join('|');
|
||||
const args = [
|
||||
'--json',
|
||||
// 移除 --ignore-case,保持大小写敏感(大多数语言都是case-sensitive)
|
||||
'--max-count',
|
||||
String(max_results || 30),
|
||||
'-e',
|
||||
pattern,
|
||||
context.workspacePath,
|
||||
];
|
||||
|
||||
if (file_types && file_types.length > 0) {
|
||||
@@ -93,6 +89,9 @@ export function createFunctionReferenceSearchTool(sandbox: SandboxExec): Tool {
|
||||
args.push('--type', 'custom');
|
||||
}
|
||||
|
||||
// -e pattern 和路径必须在所有选项之后
|
||||
args.push('-e', pattern, context.workspacePath);
|
||||
|
||||
try {
|
||||
const result = await sandbox.run('rg', args, {
|
||||
cwd: context.workspacePath,
|
||||
|
||||
Reference in New Issue
Block a user