The comment block above the openai dep claimed it was "imported at module
top" — that was true on origin/main but our fix in 00e801209 moved the
import to a lazy-import inside _generate_a2ui to localize a missing-dep
failure to the demo path that needs it. The comment was therefore
falsified by the diff: a future cleanup reading the comment would assume
removing the lazy-import is safe, which would re-introduce the import-time
crash this fix was shipped to prevent.
Update the comment to describe the actual two-layer protection: lazy
import in the source as the runtime safety net, requirements.txt as the
authoritative dep declaration so containers ship with it installed.
Surfaced by cr-loop Round 1 (slots 4 + 5 independently flagged the
contradiction). Bucket (b) trivial — orchestrator-applied per cr-loop
discretion.
Root cause: src/agents/a2ui_dynamic.py imported `openai` at module top
level, but openai was not in requirements.txt. The agent_server.py imports
a2ui_dynamic at top level too, so on container startup the entire FastAPI
module failed to load with ModuleNotFoundError. entrypoint.sh's startup
gate ("Agent failed to start - exiting") then bailed before Next.js
launched, taking the whole container down. Railway's restart loop made
every /demos/<id> route unreachable, which is exactly the symptom the
D2 e2e-readiness probe reports as red across all 9 features in this
framework column.
Two-part fix:
- Add openai>=1.50.0 to requirements.txt so the dep is actually
installed in the agent-builder stage.
- Move the `import openai` to a lazy import inside _generate_a2ui
(mirroring the same pattern in agents/agent.py:339), so a future
requirements regression localizes the failure to the one
declarative-gen-ui demo instead of nuking the whole backend on
module load.
The showcase framework directories better reflect their role as
integration examples rather than distributable packages.
Renames showcase/packages/ -> showcase/integrations/ and updates
the test docker-compose file reference accordingly.