Skip to main content

new_session_id

Function new_session_id 

Source
pub fn new_session_id() -> String
Expand description

Generates a session ID as a random UUID v4.

The defect-acp session/new handler needs a SessionId (to construct an AcpFsBackend) before calling AgentCore::create_session; this function is public so that both acp and tests can produce IDs in a consistent format.

Using a globally unique UUID instead of an in-process counter plus timestamp avoids collisions across process restarts and concurrent instances, and allows downstream consumers (storage on-disk directories, observability trace correlation) to use it as a stable primary key.