Skip to content

fix(execution): give Python SystemExit Linux exit codes - #2069

Merged
eersnington merged 1 commit into
mainfrom
fix/python-exit-codes
Oct 21, 2026
Merged

eersnington merged 1 commit into
mainfrom
fix/python-exit-codes

Conversation

@eersnington

Copy link
Copy Markdown
Member

Python main programs exited 1 with a Pyodide JavaScript stack trace in every case, including sys.exit(0).

python3 -c … main This PR (and CPython)
raise SystemExit(7) 1 + JS stack 7
import sys; sys.exit(0) 1 + JS stack 0
sys.exit("msg") 1 + JS stack 1, msg on stderr
uncaught ValueError 1 + Pyodide/JS frames 1, Python traceback only
  • One runner helper now runs every main program (-c, file, stdin, -m, REPL, pip, retained contexts) and maps SystemExit the way CPython does. Other exceptions print through sys.excepthook without runner or Pyodide frames.
  • vm.python.* calls get the same exit statuses. python.mdx documents them.

The Python runner ran every main program through pyodide.runPythonAsync. SystemExit escaped Pyodide's event loop as an uncaught JS error, so sys.exit(n) always exited 1, and every uncaught exception printed a Pyodide JS stack trace.

Run main programs (-c, files, stdin, -m, REPL, pip, and retained contexts) through one Python helper that maps SystemExit to its CPython exit status and prints uncaught exceptions through sys.excepthook with the runner and Pyodide frames removed.
@railway-app

railway-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

This PR was not deployed automatically as @eersnington does not have access to the Railway project.

In order to get automatic PR deploys, please add @eersnington to your workspace on Railway.

@github-actions

Copy link
Copy Markdown
Contributor

📟 Pip-Boy · e97ddc5

📦 Packages

Skipped: this PR doesn't change any published package.

🧹 Rust dependencies · cargo deny + cargo shear

check new in this PR fixed existing on base
advisories ✅ 0 0 25
licenses ✅ 0 0 0
sources ✅ 0 0 0
bans ✅ 0 0 0
unused ✅ 0 0 16

🦀 Binaries · publish Dockerfiles, --release

Base: main@8cc8f8b, the merge base.

artifact npm @latest base this PR Δ vs base
agentos-native-sidecar linux-x64-gnu 143.6 MB 143.6 MB 143.6 MB −128 B (−0.0%)

⏱ Timing

job wall time slowest step
changes 29s checkout · 24s
zizmor 8s checkout · 2s
hygiene 57s checkout · 25s
native · linux-x64-gnu 13m27s Build with the publish Dockerfile · 12m44s
⏭ footprint — skipped
⏭ self-test — skipped
report 22s setup-node · 6s
🔭 Full CI trace for this commit

One OpenTelemetry trace of CI and Pip-Boy for e97ddc5: every job and step, with the sizes above attached. Run after CI finishes.

pnpm install --frozen-lockfile --filter 'pipboy...'
pnpm --filter pipboy pipboy trace --sha e97ddc58b1fbfad3f8f337e81f217f4f15f807f9

Add --otlp <url> to send it to any OTLP/HTTP collector.

Agent instruction: From a rivet-dev/agentos checkout, run the commands above, then read the trace file the last command prints. List the slowest jobs and steps and explain where CI time went.

@eersnington
eersnington merged commit 9413c84 into main Oct 21, 2026
16 checks passed
@eersnington
eersnington deleted the fix/python-exit-codes branch October 21, 2026 15:04
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