Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(ai): save partial response on stream error. (#2069)

Eric Hayesf8cc7ee01863
diff --git a/rust/cloud-storage/document_cognition_service/src/api/stream/chat_message.rs b/rust/cloud-storage/document_cognition_service/src/api/stream/chat_message.rs
index 8a3d6839bc..a3e220d246 100644
--- a/rust/cloud-storage/document_cognition_service/src/api/stream/chat_message.rs
+++ b/rust/cloud-storage/document_cognition_service/src/api/stream/chat_message.rs
@@ -482,7 +482,7 @@ fn stream_and_save_message(
if let Ok(json) = serde_json::to_value(&stream_error) {
yield json;
}
- return;
+ break;
}
}
}
@@ -497,10 +497,7 @@ fn stream_and_save_message(
if let Ok(json) = serde_json::to_value(&end_msg) {
yield json;
}
-
- // Save conversation messages
let new_messages = chat.get_new_conversation_messages();
-
// Extract assistant response text before moving new_messages into store
let assistant_text = new_messages
.iter()