Repository navigation
fix(tsc): guard "No errors found" behind exit code - #3295
NekomyaDev wants to merge 1 commit into
Conversation
…out parseable errors Closes rtk-ai#3220
|
Two notes for whoever reviews this, from an external audit of v0.44.2 ( Provenance: AI-assisted source audit, human-directed. Source and There are currently three PRs for this one bug
They are not conflicting approaches so much as the same change at two levels of detail, which may be why both are sitting. For what it is worth from the outside, appending the raw tail is the part that matters most to the actual consumer here — an agent that sees only The pattern this restores already exists in the tree, one directory over
if self.error_count == 0 && self.warnings == 0 && exit_code == 0That guard was added in The same shape recurs beyond No objection to this PR — posting only so the duplicate-PR situation and the |
|
Does this PR solve the bug, or is still a work-in-progress? |
|
Thanks for this. Develop already guards the summary on the exit code: #2232 (merged 2026-08-29) reworked TscHandler::format_summary so a non-zero exit with no parseable diagnostics reports "compiler exited with code N, but RTK parsed no diagnostics" and prints the raw output instead of "No errors found", and it closed the same issue #3220. It also strips ANSI from the dumped lines and keeps both ends of long output rather than only the tail, and carries regression tests for the non-zero-exit and clean-exit paths. Closing as covered, but please comment or reopen if you see a case that still slips through. |
Closes #3220. (Re-targeted to
developper CONTRIBUTING.md — supersedes #3294.)Problem
TscHandler::format_summaryignored the process exit code: whenever zero parseableTS####errors were captured, it returnedTypeScript: No errors found— even whentscexited non-zero without emitting parseable diagnostics (e.g. missingtsconfig.json, invalid compiler flags, fatal config errors like TS5058). The filter could therefore report success on a failed run.Fix
format_summarynow guards onexit_code:exit_code == 0+ no parseable errors → unchanged:TypeScript: No errors foundexit_code != 0+ no parseable errors → reportsTypeScript: failed (exit code N) with no parseable TS errorsand appends the last 10 non-empty lines of raw output so the fatal diagnostic (which the streaming filter otherwise drops) stays visibleTests
Two new regression tests:
test_tsc_stream_failure_without_parseable_errors— non-zero exit with only a fatal TS5058 line must not contain "No errors found", must surface exit code and the fatal linetest_tsc_stream_success_still_reports_no_errors— zero exit with empty output still reports "No errors found"All existing tsc streaming/filter tests are unaffected (the success path is unchanged).