Parse and expose stream errors (#2540)

This commit is contained in:
easong-openai
2025-08-21 01:15:24 -07:00
committed by GitHub
parent d2b2a6d13a
commit 8ad56be06e
7 changed files with 61 additions and 2 deletions

View File

@@ -751,6 +751,12 @@ pub(crate) fn new_error_event(message: String) -> PlainHistoryCell {
PlainHistoryCell { lines }
}
pub(crate) fn new_stream_error_event(message: String) -> PlainHistoryCell {
let lines: Vec<Line<'static>> =
vec![vec!["".magenta().bold(), message.dim()].into(), "".into()];
PlainHistoryCell { lines }
}
/// Render a userfriendly plan update styled like a checkbox todo list.
pub(crate) fn new_plan_update(update: UpdatePlanArgs) -> PlainHistoryCell {
let UpdatePlanArgs { explanation, plan } = update;