Repository navigation
fix(agentos): make Python packages import and install - #2028
Open
eersnington wants to merge 5 commits into
Open
eersnington wants to merge 5 commits into
eersnington wants to merge 5 commits into
Conversation
|
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. |
eersnington
marked this pull request as ready for review
October 12, 2026 01:39
eersnington
force-pushed
the
fix/python-packages
branch
from
October 12, 2026 01:42
b26a342 to
33fe901
Compare
This branch has not been deployed
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.
Fixes #2027.
Python packages did not work on a fresh VM. Bundled pandas did not import,
python.install(["pandas"])ran out of CPU time, and Pyodide packages such as Pillow failed to load whilepipreported success.import pandason a fresh VMModuleNotFoundError2.3.3, no networkpython.install(["pandas"])python.install(["pillow"])Failed to load Pillow, thenSuccessfully installed pillow, exit 0import PILworks in later executionspyodide-lock.jsonEIO: ... does not match the sha256 pinned in pyodide-lock.json,pipexits 1ERROR: Failed to load Pyodide packages: pillow, exit 1sys.meta_pathfinder inpython-runner.mjsunpacks a bundled wheel and its bundled dependencies the first time the guest imports it. It uses only public Pyodide APIs:pyodide.lockfile,pyodide.unpackArchive(bytes, "whl", { extractDir }), andpyodide.loadedPackages. The unusedAGENTOS_PYTHON_PRELOAD_PACKAGESknob is removed: only tests set it, which hid the bug.fs.readFileSync.crates/execution/src/python.rshandlesfs.readFileRangeSync, the ranged read the guestfspolyfill uses.micropip) into that cache, so bundled packages andpipbootstrap need no network. The sidecar also rejects any write into the cache whose sha256 does not matchpyodide-lock.json, so a downloaded wheel is verified before Pyodide installs it.loadPackage()logs a failed package and resolves anyway. The micropip compatloadPackagenow rejects, andpipexits 1.pip installdoes not copy bundled packages into the VM filesystem. They are importable in every process already.packageBaseUrltoloadPyodide()only whenAGENTOS_PYODIDE_PACKAGE_BASE_URLis set. Downloads go through the VM network policy.lookupdoes onelstatof the requested name instead of re-listing the parent directory, andwritesends only the written range at its offset.Python VFS bridge, release sidecar, median of 5 runs:
python.install(["openpyxl"])end to end, PyPI download includedos.stat/ read 4 MiB