You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: defer canaid.api.local import until first chat turn
Streamlit Cloud's launcher polls /api/v2/app/status every ~300ms while
waiting for the script to finish its first run. Our pre-import of
canaid.api.local at module load triggered the full chain
(boto3 + langchain + langgraph + faiss + langfuse) which appears to
exceed the launcher's startup budget on the Cloud container — leaving
the page blank with no runtime logs and no error banner.
Fix: move the import behind `@st.cache_resource`-cached helper
`_lazy_import_run_chat()`. The first page render is now lightweight
(stdlib + Streamlit only). The first chat click pays the import cost
once with a visible spinner ("Loading chat backend (one-time)…");
subsequent reruns use the cached module.
Errors during the lazy import are returned as a traceback string and
surface in the chat bubble's existing error path.
0 commit comments