Skip to content

fix: add --no-messages and tolerate exit code 2 in glob/grep tools#3727

Open
aaronkyriesenbach wants to merge 1 commit into
code-yeongyu:devfrom
aaronkyriesenbach:fix/glob-broken-symlinks
Open

fix: add --no-messages and tolerate exit code 2 in glob/grep tools#3727
aaronkyriesenbach wants to merge 1 commit into
code-yeongyu:devfrom
aaronkyriesenbach:fix/glob-broken-symlinks

Conversation

@aaronkyriesenbach
Copy link
Copy Markdown

@aaronkyriesenbach aaronkyriesenbach commented Apr 29, 2026

Summary

  • Fix glob and grep tools failing when broken/dangling symlinks exist in the search path
  • Ripgrep exit code 2 (partial I/O errors) was treated as fatal, discarding valid stdout results

Changes

  • src/tools/glob/constants.ts: Add --no-messages to RG_FILES_FLAGS to suppress non-fatal I/O warnings
  • src/tools/glob/cli.ts: Change exit code check from > 1 to > 2 so broken symlinks don't discard valid results
  • src/tools/grep/constants.ts: Add --no-messages to RG_SAFETY_FLAGS (same fix)
  • src/tools/grep/cli.ts: Change exit code check from > 1 to > 2 (same fix)
  • src/tools/glob/cli.test.ts: Add test verifying --no-messages is included in ripgrep args

Testing

bun run typecheck
bun test src/tools/glob/cli.test.ts

All 19 glob CLI tests pass, typecheck clean.

Related Issues

Closes #3726


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Summary by cubic

Fix glob and grep to handle broken/dangling symlinks without dropping valid results by adding --no-messages to ripgrep flags and treating exit code 2 as non‑fatal. Closes #3726.

Written for commit 7056fc1. Summary will update on new commits. Review in cubic

Broken/dangling symlinks cause ripgrep to exit with code 2 and write
warnings to stderr. The glob and grep tools treated exit code 2 as
fatal, discarding valid stdout results.

Two changes per tool:
- Add --no-messages to suppress non-fatal I/O warnings from stderr
- Change exit code check from >1 to >2 so partial I/O errors
  (broken symlinks) don't discard valid results

Closes code-yeongyu#3726
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@aaronkyriesenbach
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Apr 29, 2026
VoidChecksum added a commit to VoidChecksum/oh-my-openagent that referenced this pull request Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Glob tool fails with broken symlinks — missing --no-messages and incorrect exit code handling

1 participant