| 398 | |
| 399 | impl fmt::Display for AgentSession { |
| 400 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 401 | write!( |
| 402 | f, |
| 403 | "Session {} ({}, {}, {} turn{}, {})", |
| 404 | self.session_id, |
| 405 | self.agent_display_name, |
| 406 | self.phase, |
| 407 | self.turn_count, |
| 408 | if self.turn_count == 1 { "" } else { "s" }, |
| 409 | self.duration_display(), |
| 410 | )?; |
| 411 | if let Some(ref prompt) = self.first_prompt { |
| 412 | let display = if prompt.len() > 50 { |
| 413 | let truncated: String = prompt.chars().take(47).collect(); |
| 414 | format!("{}...", truncated) |
| 415 | } else { |
| 416 | prompt.clone() |
| 417 | }; |
| 418 | write!(f, " — \"{}\"", display)?; |
| 419 | } |
| 420 | Ok(()) |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | // SessionState trait implementation |