Skip to content

fix(runtime): separate dash-prefixed Grep patterns with -- in sandbox worker - #3735

Open
yunaremaia wants to merge 2 commits into
apache:mainfrom
yunaremaia:fix/grep-dash-pattern-separator
Open

fix(runtime): separate dash-prefixed Grep patterns with -- in sandbox worker#3735
yunaremaia wants to merge 2 commits into
apache:mainfrom
yunaremaia:fix/grep-dash-pattern-separator

Conversation

@yunaremaia

Copy link
Copy Markdown
Contributor

Summary

  • The sandboxed filesystem worker appended the Grep pattern as a bare positional, so ripgrep parsed a dash-prefixed pattern as flags. A leading flag exits 1, and this worker maps exit 1 to an empty match set - so the model was told a present string was absent, with no error.
  • Adds the -- argv separator the host-local workspace executor already pins (workspace-executor.ts, from feat(windows): add brokered AppContainer sandbox support #2961), plus a regression test asserting the separator position and a successful -webkit-box search.

Test plan

  • New regression test fails without the fix (asserts -- precedes the pattern in the spawned argv) and passes with it
  • Reproduced against real ripgrep 15.1.0: rg -n --no-heading --max-count=5 -webkit-box style.css exits 1; with -- it matches
  • Full runtime suite locally: 3059/3068 pass; the 2 failures are pre-existing root-user permission tests (chmod-restricted files are readable by root, CI runs non-root) - untouched by this diff

Fixes #3733

… worker

The filesystem worker appended the pattern as a bare positional, so a
pattern starting with '-' was parsed by ripgrep as flags. A leading flag
exits 1, which maps to an empty match set - reporting strings that exist
as absent, with no diagnostic.

Adds the same '--' separator the host-local workspace executor already
pins (apache#2961), plus a regression test asserting the separator and a
successful dash-prefixed search.

Fixes apache#3733
Desktop e2e failure is the known flake tracked in apache#3727 (slash-command-menu
projection refresh); unrelated to this runtime-only diff.
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(runtime): Grep reports "no matches" for any pattern starting with -

1 participant