| 655 | |
| 656 | impl fmt::Display for AgentSession { |
| 657 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 658 | write!( |
| 659 | f, |
| 660 | "Session {} ({}, {}, {} turn{}, {})", |
| 661 | self.session_id, |
| 662 | self.agent_display_name, |
| 663 | self.phase, |
| 664 | self.turn_count, |
| 665 | if self.turn_count == 1 { "" } else { "s" }, |
| 666 | self.duration_display(), |
| 667 | )?; |
| 668 | if let Some(ref prompt) = self.first_prompt { |
| 669 | let display = if prompt.len() > 50 { |
| 670 | let truncated: String = prompt.chars().take(47).collect(); |
| 671 | format!("{}...", truncated) |
| 672 | } else { |
| 673 | prompt.clone() |
| 674 | }; |
| 675 | write!(f, " — \"{}\"", display)?; |
| 676 | } |
| 677 | Ok(()) |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | // SessionState trait implementation |