Repository navigation
fix(execution): give Python SystemExit Linux exit codes - #2069
Merged
Merged
Conversation
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.
|
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. |
Contributor
📟 Pip-Boy ·
|
| 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 e97ddc58b1fbfad3f8f337e81f217f4f15f807f9Add --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.
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.
Python main programs exited 1 with a Pyodide JavaScript stack trace in every case, including
sys.exit(0).python3 -c …mainraise SystemExit(7)import sys; sys.exit(0)sys.exit("msg")msgon stderrValueError-c, file, stdin,-m, REPL,pip, retained contexts) and mapsSystemExitthe way CPython does. Other exceptions print throughsys.excepthookwithout runner or Pyodide frames.vm.python.*calls get the same exit statuses.python.mdxdocuments them.