fix(opencode): preserve grep symlink paths#38581
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
There was a problem hiding this comment.
The path reconstruction is scoped correctly: ripgrep still runs against the canonical cwd, while displayed matches are rebased onto the user-requested directory (or its parent for file inputs). The regression assertions cover both sides of the symlink-path invariant. No blocking issues found.
Co-authored-by: Zach Bruggeman <zbruggeman@ramp.com>
Issue for this PR
Closes #38582
Type of change
What does this PR do?
Grep canonicalized symlinked search paths and returned the real target path in its output. Subsequent tool calls could then fail external-directory permission checks configured for the original symlink path.
This keeps the canonical path for running ripgrep, but formats results relative to the path requested by the user.
How did you verify your code works?
Added regression coverage for searching through a directory symlink and verified that results contain the symlink path rather than the real path.
Ran
bun test test/tool/grep.test.tsand verified withbun devon a local build that the grep tool did indeed return the resolved path instead of real path.Screenshots / recordings
N/A
Checklist