Skip to content

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

Merged
Aayam Bansal (aayambansal) merged 2 commits into
synthetic-sciences:mainfrom
codeGaus:fix/wrapper-signal-exit-code
Jul 8, 2026
Merged

fix: propagate signal exit code from the npm bin wrapper#101
Aayam Bansal (aayambansal) merged 2 commits into
synthetic-sciences:mainfrom
codeGaus:fix/wrapper-signal-exit-code

Conversation

@codeGaus

Copy link
Copy Markdown
Contributor

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.

@aayambansal
Aayam Bansal (aayambansal) merged commit 0060b2d into synthetic-sciences:main Jul 8, 2026
10 of 11 checks passed
@aayambansal

Copy link
Copy Markdown
Member

Thanks for catching this. We re-landed the same fix as a first-party commit in #158 (exit 128+signal on a signal-kill instead of masking it as 0). Appreciate the report.

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