Repository navigation
docs(openclaw): compound commands are rewritten per segment, not skipped - #4903
Conversation
The "What's NOT rewritten" list said piped and chained commands (|, &&, ;) are left alone. rtk rewrite splits them and rewrites each segment; only intermediate pipeline stages and |& pipelines stay raw. Closes rtk-ai#4900
📊 Automated PR Analysis
SummaryFixes an inaccurate bullet in openclaw/README.md that claimed piped/compound commands ( Review Checklist
Linked issues: #4900 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
The plugin adds no guards of its own; what gets rewritten and what stays raw are decided by rtk rewrite. Merge the two sections into one that links the command list and the rewrite rules, instead of keeping a copy of the rules here, which went out of date when the pipeline rules changed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Round 1 of 3 — APPROVED (after fixup)
Claim: openclaw/README.md stops listing |, &&, ; commands as never rewritten, and lists what rtk rewrite really leaves raw.
Scope: accept (round 1, frozen); maintainer PRs: checked against #5038 (KuSh), which touches the same line; it will be rebased after this one lands.
Ran: rtk rewrite on a develop build, 34 commands by hand plus 99 by a separate check (compounds, producers with and without a filter, cat/head/tail including follow forms, grep/rg flags, middle stages, redirects, |&); every claim in the section checked against the output and against "Compound splitting" in src/discover/README.md.
Pins: 0 decisions (docs only).
Matrix: executed this round; pin check: n/a (no code).
CI @decdc3a0: all green
Blocks merge (0)
Optional — will not hold merge
The new paragraph said rtk rewrite rewrites every | segment, which is not what develop does: git log | grep fix → git log | rtk grep fix (producer stays raw), and git log | wc -l, git log | less, docker ps | head are not rewritten at all. Since the plugin has no guards of its own, I pushed a fixup that merges the two sections into one: a link to the command list and a link to "How command rewriting works" in src/discover/README.md, so this README cannot drift from the rewrite rules again.
Checked and correct — no need to re-verify
- Removing "Piped commands (
|,&&,;)":git status && cargo test→rtk git status && rtk cargo test;||and;likewise. - Commands already using
rtk, heredocs, and commands without a filter are left as they are.
Next
Fixup decdc3a pushed: one section linking the command list and the rewrite rules instead of listing them. CI green on it — approving.
Rounds: 1/3. Threads: 0 open.
Summary
openclaw/README.mdlisted "Piped commands (|,&&,;)" under "What's NOT rewritten". The plugin hands the whole command tortk rewrite, which splits compound commands and rewrites each segment, so that bullet was wrong.|&pipelines), added a one-line example, and linked the "Compound splitting" section ofsrc/discover/README.md. The link is absolute because this README ships in the npm package.Closes #4900
Test plan
Docs-only change, no code touched, so I did not run
cargo test.src/discover/registry.rs:test_rewrite_pipe_then_and(git log | head -5 && git stash→rtk git log | head -5 && rtk git stash) and thegit status && cargo test | grep FAILcase, where the middlecargo teststage stays raw.src/discover/README.md.