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 dotnet build (also test, restore) puts the success/failure status line at the top of the output. Native dotnet puts it at the bottom. Anything that reads the end of the stream loses the verdict: | tail -N, watch/monitor mode in agents, IDE log tails, chunked-output readers.
Repro
rtk dotnet build 2>&1| tail -5
Expected: the last 5 lines include ok dotnet build: 0 errors, 0 warnings (…).
Actual: the last 5 lines are warnings or empty; the status line is gone.
In all three cases the agent only sees the last N lines or the tail of the stream. Native dotnet writes Build succeeded. or Build FAILED. last, so the agent gets a clear verdict. RTK writes the verdict first, then errors and warnings, so the agent sees error noise followed by EOF, with no ok or fail line anywhere near the end.
Result: the agent cannot tell whether the build passed, even though the information was technically there 200 lines ago. This silently breaks any agent loop that gates the next step on build success.
Why this happens (code)
src/cmds/dotnet/dotnet_cmd.rs::format_build_output (and the test/restore equivalents) emit the status line first, then errors, then warnings.
Option 2 alone fixes the agent watch/monitor case described above. Option 1 alone fixes the explicit-pipe case but not streaming consumers that read RTK's stdout directly.
TL;DR
rtk dotnet build(alsotest,restore) puts the success/failure status line at the top of the output. Nativedotnetputs it at the bottom. Anything that reads the end of the stream loses the verdict:| tail -N, watch/monitor mode in agents, IDE log tails, chunked-output readers.Repro
Expected: the last 5 lines include
ok dotnet build: 0 errors, 0 warnings (…).Actual: the last 5 lines are warnings or empty; the status line is gone.
Why agents in particular get hurt
Agents (Claude Code, Codex, Copilot CLI, etc.) commonly read build output through:
| tail -Nto keep token usage low/watch,/monitor,tail -f, log followers)In all three cases the agent only sees the last N lines or the tail of the stream. Native
dotnetwritesBuild succeeded.orBuild FAILED.last, so the agent gets a clear verdict. RTK writes the verdict first, then errors and warnings, so the agent sees error noise followed by EOF, with nookorfailline anywhere near the end.Result: the agent cannot tell whether the build passed, even though the information was technically there 200 lines ago. This silently breaks any agent loop that gates the next step on build success.
Why this happens (code)
src/cmds/dotnet/dotnet_cmd.rs::format_build_output(and the test/restore equivalents) emit the status line first, then errors, then warnings.Two things compound the problem:
dotnet build 2>&1 | tail -5becomesrtk dotnet build … | tail -5, sotailoperates on the filtered stream, not rawdotnetoutput. Tracked in bug(rewrite): hook rewrites left-hand side of piped commands, breaking downstream filters #1560.dotnet_cmd.rslines 216–228), pushing the verdict even further from the tail. PR fix(dotnet): stop prepending raw stdout on build failure (#914) #1115 (issue dotnet build can be more noisy with rtk #914) drops the prepend on failure but does not move the summary line.Suggested fixes
Two options, not mutually exclusive:
tail,head,wc,grep, or any explicit "read-the-end" consumer. A pipe into| tail -Nis an explicit user signal for raw, unreordered output.format_{build,test,restore}_output, matching nativedotnet. Cheap, unblocks streaming consumers and tail/head pipes today, even before bug(rewrite): hook rewrites left-hand side of piped commands, breaking downstream filters #1560 lands.Option 2 alone fixes the agent watch/monitor case described above. Option 1 alone fixes the explicit-pipe case but not streaming consumers that read RTK's stdout directly.
Related
Environment
src/cmds/dotnet/dotnet_cmd.rs:986(format_build_outputbuilds the header first)master(commit 4113696)