Skip to content

Report build errors and failures to standard error stream during redirection#33

Closed
google-labs-jules[bot] wants to merge 2 commits intomainfrom
fix-stdout-redirection-errors-10890483434945522317
Closed

Report build errors and failures to standard error stream during redirection#33
google-labs-jules[bot] wants to merge 2 commits intomainfrom
fix-stdout-redirection-errors-10890483434945522317

Conversation

@google-labs-jules
Copy link
Contributor

If the CLI's stdout is redirected to a file (like $GITHUB_STEP_SUMMARY), many important error messages from dotnet commands and the tool's own failure notifications were previously lost from the console.

This PR ensures these messages are written to the standard error stream when redirection is detected, providing immediate visibility into failures while maintaining clean and useful Markdown summaries. It also avoids duplicating output in interactive terminal sessions.


PR created automatically by Jules for task 10890483434945522317 started by @sator-imaging

…tion

Modified ConsoleLogger and the CLI runner to ensure that build errors
and tool failure notifications are written to the standard error stream
when standard output is redirected (e.g., to $GITHUB_STEP_SUMMARY).

Key changes:
- Refactored ConsoleLogger to support flexible routing to any TextWriter.
- LogFailed now mirrors output to Console.Error if output is redirected.
- CLI runner now captures all stdout from dotnet commands.
- Detected errors in stdout are mirrored to Console.Error immediately if
  redirection is active.
- On command failure with suppressed stdout (like restore), the full
  captured log is dumped to stderr and the markdown summary.
- Prevented ANSI escape codes from leaking into markdown summaries while
  preserving them for console stderr output.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

…tion (CLI only)

Modified the CLI runner to ensure that build errors and tool failure
notifications are written to the standard error stream when standard
output is redirected (e.g., to $GITHUB_STEP_SUMMARY).

Key changes:
- Introduced a local LogFailed helper in cli/Program.cs to mirror
  failure notifications to Console.Error when redirection is active.
- Improved RunDotnetAsync to capture all stdout from dotnet commands.
- Detected errors in stdout are mirrored to Console.Error immediately
  if redirection is active or stdout logging is suppressed.
- On command failure with suppressed stdout (like restore), the full
  captured log is dumped to stderr and the markdown summary.
- Fixed ANSI escape codes leaking into markdown summaries while
  preserving them for console stderr output.
- All changes are contained within the CLI package.
@sator-imaging sator-imaging deleted the fix-stdout-redirection-errors-10890483434945522317 branch March 25, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant