The esp32_worker.py subprocess is launched via `python <abs_path>` and runs with a sys.path that does NOT include the backend/ package root, so `from app.services.signal_router import SignalRouter` raised ModuleNotFoundError at worker startup. The worker exited with code 1 before QEMU even loaded, and the frontend surfaced the generic "ESP32 crash detected — cache error" banner. Mirror the existing esp32_flash_image fallback pattern (already in this same file): try the package import first, fall back to importlib.spec_from_file_location with the sibling .py path, then publish the resulting module under its bare name in sys.modules so typing references continue to work. Verified: a synthetic test that strips backend/ from sys.path can still construct a SignalRouter via the fallback. 20 unit tests in test_signal_router.py still pass. |
||
|---|---|---|
| .. | ||
| app | ||
| scripts | ||
| sdk | ||
| tests | ||
| .env.example | ||
| Dockerfile | ||
| debug_qemu.py | ||
| mcp_server.py | ||
| mcp_sse_server.py | ||
| requirements.txt | ||