ripGrep.ts records a failed grep search as a successful tool call
Maintainers usually reply within 1 day
@Neal006 is already working on this.
Since Oct 16, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 90/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start in packages/core/src/tools/ripGrep.ts:348-355 and compare its outer catch with packages/core/src/tools/grep.ts:323-334. Then inspect ripGrep.test.ts and the assertion at grep.test.ts:352. Done means failed ripgrep searches expose GREP_EXECUTION_ERROR through ToolResult.error and a regression test verifies that behavior.
Written by the indexing model from the issue text.
Description
ripGrep.ts and grep.ts have byte-identical error handling for a failed search. One of them marks the failure; the other does not.
// packages/core/src/tools/grep.ts:323-334
} catch (error) {
debugLogger.warn(`Error during GrepLogic execution: ${error}`);
const errorMessage = getErrorMessage(error);
return {
llmContent: `Error during grep search operation: ${errorMessage}`,
returnDisplay: `Error: ${errorMessage}`,
error: {
message: errorMessage,
type: ToolErrorType.GREP_EXECUTION_ERROR,
},
};
}
// packages/core/src/tools/ripGrep.ts:348-355 — same block, no `error`
} catch (error) {
debugLogger.warn(`Error during GrepLogic execution: ${error}`);
const errorMessage = getErrorMessage(error);
return {
llmContent: `Error during grep search operation: ${errorMessage}`,
returnDisplay: `Error: ${errorMessage}`,
};
}
Why that matters. ToolResult.error is documented as "If this property is present, the tool call is considered a failure" (tools.ts:770-772), and that is exactly how it is consumed — tool-executor.ts:150 branches on toolResult.error === undefined into createSuccessResult (status: CoreToolCallStatus.Success, no error type) versus createErrorResult.
RipGrepTool is the one registered by default whenever ripgrep is available (config.ts:4028); GrepTool is only the fallback, logged as RipgrepFallbackEvent. So the unmarked path is the common one.
The most reachable way into it is a search timeout: ripGrep.ts:294 throws Operation timed out after <n>ms from inside the same outer try, and that lands in the catch above. The model is told the search failed, and the harness records the call as a success with no error type — so there is no error badge, and any accounting keyed on tool-call status counts it as a pass.
Evidence that this is an oversight, not a choice. #5688 ("fix: properly report tool errors in telemetry", merged 2025-08-08) did exactly this sweep — "Update tools to use error property in ToolResult for failures" — across read-file.ts, write-file.ts and shell.ts, and its own summary is that "tool failures were incorrectly reported as successes when tools returned errors gracefully instead of throwing exceptions". ripGrep.ts was not in that change, and grep.ts carries the field, so one of the two grep tools was converted and the other was missed.
grep.test.ts:352 pins the intended behaviour for the sibling (expect(result.error?.type).toBe(ToolErrorType.GREP_EXECUTION_ERROR)), while ripGrep.test.ts has no assertion on .error at all. ToolErrorType.GREP_EXECUTION_ERROR is used twice in grep.ts and nowhere in ripGrep.ts — and ripGrep.ts is internally inconsistent too: its inner catch at :198-201 does set error: { type: PATH_NOT_IN_WORKSPACE }.
Proposed change. Add the same error field to the ripGrep.ts catch, plus a regression test mirroring grep.test.ts:352.
I have not run this against a live ripgrep timeout — I do not have the toolchain set up to do so, and the claim above is read off the source, not observed at runtime. If you would rather it went through an issue-design discussion first, I am happy to open the PR as a draft.
Related
mcp-tool.ts:650-652 has a similar shape — a hand-rolled [Error: Could not parse tool response] string with no error field — but that one is an explicit marker for a protocol violation rather than a swallowed exception, so I have left it out of this report. It may be worth a maintainer's opinion in the same discussion.
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 90
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google-gemini/gemini-cli
-
bug(cli): theme file home-directory check uses startsWith (sibling dirs pass, Windows casing fails)Openarea/core kind/bug priority/p2 status/bot-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
google-gemini/gemini-cli#29955 · 2 comments ·
Maintainers usually reply within 1 day
-
test(cli): remove redundant lowercase restart test in AdminSettingsChangedDialogPossibly taken @gitseraj claimed this today. Openarea/platform status/need-triage
Difficulty 1/5 Under an hour Newbie friendliness 83/100
google-gemini/gemini-cli#29936 · 1 comment ·
Maintainers usually reply within 1 day
-
area/non-interactive effort/small status/bot-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google-gemini/gemini-cli#29930 · 1 comment ·
Maintainers usually reply within 1 day
-
web_fetch keeps a trailing comma on URLs in a comma-separated listPossibly taken @tneemo claimed this 2 days ago. Openarea/agent status/need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
google-gemini/gemini-cli#29896 · 2 comments ·
Maintainers usually reply within 1 day
-
'metricReader' deprecation warning printed on every run with telemetry onPossibly taken @OmPrakash0310 claimed this 2 days ago. Openarea/enterprise status/need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
google-gemini/gemini-cli#29894 · 2 comments ·
Maintainers usually reply within 1 day
All issues in google-gemini/gemini-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Merit-Systems/x402scan#1312 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Native Web
Difficulty 1/5 Under an hour Newbie friendliness 80/100
digitalfabrik/integreat-app#4517 ·
Maintainers usually reply within 2 days
-
TLS guide repeats certs/ in the certificate directoryPossibly taken @maheshrijal claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
prometheus/docs#3156 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
medusajs/dtc-starter#90 ·
Maintainers usually reply within 1 day