Session Status

SessionStatus

The SessionStatus type represents the current lifecycle state of a ChatSession. Subscribe via session.on('status_changed', ...) or read useChatSession().status.

ValueMeaningCan Send?
idleSession created but not yet started.No
authenticatingAcquiring or refreshing an auth token.No
connectingEstablishing transport connection.No
readyConnected and accepting messages.Yes
submittedUser message sent, awaiting response stream.No
streamingAgent response is actively streaming.No
waiting_for_toolAgent requested a tool call; waiting for result.No
uploadingFile upload in progress.No
handoff_requestedLive-agent handoff was requested.No
handoff_queuedUser is in the handoff queue.No
handoff_connectedConnected to a live agent.Yes
endedSession ended normally.No
expiredSession expired server-side.No
disconnectedTransport connection lost.No
recoveringRecovery policy is attempting reconnection.No
errorUnrecoverable error.No
shutdownClient or session was shut down.No

HandoffStatus

Tracks the live-agent handoff lifecycle within a session. Read via useChatSession().handoffStatus or the AgentTransferPart.status field.

ValueMeaning
noneNo handoff in progress.
requestedHandoff requested by the agent.
queuedWaiting in the agent queue.
connectingConnecting to the live agent.
ringingAgent desktop is being alerted.
connectedLive agent is active.
on_holdLive agent has placed the customer on hold.
endedHandoff leg ended without a resolution signal.
failedHandoff failed.
cancelledHandoff was cancelled.
completedHandoff was successfully resolved.

State Transition Notes

  • The session starts at idle and moves through authenticating and connecting to ready.
  • Sending a message transitions from ready to submitted, then to streaming as the response arrives.
  • If the agent calls a tool, the session enters waiting_for_tool until the result is returned, then resumes streaming.
  • A transport disconnect moves the session to disconnected, then recovering while the recovery policy retries. On success, the session returns to streaming or ready. On failure, it moves to error.
  • ended, expired, error, and shutdown are terminal states. Create a new session to continue.
Source: docs/reference/session-status.md