Restore phase when loading from history (#12244)

This commit is contained in:
Jack Mousseau
2026-02-19 09:56:56 -08:00
committed by GitHub
parent f2d5842ed1
commit 3a951f8096
15 changed files with 144 additions and 9 deletions

View File

@@ -190,13 +190,12 @@ impl AgentMessageItem {
}
pub fn as_legacy_events(&self) -> Vec<EventMsg> {
// Legacy events only preserve visible assistant text; `phase` has no
// representation in the v1 event stream.
self.content
.iter()
.map(|c| match c {
AgentMessageContent::Text { text } => EventMsg::AgentMessage(AgentMessageEvent {
message: text.clone(),
phase: self.phase.clone(),
}),
})
.collect()