Repository navigation
fix(tool): keep the generic text in a search failure - #767
Merged
Ishaan Gangwani (ishaan1124) merged 1 commit intoSep 28, 2026
Conversation
ANIRUDDHA ADAK (aniruddhaadak80)
requested review from
Aayam Bansal (aayambansal) and
Ishaan Gangwani (ishaan1124)
as code owners
September 27, 2026 21:02
|
ANIRUDDHA ADAK (@aniruddhaadak80) is attempting to deploy a commit to the InkVell Team on Vercel. A member of the Team first needs to authorize it. |
`??` only falls through on null and undefined, so the empty stderr that `--no-messages` produces for exactly the failures this branch explains skipped the fallback and left the message as "Search failed:" with no reason.
Ishaan Gangwani (ishaan1124)
force-pushed
the
fix/grep-empty-failure-message
branch
from
September 28, 2026 05:12
1bb1e58 to
fee0ba8
Compare
Ishaan Gangwani (ishaan1124)
merged commit Sep 28, 2026
a331b5f
into
synthetic-sciences:main
1 check failed
3 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do, and why?
A search that fails on an unreadable path reports nothing usable:
The message is built with a nullish coalescing chain:
??only falls through onnullandundefined.detailis""wheneverstderr is empty, and
"" ?? xis"", notx— so the generic text at the endof the chain is unreachable, and the message ends up empty.
This is precisely the case the fallback was written for. The tool passes
--no-messages, and the branch's own comment already says why:So in the one branch that exists to explain an unreadable path, stderr is empty
by design and the model cannot tell a broken symlink or an unreadable subtree
from a real failure.
The fix builds the message in one place, with
||for the empty-string case:missingstill wins, so a path that is not there names itself, and a realripgrep message still passes through — both unchanged.
Linked issue
Fixes #766
How did you verify it?
One test per branch of the message, added to
backend/cli/test/tool/grep.test.ts:names a missing path instead of the generic textpasses ripgrep's own stderr through when it said somethingstill says something when --no-messages left stderr empty— this is the onethat fails on
3e94875c, where the same inputs produceSearch failed:withan empty reason.
The two branches that already worked are pinned by the existing suite and still
pass, which is the point:
a path that is not there says so, rather than blaming what could not be searchedandinvalid regex is a search failure, not an empty successboth exercise the real tool.Commands run:
bun test --timeout 30000 ./test/tool/grep.test.ts→ 16 pass, 0 fail, 1 skip(the skip is the pre-existing
does not follow a nested symlink outside the authorized search root, which needs a symlink this Windows checkout cannotcreate —
EPERM)bun run --cwd backend/cli typecheck→ exit 0Being straight about the evidence for the third test: I could not drive the
empty-stderr case through the real tool here, because the documented trigger is
a broken symlink and this checkout refuses to create symlinks (
EPERM, noDeveloper Mode). The defect itself is not in doubt —
"" ?? "" ?? "x"evaluatesto
""— and the--no-messagesflag plus the branch's own comment establishthat empty stderr is the expected input there. I extracted the message
construction so all three branches are testable on any platform, and asked in
the issue whether you would rather that case went through the tool instead.
Checklist
bun run checkis green (format, typecheck, backend + frontend/ui + SDK tests) — blocked on this Windows checkout by the CRLF and symlink artifacts described in my other pull requests; backend typecheck is clean and the full grep suite is greenbun run --cwd frontend/workspace buildsucceeds if I touchedfrontend/workspaceorfrontend/ui— not touched./tooling/repo/generate.tswas run and thetooling/sdkoutput committed if I changedbackend/cli/src/server— not touchedfrontend/docs/src/content/openscience/is updated if behavior changed — no doc change needed: this only makes an existing error message non-emptypackage.jsonversions and tags are written by the release workflow)installandfrontend/landing/public/installare still byte-identical if I touched either — not touched