Skip to content

fix(stream): route to respective fd - #1579

Merged
aeppling merged 3 commits into
developfrom
fix/stream-stderr-routing
Apr 29, 2026
Merged

aeppling merged 3 commits into
developfrom
fix/stream-stderr-routing

Conversation

@aeppling

Copy link
Copy Markdown
Contributor

Summary

  • Fix fd routing in streaming path: filtered output now goes to the same fd as the source line (stderr→stderr, stdout→stdout) instead of all going to stdout
  • Affects cargo build, cargo test, cargo check, cargo fmt, tsc : all commands using FilterMode::Streaming
  • flush() and on_exit() also route to the correct fd via filter_fd_is_stderr tracking

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • Manual testing: rtk cargo build 1>/tmp/out 2>/tmp/err → stdout=0B, stderr has filtered warnings
  • Manual testing: rtk cargo check 1>/tmp/out 2>/tmp/err → stdout=0B, stderr has filtered warnings
  • Manual testing: rtk cargo test 1>/tmp/out 2>/tmp/err → summary on stdout, stderr=0B (noise filtered)
  • Exit code propagation: rtk cargo build; echo $? → 0

@pszymkowiak pszymkowiak added bug Something isn't working effort-small Quelques heures, 1 fichier filter-quality Filter produces incorrect/truncated signal labels Apr 28, 2026
@pszymkowiak

Copy link
Copy Markdown
Collaborator

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟡 Risk medium

Summary

Fixes file descriptor routing in the streaming filter path so that filtered output is written to the same fd as its source (stderr lines to stderr, stdout lines to stdout) instead of everything going to stdout. Also updates flush() and on_exit() to route to the correct fd using a tracking variable. The test is renamed and updated to verify correct fd routing.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

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

@KuSh KuSh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀️

@aeppling
aeppling merged commit 605e335 into develop Apr 29, 2026
11 checks passed
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
@aeppling
aeppling deleted the fix/stream-stderr-routing branch June 30, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working effort-small Quelques heures, 1 fichier filter-quality Filter produces incorrect/truncated signal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants