Repository navigation
Description
Environment
- rtk version: 0.42.4 (
rtk --version→rtk 0.42.4) - OS: macOS (Darwin, arm64)
- Invocation:
rtk proxy <cmd>— documented as "Execute raw command without filtering (for debugging)"
Summary
rtk proxy rg returns search results where the literal (lowercase) substring
cypress has been replaced with n throughout the output — not filtered
out, not truncated, silently rewritten. This happened even though
rtk proxy is documented to run the raw command "without filtering." The
corruption is invisible unless you already know the file content and notice
it looks wrong.
Steps to reproduce
- In a repo containing
.github/workflows/lint_and_test.yamlwith lines like:image: cypress/browsers:node-22.21.0-chrome-... - run: pnpm exec cypress install - name: run cypress components tests uses: cypress-io/github-action@... - name: upload cypress videos name: cypress-videos path: tests/e2e/cypress/videos
- Run:
rtk proxy rg -rn "cypress" .github/workflows - Compare against the file's real content (e.g. via
cator any tool that bypasses rtk).
Expected
Output matches the real file content byte-for-byte (that's the whole point
of proxy mode): cypress, cypress-io, cypress/browsers, cypress.config.js
etc. appear as they are on disk.
Actual
Every case-sensitive, lowercase occurrence of cypress is replaced with n,
including inside compound identifiers:
.github/workflows/lint_and_test.yaml: n:
.github/workflows/lint_and_test.yaml: image: n/browsers:node-22.21.0-chrome-...
.github/workflows/lint_and_test.yaml: - run: pnpm exec n install
.github/workflows/lint_and_test.yaml: - name: run n components tests
.github/workflows/lint_and_test.yaml: uses: n-io/github-action@...
.github/workflows/lint_and_test.yaml: - name: run n
.github/workflows/lint_and_test.yaml: - name: upload n videos
.github/workflows/lint_and_test.yaml: name: n-videos
.github/workflows/lint_and_test.yaml: path: tests/e2e/n/videos
.github/workflows/cypress_tests.yaml:name: n tests prod
.github/workflows/cypress_tests.yaml: uses: n-io/github-action@...
.github/workflows/cypress_tests.yaml: # https://docs.n.io/guides/cloud/projects#Set-up-a-project-to-record
.github/workflows/cypress_tests.yaml: # No baseUrl override: n.config.js derives it from WEB_BASE_URL...
.github/workflows/cypress_tests.yaml: subject: "n tests result (see https://cloud.n.io/projects/5y5tn5 for details):"
A direct read of the same file (bypassing rtk entirely) confirms the real
text: cypress/browsers, cypress install, cypress components tests,
cypress-io/github-action, cypress-videos, docs.cypress.io,
cypress.config.js, cloud.cypress.io, etc. Capitalized instances
("~/.cache/Cypress", "Cypress") were not corrupted, which suggests
this is a literal case-sensitive find/replace of the string cypress → n
somewhere in rtk's output path, not a filename-shortening or path-aliasing
feature working as intended.
Impact
This is silent data corruption of tool output, not a formatting or
token-savings tradeoff. It's indistinguishable from a real answer unless the
caller happens to cross-check against the source file. In an agentic
workflow, this can lead to wrong conclusions being drawn from search
results, wrong code being written or suggested based on "what the file
says," and it undermines trust in every other rtk-mediated read once
found.
Related (secondary) observation
Separately, letting rtk auto-rewrite a plain rg invocation (not via
proxy) into a grep call broke outright on flags rg supports but grep
doesn't (-g '!pattern', --type), e.g.:
grep: invalid option -- g
grep: unrecognized option `--type'
That's a correctness bug too (silently changing which flags a command
"supports" mid-invocation), but it at least fails loudly. The cypress → n
corruption above is the more serious issue because it fails silently and
returns a plausible-looking wrong answer instead of erroring.
Suggested fix
At minimum, rtk proxy should guarantee byte-identical passthrough of the
underlying command's stdout/stderr — that's its stated purpose. If there's
some intentional dictionary-based output compression for token savings, it
must not be applied under proxy, and even outside proxy it needs to be
reversible/lossless for the caller, not a silent lossy substitution.
Activity
desty commentedon Oct 16, 2026
I think this comes from ripgrep rather than rtk. In
rg,-ris--replaceand takes a value, so-rnparses as-r n, i.e. "replace every match withn". This is different fromgrep -rn, where it means recursive plus line numbers.The same thing reproduces with plain ripgrep (14.1.1), no rtk involved:
This also explains the other details in the report:
nwas consumed as the replacement and-nwas never applied.cypresschanged, because the search is case-sensitive.rtk bypass/rtk proxystreams the child output byte for byte (Commands::Bypassinsrc/lib.rs), and rtk's search code already treats-ras taking a replacement value forrg(see theextract_pattern_pathtests insrc/cmds/system/search.rs).rg -n "cypress"gives the intended output, since ripgrep searches recursively by default.The secondary observation about a rewritten
rgcall losing-g/--typelooks like a separate issue.KuSh commentedon Oct 31, 2026
Closing, as this is ripgrep's behaviour, as explained above: in
rg,-ris--replaceand takes a value, so-rn "cypress"replaces every match withn. Plain ripgrep does the same (rg -rn cypress wf.yamlprintsimage: n/browsers), andrtk proxypasses the output through unchanged.rg -n "cypress"gives line numbers, and ripgrep searches recursively by default.