plan being saved effectively now

This commit is contained in:
dal 2025-03-05 10:39:18 -07:00
parent 4fab757f2d
commit 6ec195be52
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
1 changed files with 13 additions and 9 deletions

View File

@ -1164,18 +1164,22 @@ fn transform_assistant_tool_message(
if !delta.is_empty() {
text.message_chunk = Some(delta);
text.message = None; // Clear message field while streaming
} else {
// If there's no new content, don't send a message
} else if text.status != Some("completed".to_string()) {
// If there's no new content and it's not complete, don't send a message
return None;
}
if text.status == Some("completed".to_string()) {
println!("CHUNK DEBUG [{}] Completing message", text.id);
text.message = tracker.get_complete_text(text.id.clone());
text.message_chunk = None;
tracker.clear_chunk(text.id.clone());
}
}
if text.status == Some("completed".to_string()) {
println!("CHUNK DEBUG [{}] Completing message", text.id);
// For completed messages, either use accumulated text or the final message
text.message = tracker.get_complete_text(text.id.clone())
.or(text.message)
.or(text.message_chunk.clone());
text.message_chunk = None;
tracker.clear_chunk(text.id.clone());
}
Some(BusterReasoningMessage::Text(text))
}
BusterReasoningMessage::File(mut file) => {