Show human-readable descriptions in /resume session list

- Add description field to SessionContinuation struct
- Extract first user message (truncated to ~60 chars at word boundary)
- Display as quoted text instead of session ID hash
- Fall back to session ID if no description available

Example: [2 hours ago] 'when I call /resume it only shows me 2 sessions...'
This commit is contained in:
Dhanji R. Prasanna
2026-01-11 06:22:20 +08:00
parent 3fcef587e8
commit 33c1aba86e
3 changed files with 42 additions and 7 deletions

View File

@@ -1852,16 +1852,18 @@ async fn run_interactive<W: UiWriter>(
};
let todo_marker = if session.has_incomplete_todos() { " 📝" } else { "" };
// Truncate session ID for display
let display_id = if session.session_id.len() > 40 {
format!("{}...", &session.session_id[..40])
} else {
session.session_id.clone()
// Use description if available, otherwise fall back to session ID
let display_name = match &session.description {
Some(desc) => format!("'{}'", desc),
None => if session.session_id.len() > 40 {
format!("{}...", &session.session_id[..40])
} else {
session.session_id.clone()
}
};
output.print(&format!(
" {}. [{}] {} ({}){}{}",
i + 1, time_str, display_id, context_str, todo_marker, current_marker
i + 1, time_str, display_name, context_str, todo_marker, current_marker
));
}
output.print("");