You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rtk rewrite rewrites the left-hand side of a pipeline, even though that segment's stdout is consumed by a program (the next pipe stage), not by the model. This breaks common commands like git log | head and git diff 2>&1 | head:
rtk git diff outputs a --stat summary instead of the patch, so head gets truncated output — and rtk itself panics with failed printing to stdout: Broken pipe (os error 32) when the downstream reader closes the pipe early.
Measured behavior (2025-09-30)
Command
rtk 0.38.0
rtk 0.50.0
git diff | head
rtk git diff | head
rtk git diff | head
git diff 2>&1 | head
rewritten
rtk git diff 2>&1 | head
git log --oneline | head -3
rewritten
rtk git log --oneline | head -3
grep FOO a > b
rtk grep FOO a > b
not rewritten (fixed in 0.50)
git diff | tee x
rewritten
not rewritten (fixed in 0.50)
Version 0.50 already stopped rewriting segments whose stdout is redirected to a file (>) or read by tee — but a regular pipe to head/grep/etc. is still rewritten.
exclude_commands can't express "this command only when piped": the pattern is matched against the segment with redirections and pipes stripped.
Request
Either:
Don't rewrite a segment whose stdout goes into a pipe (same reasoning as the > / tee fixes in 0.50 — the output is consumed by a program, not an LLM), or
Expose a config option to disable rewriting for piped segments.
Optionally, also handle SIGPIPE/broken-pipe gracefully on the consumer side — the failed printing to stdout: Broken pipe panic is noisy regardless.
Activity
rtk-wshm-sync-bot commentedon Sep 30, 2026
🔍 Automated Triage
bughighSummary
rtk rewrite mangles pipeline producer stages (e.g.
git diff | head), causing wrong output and a broken-pipe panic; should skip rewriting when stdout feeds a pipe.📁 Relevant files
src/rewrite.rssrc/pipeline.rsSuggested Actions
>/teeredirect-detection fix from 0.50 to also skip rewriting when stdout feeds a pipe stagegit diff | head,git diff 2>&1 | head, andgit log --oneline | head -3exclude_commandsneeds a 'piped-only' matcher per the reporter's alternative proposalTriaged automatically by wshm · This is an automated analysis, not a human review.
fix(discover): preserve native pipeline producer output on current ma…
fix(discover): preserve native pipe output against current develop (r…