MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / title_from_messages

Function title_from_messages

src/sessions/shared.rs:445–450  ·  view source on GitHub ↗

Build a session title from the first user message, if any.

(messages: &[SessionMessageRecord])

Source from the content-addressed store, hash-verified

443
444/// Build a session title from the first user message, if any.
445pub(crate) fn title_from_messages(messages: &[SessionMessageRecord]) -> Option<String> {
446 messages
447 .iter()
448 .find(|message| message.role == "user")
449 .map(|message| preview_title(&title_text_from_stored_content(&message.text)))
450}
451
452#[cfg(test)]
453mod tests {

Callers 7

parse_newMethod · 0.85
merge_with_existingFunction · 0.85
parse_newMethod · 0.85
parse_newMethod · 0.85
parse_newMethod · 0.85
parse_newMethod · 0.85
parse_cursor_jsonlFunction · 0.85

Calls 2

preview_titleFunction · 0.85

Tested by

no test coverage detected