| 370 | |
| 371 | impl fmt::Display for AgentSession { |
| 372 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 373 | write!( |
| 374 | f, |
| 375 | "Session {} ({}, {}, {} turn{}, {})", |
| 376 | self.session_id, |
| 377 | self.agent_display_name, |
| 378 | self.phase, |
| 379 | self.turn_count, |
| 380 | if self.turn_count == 1 { "" } else { "s" }, |
| 381 | self.duration_display(), |
| 382 | )?; |
| 383 | if let Some(ref prompt) = self.first_prompt { |
| 384 | let display = if prompt.len() > 50 { |
| 385 | let truncated: String = prompt.chars().take(47).collect(); |
| 386 | format!("{}...", truncated) |
| 387 | } else { |
| 388 | prompt.clone() |
| 389 | }; |
| 390 | write!(f, " — \"{}\"", display)?; |
| 391 | } |
| 392 | Ok(()) |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | // SessionState trait implementation |