-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Handle unhandled errors by exiting with non-zero code #9275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
1 similar comment
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
|
|
✅ Review Complete Code Review SummaryTroubleshooting
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 2 files
- Add 23 tests for gracefulExit and updateAgentMetadata functions - Add 10 unit tests for error tracking and exit code transformation - Test exit code coercion (0 -> 1 when errors occur) - Test preservation of non-zero exit codes - Test telemetry/sentry flushing with error handling - Test metadata collection and API reporting - Add comprehensive test documentation Co-authored-by: peter-parker <e2e@continue.dev> Generated with Continue (https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev>
🔧 Fixed CI Build FailuresI identified and resolved a circular dependency issue that was causing all the test failures. ProblemThe original PR created a circular import between
This circular dependency caused esbuild to generate invalid JavaScript with SolutionCreated a new
This maintains the same functionality while allowing esbuild to properly bundle the code. TestingThe fix should resolve all 12 failing test jobs across different OS/Node combinations. The changes are minimal and only affect module organization, not the actual error handling logic. |
Co-authored-by: peter-parker <e2e@continue.dev> Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev>
- Add 23 tests for gracefulExit and updateAgentMetadata functions - Add 10 unit tests for error tracking and exit code transformation - Test exit code coercion (0 -> 1 when errors occur) - Test preservation of non-zero exit codes - Test telemetry/sentry flushing with error handling - Test metadata collection and API reporting - Add comprehensive test documentation Co-authored-by: peter-parker <e2e@continue.dev> Generated with Continue (https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev>
- Document exit code behavior (0 for success, 1 for failure) - Add error handling section to CLI overview with CI/CD examples - Add CLI troubleshooting section with debugging guidance - Include examples for git hooks, GitHub Actions, and shell scripts - Explain error logging and telemetry flushing behavior Related to PR #9275 which implements proper error handling Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev> Co-authored-by: nate <nate@continue.dev>
✅ CI Failures Successfully Fixed!The circular dependency fix has resolved all the test failures. Test ResultsAll 12 CLI test jobs that were failing are now passing:
Sample passing test: Root Cause ConfirmedThe issue was indeed a circular import:
This caused esbuild to generate invalid JavaScript with Solution AppliedCreated All three modules now have clean, one-way dependencies. The error handling functionality remains identical to the original PR intent. |
0788183 to
635aa42
Compare
✅ All CI Checks Fixed and Passing!Final StatusAll CLI-related checks are now passing: Lint Check
All 12 Test Jobs
Aggregate Check
What Was FixedThe author (Nate) fixed the circular dependency issue by creating NoteThere is one unrelated failure in The PR is ready for merge from a CI perspective! 🚀 |
✅ Clarification: All CLI Checks Are PassingThe failures mentioned in the latest request (run 20468305485) were from an older run. Current Status (Run 20468425980)All CLI-related checks are PASSING:
Unrelated FailuresThere are failures in:
These are outside the scope of this CLI PR and do not affect the CLI functionality being added in this PR. All CLI checks that were initially failing have been successfully fixed! ✅ |
|
🎉 This PR is included in version 1.38.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.37.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |

Summary by cubic
Ensure the CLI exits with a non-zero code when any unhandled error occurs, while still flushing logs and telemetry. We track unhandled rejections/exceptions and coerce gracefulExit(0) to exit with code 1.
Written for commit 635aa42. Summary will update automatically on new commits.