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>)
| 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 | |
| 382 | impl Default for CursorHook { |