Merge pull request #30 from Molecule-AI/fix/publish-template-smoke-pythonpath

fix(publish-template-image): inject PYTHONPATH=/app for boot smoke
This commit is contained in:
Hongming Wang 2026-04-30 21:54:18 -07:00 committed by GitHub
commit 86092315a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -308,10 +308,21 @@ jobs:
# time but the smoke times out before any real call goes out.
# Set the common ones so any adapter that early-validates a
# specific key sees a non-empty value.
# PYTHONPATH=/app mirrors what the platform's provisioner
# injects at workspace startup (workspace-server/internal/
# provisioner/provisioner.go:563). Without it,
# `importlib.import_module('adapter')` in the runtime's
# preflight check fails with ModuleNotFoundError because
# molecule-runtime is a console_scripts entry point —
# sys.path[0] is /usr/local/bin, NOT /app. The existing
# static import smoke step above doesn't hit this because
# `python3 -c "import $mod"` adds cwd to sys.path; only the
# entry-point invocation needs PYTHONPATH.
set +e
timeout 60 docker run --rm \
-v "${SMOKE_CONFIG_DIR}:/configs" \
-e WORKSPACE_ID=fake-smoke \
-e PYTHONPATH=/app \
-e MOLECULE_SMOKE_MODE=1 \
-e MOLECULE_SMOKE_TIMEOUT_SECS=10 \
-e CLAUDE_CODE_OAUTH_TOKEN=sk-fake-smoke-token \