Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion crates/goose/src/agents/extension_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)> = {
Expand Down Expand Up @@ -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"
);
}
}
}