Skip to content

Return exit code 1 when --wait detects a failed run#373

Merged
robinaugh merged 1 commit intomainfrom
jr/exit-code-on-failed-wait
Feb 20, 2026
Merged

Return exit code 1 when --wait detects a failed run#373
robinaugh merged 1 commit intomainfrom
jr/exit-code-on-failed-wait

Conversation

@robinaugh
Copy link
Contributor

Summary

  • rwx run --wait and rwx results --wait now return exit code 1 when the run result status is not succeeded
  • Previously both commands exited 0 regardless of run outcome, only returning non-zero if the API call itself failed
  • Uses HandledError so output is still printed cleanly without a redundant error message

Test plan

  • Added require.True(t, result.Completed) assertion to existing failure polling test
  • Added new "polls until run completes with success" test case
  • All unit tests pass (go test ./internal/cli/... ./cmd/...)

Previously, `rwx run --wait` and `rwx results --wait` would exit 0
even when the run result status was "failed". Now both commands return
a non-zero exit code when the completed run did not succeed.
@robinaugh robinaugh self-assigned this Feb 20, 2026
@robinaugh robinaugh marked this pull request as ready for review February 20, 2026 15:37
@robinaugh robinaugh merged commit d97eb12 into main Feb 20, 2026
1 check passed
@robinaugh robinaugh deleted the jr/exit-code-on-failed-wait branch February 20, 2026 17:17
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.

2 participants