Skip to content

fix: preserve native output in pipelines - #4382

Open
lindicaphxag-tech wants to merge 3 commits into
rtk-ai:developfrom
lindicaphxag-tech:fix/preserve-piped-command-output
Open

lindicaphxag-tech wants to merge 3 commits into
rtk-ai:developfrom
lindicaphxag-tech:fix/preserve-piped-command-output

Conversation

@lindicaphxag-tech

Copy link
Copy Markdown

Summary

  • Preserve native stdout for every pipeline producer so downstream commands receive the output format they expect.
  • Keep safe rewriting of final grep and rg stages.
  • Remove the producer-stage safety metadata and update the discover documentation and hook regression coverage.

Fixes #4364.

Validation

  • cargo +stable fmt --all -- --check
  • cargo +stable test discover::registry::tests:: (456 passed)
  • cargo +stable test test_claude_pipeline_preserves_producer_output_for_consumer (passed)
  • Full cargo +stable test: 3772 passed, 8 ignored, 13 failed because this Windows environment cannot spawn the Unix shell commands required by existing core::shell / core::stream tests.

@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟡 Risk medium

Summary

This PR changes the pipeline rewrite engine so that producer and intermediate stages of a shell pipeline are always left raw (native stdout), only rewriting a final grep/rg stage when safe. It removes the previously added producer-stage rewriting logic and its associated safety-check helpers, and updates the discover README and regression tests accordingly.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #4364


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@lindicaphxag-tech

Copy link
Copy Markdown
Author

Validation on current head 5c0d5ea: cargo fmt --all -- --check passes; the changed areas pass cargo test --bin rtk discover:: --quiet (627 tests) and cargo test --bin rtk hooks::hook_cmd --quiet (142 tests). A full Windows run passed 3,784 tests with one unrelated ind exit-code assertion differing because C:\Windows\System32\find.exe is selected instead of POSIX find; the changed suites are green. Could a maintainer review whether leaving pipeline producer/intermediate output native is the right boundary for #4364? I can adjust if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pipe producer is rewritten (git log | head, git diff 2>&1 | head)

1 participant