Repository navigation
Read the status line of a console run through StatusReport.Read [patch] - #83
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
ConsoleRunner.DescribeRun called the tool's Status getter bare, so a getter that threw (likely in exactly the environment that sends a tray run to the console fallback) escaped Run and TrayAppBuilder.RunAsync and ended the process with exit 134. It is now read the way --status reads it: the run prints "<name>: error: <message>", keeps running, and stops with its normal exit code. Fixes #79 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW31r4TeF4cogSkLxEi
|
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.



Fixes #79
What was wrong
ConsoleRunner.DescribeRunbuilt the startup line fromapp.Describe(), andDescribe()calls the tool'sStatusgetter with no guard. When the getter threw, the exception leftRunafter thefinallyhad runOnStop. It then leftTrayAppBuilder.RunAsync, so the process died with exit 134. That breaks the 0/1/2 exit-code contract. The tray-to-terminal fallback goes through the same path. That fallback is used when a helper is missing, which is also when a getter is most likely to throw.Change
When the tool has a
Statusgetter,DescribeRunnow reads it throughStatusReport.Read, the same non-fatal guard--statususes (#62/#64). A throwing getter givesdemo: error: <message>, stopping after …. Press Ctrl+C to stop.The run then continues and stops with its normal exit code. Tools without a getter still get<DisplayName> is runningfromDescribe().Tests
Run_WhenTheRunItselfThrows_StillStopsexpected the exception to propagate. As the issue suggests, it is replaced byRun_WhenTheStatusThrows_ReportsItAndStillRunsAndStops. The new test checks four things: exit code 0,OnStopran, theerror: the status brokeline, anddemo: stopped.ConsoleRunnerchange reverted, the new test fails.Generated by Claude Code