Silence_timeout and session_timeout do not work - Rasa CALM - Rasa Community Forum

👋 Introducing the Rasa Playground

Silence_timeout and session_timeout do not work

post by fanou on Apr 16, 2025

Hi, I have a problem with my Rasa project which I have not managed to solve and I would appreciate your help very much.

First this link is broken: https://rasa.com/docs/rasa-pro/building-assistants/handling-user-silence/

The problem: I have not managed to make the silence_timeout and session_timeout work.

in my credentials.yml file I have the following:

socketio:
  bot_message_evt: bot_uttered
  session_persistence: true
  user_message_evt: user_uttered

In my config.yml file I have the following:

policies:
  - name: FlowPolicy
    silence_timeout: 45 # Time in seconds
    consecutive_silence_timeouts: 2 # Number of timeouts before ending flow
    silence_reminder_message: “You have been silent for some time, do you need more help?”
    silence_timeout_enabled: true
    session_timeout_message: “You have been silent for too long. I am closing the session.”
  - name: IntentlessPolicy
    session_config:
      session_expiration_time: 2 # in minutes
      carry_over_slots_to_new_session: true

in my default flows.yml file I have the following:

pattern_silence_timeout:
  description: Flow for handling silence timeouts when the user is silent for too long
  name: pattern silence timeout
  nlu_trigger:
    - intent: intent_silence_timeout
  steps:
    - action: utter_silence_reminder
pattern_session_timeout:
  description: Flow for handling session expiration when the user has been silent for too long
  name: pattern session timeout
  nlu_trigger:
    - intent: intent_session_timeout
  steps:
    - action: utter_session_timeout
    - noop: true
  next: END

I am using the Rasa chat widget on the front-end. The app works fine, everything works but if I leave the web-page with the Rasa chat widget open and leave without typing anything in the chat widget (if I am idle), the silence timeout or the session timeout never kick in. Even if I am idle for hours, I never see the messages “You have been silent for some time, do you need more help?” or “You have been silent for too long. I am closing the session.” and if I run the app with the --debug flag I do not see anything happening after the time I set expires.

If a user is idle for a long time I want my Rasa app to close the WebSocket connection/session and release the server resources for that WebSocket. Because if many users are using the app and connections / sessions or server resources are not released the server will be overwhelmed.

What am I doing wrong? Can you help me?

If silence_timeout and session_timeout work only with voice channels then does a Rasa app which works only with a text chat widget ( socket.io WebSockets) release server resources when a user is idle?

Thank you