This commit is contained in:
Timothy Jaeryang Baek
2026-07-23 03:39:30 -04:00
parent af629177f4
commit e18e249d5d
+4 -4
View File
@@ -686,12 +686,12 @@ async def _kb_grep(
# Grep on piped input
if piped_input is not None:
lines = piped_input.split('\\n')
lines = piped_input.split('\n')
matched = []
for i, line in enumerate(lines, 1):
if _matches(line):
matched.append(f'{i}: {line}')
return '\\n'.join(matched) if matched else f'No matches for "{pattern}"'
return '\n'.join(matched) if matched else f'No matches for "{pattern}"'
# Single file grep
if file_ref and not dir_scope:
@@ -702,7 +702,7 @@ async def _kb_grep(
elif 'error' in resolved:
return resolved['error']
else:
lines = resolved['content'].split('\\n')
lines = resolved['content'].split('\n')
matched = []
for i, line in enumerate(lines, 1):
if _matches(line):
@@ -715,7 +715,7 @@ async def _kb_grep(
if not matched:
return f'No matches for "{pattern}" in {resolved["filename"]}'
return '\\n'.join(matched)
return '\n'.join(matched)
# Cross-file grep (optionally scoped to directory)
accessible = await _get_accessible_files(user, model_knowledge)