MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / extract_session_id

Method extract_session_id

atomic-agent/src/hooks/cursor.rs:374–379  ·  view source on GitHub ↗

Extract a session ID from conversation_id and session_id fields. Prefers `conversation_id` (stable across turns), falls back to `session_id`, then generates a fallback `cursor-{uuid_short()}`.

(conversation_id: Option<String>, session_id: Option<String>)

Source from the content-addressed store, hash-verified

372 /// Prefers `conversation_id` (stable across turns), falls back to
373 /// `session_id`, then generates a fallback `cursor-{uuid_short()}`.
374 fn extract_session_id(conversation_id: Option<String>, session_id: Option<String>) -> String {
375 conversation_id
376 .filter(|s| !s.is_empty())
377 .or_else(|| session_id.filter(|s| !s.is_empty()))
378 .unwrap_or_else(|| format!("cursor-{}", uuid_short()))
379 }
380}
381
382impl Default for CursorHook {

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected