Merge branch 'main' into adil/agent_format

This commit is contained in:
Adil Hafeez 2025-09-30 11:39:34 -07:00
commit 2cebc0c85f
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
33 changed files with 1369 additions and 421 deletions

View file

@ -135,8 +135,9 @@ pub async fn chat(
});
const MAX_MESSAGE_LENGTH: usize = 50;
let latest_message_for_log = if latest_message_for_log.len() > MAX_MESSAGE_LENGTH {
format!("{}...", &latest_message_for_log[..MAX_MESSAGE_LENGTH])
let latest_message_for_log = if latest_message_for_log.chars().count() > MAX_MESSAGE_LENGTH {
let truncated: String = latest_message_for_log.chars().take(MAX_MESSAGE_LENGTH).collect();
format!("{}...", truncated)
} else {
latest_message_for_log
};