Callback Failures & Automatic Client Restart After Late Reconnection

If a client is disconnected for longer than disconnectedSessionTTL and then reconnects, callbacks fail, causing multiple problems. See example below.

A reconnecting client should be able to detect whether its session is still extant. Please can we have a config option such that a client detecting no session can automatically start over – as did 1.37.1 on every reconnection.

Without knowing that client and server are in sync, llm chat is ‘challenging’.

set disconnectedSessionTTL in config.toml to e.g. 5 secs.

import streamlit as st

st.title(“Example”)

def process_input():
“”“Saves the user’s input to the session state.”“”
st.session_state.user_last_message = st.session_state.input_widget

if “user_last_message” in st.session_state:
st.write(f"You entered: {st.session_state.user_last_message}")

st.chat_input(
“Enter some text and press Enter”,
key=“input_widget”,
on_submit=process_input
)