| 368 | |
| 369 | impl std::fmt::Display for SessionEnvelope { |
| 370 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 371 | write!( |
| 372 | f, |
| 373 | "Turn {} of session {} ({}, {})", |
| 374 | self.turn_number, |
| 375 | self.session_id, |
| 376 | self.agent_name, |
| 377 | self.duration_display(), |
| 378 | )?; |
| 379 | if let Some(ref prompt) = self.prompt_summary { |
| 380 | let display = if prompt.len() > 60 { |
| 381 | let truncated: String = prompt.chars().take(57).collect(); |
| 382 | format!("{}...", truncated) |
| 383 | } else { |
| 384 | prompt.clone() |
| 385 | }; |
| 386 | write!(f, " — \"{}\"", display)?; |
| 387 | } |
| 388 | Ok(()) |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | // SessionEnvelopeBuilder |