Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 4, 2025

Process was terminating silently without indicating exit code, making post-mortem debugging difficult in CI/CD environments.

Changes

  • Exit code logging: Added console.error() before all process.exit() calls to write exit code to stderr

    • SIGINT handler (exit 130)
    • SIGTERM handler (exit 143)
    • Normal workflow completion (exit code from command)
    • Error handler (exit 1)
  • Tests: Added integration tests verifying exit code appears in stderr for both successful and failed commands

Example

After changes, stderr output includes:

Process exiting with code: 42

This applies to all exit paths including signal termination, enabling log-based debugging of process lifecycle.

Original prompt

This section details on the original issue you should resolve

<issue_title>Write the process exit code to the stderr</issue_title>
<issue_description>If the process is killed, it dies silently. Write error code to stderr.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Write process exit code to stderr on kill feat: write exit code to stderr on process termination Dec 4, 2025
Copilot AI requested a review from Mossaka December 4, 2025 02:20
Copilot finished work on behalf of Mossaka December 4, 2025 02:20
@Mossaka Mossaka marked this pull request as ready for review December 4, 2025 18:03
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Test Coverage Report

Metric Coverage Covered/Total
Lines 66.95% 695/1038
Statements 67.1% 716/1067
Functions 70.24% 85/121
Branches 62.46% 228/365
Coverage Thresholds

The project has the following coverage thresholds configured:

  • Lines: 38%
  • Statements: 38%
  • Functions: 35%
  • Branches: 30%

Coverage report generated by `npm run test:coverage`

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.

Write the process exit code to the stderr

2 participants