fix: v0.5.4 — defer process.exit until postSuggestions async chain resolves#14
Merged
Conversation
🌱 GreenOps Infrastructure Impact
Resource Breakdown
Recommendations
|
omrdev1
added a commit
that referenced
this pull request
May 19, 2026
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.
Summary
Fixes a race condition where
process.exit(policyExitCode)was called synchronously at the bottom ofcli.tsbefore the asyncpostSuggestionsHTTP chain to the GitHub API had resolved.Impact: On any build with
--post-suggestionsenabled and a policy violation (fail_on_violation: true), the process would exit code 1 before suggestion comments were posted to the PR. The build would fail with no inline remediation visible to the developer.Fix:
process.exitis now deferred into the.finally()block of thepostSuggestionsPromise chain, ensuring the GitHub API calls complete before the process terminates — regardless of whether suggestions succeeded, failed, or timed out.Type of change
Checklist
npm testpasses (86/86)npx tsc --noEmitpasses (zero type errors)npm run buildproduces clean dist--post-suggestionsis not used