The agent itself ended the call.
Expressive (V4) agents.
The session ended because nothing happened for too long.
The window is sessionTimeout for Talks (V2) and Clips (V3).
The session ended because it reached the message limit configured for the agent.
Expressive (V4) agents.
The session ended because the connection to the browser broke down.
The session ended normally, because it was closed deliberately.
The session ended because it reached its maximum duration.
Expressive (V4) agents.
The session ended because of a failure the server could not classify.
Why the server ended the session.
Arrives as the
reasonargument of onConnectionStateChange together with 'disconnected', and is how you tell a session the server closed on purpose from a connection that simply dropped —reasonis an opaque transport diagnostic in the latter case, so compare it against these values rather than parsing it. A close reason the SDK does not recognize is forwarded as-is, which is the other reason to compare against the enum. Which members can arrive depends on the agent type: Talks (V2) and Clips (V3) agents report only Ok, UnknownError, NetworkIssue and Inactivity. reconnect() still works afterwards; it starts a new stream rather than resuming the ended one.Example: Reacting to the limits an Expressive (V4) session reports