fix: use minute-level granularity for MOIM timestamps (#6294)
Signed-off-by: Sihyeon Jang <sihyeon.jang@navercorp.com>
This commit is contained in:
@@ -1277,7 +1277,8 @@ impl ExtensionManager {
|
||||
}
|
||||
|
||||
pub async fn collect_moim(&self) -> Option<String> {
|
||||
let timestamp = chrono::Local::now().format("%Y-%m-%d %H:%M:%S").to_string();
|
||||
// Use minute-level granularity to prevent conversation changes every second
|
||||
let timestamp = chrono::Local::now().format("%Y-%m-%d %H:%M:00").to_string();
|
||||
let mut content = format!("<info-msg>\nIt is currently {}\n", timestamp);
|
||||
|
||||
let platform_clients: Vec<(String, McpClientBox)> = {
|
||||
@@ -1784,4 +1785,17 @@ mod tests {
|
||||
assert!(re.is_match(&result));
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_collect_moim_uses_minute_granularity() {
|
||||
let em = ExtensionManager::new_without_provider();
|
||||
|
||||
if let Some(moim) = em.collect_moim().await {
|
||||
// Timestamp should end with :00 (seconds fixed to 00)
|
||||
assert!(
|
||||
moim.contains(":00\n"),
|
||||
"Timestamp should use minute granularity"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user