Is this issue happening also locally or just in prod on Azure? Are you able to share any code for this app or just the chat message and chat input logic?
The first problem happens intermittently… a message pops up in a white box top center: Connection failed with status 0.
The code is private IP, but here is a slight modified version if it helps troubleshooting:
if "messages" not in st.session_state:
st.session_state.messages = []
for message in st.session_state.messages:
with st.chat_message(message["role"]):
st.markdown(message["content"])
if prompt := st.chat_input("How can I help you?"):
st.session_state.messages.append({"role": "user", "content": prompt})
with st.chat_message("user"):
st.markdown(prompt)
with st.chat_message("assistant"):
message_placeholder = st.empty()
full_response = "response from action" # whatever API
message_placeholder.markdown(full_response)
st.session_state.messages.append({"role": "assistant", "content": full_response})
Thanks Tony for helping out. I can replicate the first issue locally but happens intermittently, just leave a page running overnight (for hours of inactivity) I could see it stuck in “connecting…”