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

Method extract_session_id

atomic-agent/src/hooks/opencode.rs:359–363  ·  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

357
358 /// Extract a session ID from an optional field, generating a fallback if missing.
359 fn extract_session_id(session_id: Option<String>) -> String {
360 session_id
361 .filter(|s| !s.is_empty())
362 .unwrap_or_else(|| format!("opencode-{}", uuid_short()))
363 }
364
365 /// Path to the global OpenCode config directory (`~/.config/opencode/`).
366 ///

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected