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

Method extract_session_id

atomic-agent/src/hooks/pi.rs:298–302  ·  view source on GitHub ↗

Extract a session ID from an optional field, generating a fallback if missing.

(session_id: Option<String>)

Source from the content-addressed store, hash-verified

296
297 /// Extract a session ID from an optional field, generating a fallback if missing.
298 fn extract_session_id(session_id: Option<String>) -> String {
299 session_id
300 .filter(|s| !s.is_empty())
301 .unwrap_or_else(|| format!("pi-{}", uuid_short()))
302 }
303}
304
305impl Default for PiHook {

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected