Repository navigation
Adopt rtk-ai/rtk#3029: runner - surface failing tool's stderr under stdout-only filters - #17
Merged
Merged
Conversation
`uv run rtk pytest` produced no output at all when pytest was missing from the venv: exit 1, a single newline on stdout, nothing on stderr. A test run that prints nothing and reports no error reads as a quiet pass, leaving the exit code as the only signal. The trigger is uv, but the defect is in the runner. Filters that compress stdout pass RunOptions::stdout_only, which keeps stderr out of the filter input — and run_captured_filter only ever emitted stderr inside its skip_filter_on_failure branch. Callers that pair stdout_only with early_exit_on_failure (ls, tree) hit that branch and print stderr; callers that don't (pytest, ruff, prettier, go test, golangci-lint, phpunit, phpstan, pint, rubocop) captured stderr and dropped it on the floor. Standalone `rtk pytest` looks fine only because python is absent there: the spawn fails outright and the anyhow error prints. Under `uv run` the venv supplies python, so rtk falls back to `python -m pytest`, the spawn succeeds, and the child's "No module named pytest" goes to the stderr that was being discarded. Emit stderr when the child fails. Only on failure: on a successful run stderr is the incidental noise RTK exists to suppress, and filtered stdout already carries the result. Fixes rtk-ai#3026
Amendment to the adopted rtk-ai#3029: .claude/rules/rust-patterns.md requires expect(reason) over bare unwrap() in tests. Mechanical rename of the five bare unwrap() calls in tests/stderr_passthrough_test.rs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6.
Adopts rtk-ai/rtk#3029 (cherry-pick, authorship preserved) plus one fork-authored amendment.
Commits
c27bbd0fix(runner): surface a failing tool's stderr under stdout-only filtering — cherry-pick of upstream328bb53, author georgyia (@georgyia). Callers pairingstdout_onlywithearly_exit_on_failure(ls, tree) already printed stderr on failure; barestdout_onlycallers (pytest, ruff, prettier, go test, golangci-lint, phpunit, phpstan, pint, rubocop) captured it and dropped it. The fix emitsraw_stderrwhen the child fails; success stays suppressed. +tests/stderr_passthrough_test.rs(cfg(unix), shim-based, failing-before).afc5258test: use expect with reason instead of bare unwrap in stderr test — amendment:.claude/rules/rust-patterns.mdrequiresexpect("reason")over bareunwrap()in tests; mechanical rename of the five call sites in the new test file.Adoption checklist
upstream/developis already an ancestor of forkdevelopcargo fmt --allclean,cargo clippy --all-targetszero warnings,cargo test --all2466 passed / 0 failedRepro (real output, this Windows machine)
This machine has python but no pytest — the exact rtk-ai#3026 quadrant, no
uvneeded:rtk pytestfalls back topython -m pytest, the spawn succeeds, and the child's diagnostic goes to the captured-and-dropped stderr.Before (develop @ 1018b8b):
A completely mute failure — reads as a quiet pass.
After (this branch):
Review
Two-axis review (standards + spec) run pre-PR.
FilterMode::CaptureOnlyand bothraw_stderrprint sites, both claimed tests present and asserting what they claim, no scope creep (git diff pr-3029 HEADempty on both files).unwrap()in tests vs rust-patterns.md) fixed by the amendment. Known ceilings, noted not fixed: the new tests are#![cfg(unix)]so Windows CI never runs them (the runner change is platform-neutral and the Windows behavior was verified manually above); emitted stderr is not counted inrtk gaintracking on failure (consistent with the pre-existingskip_filter_on_failurebranch).🤖 Generated with Claude Code