fix(runtime): end Grep options before the pattern in the sandboxed worker - #3734
Open
udsy19 wants to merge 1 commit into
Open
fix(runtime): end Grep options before the pattern in the sandboxed worker#3734udsy19 wants to merge 1 commit into
udsy19 wants to merge 1 commit into
Conversation
…rker
The filesystem worker appended the model-supplied Grep pattern as a bare
positional, so ripgrep parsed a pattern beginning with `-` as flags. An
option-like pattern such as `-webkit-box` exits 1, which this worker
reports as `{ kind: 'grep', matches: [] }` — the model is told the string
is absent from a file that contains it, with no error anywhere.
The host-local sibling already passes `--` first
(packages/runtime/src/workspace-executor.ts). That separator was added by
its argv unchanged, so the two search paths have disagreed since. The
worker is the default path on macOS and Linux for every boundary except
bypass and external.
Signed-off-by: Udaya Tejas <udayatejas2004@gmail.com>
Generated-by: Claude Code
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.
fix(runtime): end Grep options before the pattern in the sandboxed worker
Summary
The filesystem worker appended the model-supplied Grep pattern as a bare
positional, so ripgrep parsed a pattern starting with
-as flags.-webkit-boxexits 1, andpackages/runtime/src/filesystem-worker/operations.ts:425maps exit 1 to
{ kind: 'grep', matches: [] }— the model is told the string isabsent from a file that contains it, silently.
The host-local sibling already passes
--first(
packages/runtime/src/workspace-executor.ts:455). That separator arrived in#2961, which edited this worker's grep case in the same commit but left its argv
unchanged, so the two search paths have disagreed since. This propagates it.
Fixes #3733
Verification
Ran locally on macOS 26.5.1 (25F80), Node v26.7.0, ripgrep 15.1.0:
npm --workspace @maka/runtime run test:dist— 3090 tests, 0 failures(baseline on
mainwas 3089/0; the delta is the new case).operations.tsfromorigin/mainand rebuilt — thenew test fails (
actual [… '--max-count=50', '-webkit-box', …]vs expected['--', '-webkit-box', …]) while the other 20 cases in the file still pass.npm run lint,npm run format:check,npm run typecheck,npm run check:asf-headers— all clean.Not run: Windows and Linux sandbox surfaces.
AI use
Select exactly one:
Tool(s) and scope: Claude Code — located the divergence, drafted the one-line fix
and the regression test. Reviewed, reproduced and verified by me before submitting.
Checklist
Does this PR entail a change in behavior?