Repository navigation
fix(strata): fail fast when the bundled Python lacks jinja2.sandbox - #218
Merged
Merged
Conversation
The Windows standalone app shipped a Python whose jinja2 package had no sandbox module, so `edge0-infer serve` crashed at startup with a bare ModuleNotFoundError from serve/frontend.py. Every guard that verifies the server's packages only checked the top-level `jinja2` module, so the partial install passed all of them. Check the exact submodule serve imports instead: strata.py's preflight, setup.py's bundle check and pip stamp check now verify `jinja2.sandbox`, and the frontend import raises a clear error naming the missing module and the remedy (reinstall the app, or pip install -r requirements.txt). Fixes Edge0-AI#217
shuk777
approved these changes
Nov 17, 2026
shuk777
left a comment
Collaborator
There was a problem hiding this comment.
Thanks — LGTM. Merging.
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.
What & why
The Windows standalone app shipped a Python whose jinja2 package had no sandbox module, so
edge0-infer servecrashed at startup with a bare ModuleNotFoundError from serve/frontend.py. Every guard that verifies the server packages only checked the top-leveljinja2module, so the partial install passed all of them.This checks the exact submodule serve imports instead: the strata.py preflight, setup.py bundle check and pip stamp check now verify
jinja2.sandbox, and the frontend import raises a clear error naming the missing module and the remedy (reinstall the app, or pip install -r requirements.txt). The sandbox itself is unchanged, templates still render sandboxed.Fixes #217
Area
How was it tested?
Linux, Python 3.12, no GPU. Reproduced the report first with a stub jinja2 (package present, sandbox module absent): the old code failed with the bare ModuleNotFoundError. After the fix the import raises the clear error,
strata.py serveexits 5 naming jinja2.sandbox, and the bundle check lists it. New regression tests in serve/test_server_packages.py: 3/3 pass, and they fail 3/3 on the unfixed code. Neighbour suite serve/test_frontend.py: 26 passed, no regression. Full unit tests need macOS Apple Silicon, so CI is the gate for those.Checklist
ctest --preset cpu -L "L0|L1"passes locally inedge0-infer/(engine changes)edge0-infer/docs/testing.md)