Skip to content

fix: propagate signal exit code from the npm bin wrapper#101

Open
Volkov Daniil (codeGaus) wants to merge 1 commit into
synthetic-sciences:mainfrom
codeGaus:fix/wrapper-signal-exit-code
Open

fix: propagate signal exit code from the npm bin wrapper#101
Volkov Daniil (codeGaus) wants to merge 1 commit into
synthetic-sciences:mainfrom
codeGaus:fix/wrapper-signal-exit-code

Conversation

@codeGaus

Copy link
Copy Markdown

What does this PR do?

backend/cli/bin/openscience (the npm launcher) ran the platform binary via spawnSync. When that binary is killed by a signal, result.status is null and result.signal holds the signal name — but the wrapper did typeof result.status === "number" ? result.status : 0, so it exited 0 and reported success for a killed process (e.g. an OOM kill or Ctrl-C). This exits with the conventional 128 + signal number (falling back to 1), so shells, callers and CI observe the failure.

How did you verify your code works?

node --check on the wrapper passes. The change follows the standard shell convention (128 + signum) using os.constants.signals, which is already required in the file. The launcher is a plain executable script with no existing unit coverage (its behavior is process-level), so no unit test was added.

Checklist

  • bun run typecheck — n/a (plain JS launcher, not part of the TS build)
  • bun test — n/a (no coverage for the launcher; signal handling is process-level)
  • node --check passes
  • Linked issue (none found)
  • Screenshots (n/a)

When the real binary is killed by a signal, spawnSync sets result.status
to null and result.signal to the signal name, and the wrapper exited 0 —
reporting success for a killed process. Exit with the conventional
128 + signal number (falling back to 1) so callers and CI see the failure.
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

Volkov Daniil (@codeGaus) is attempting to deploy a commit to the InkVell Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant