MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_agent_memory_short_term_trim

Function test_agent_memory_short_term_trim

core/src/memory.rs:442–459  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

440
441 #[tokio::test]
442 async fn test_agent_memory_short_term_trim() {
443 let store = Arc::new(InMemoryStore::new());
444 let memory = AgentMemory {
445 store,
446 short_term: Arc::new(RwLock::new(VecDeque::new())),
447 working: Arc::new(RwLock::new(Vec::new())),
448 max_short_term: 3,
449 max_working: 10,
450 relevance_config: RelevanceConfig::default(),
451 };
452 for i in 0..5 {
453 memory
454 .remember(MemoryItem::new(format!("item {i}")))
455 .await
456 .unwrap();
457 }
458 assert_eq!(memory.short_term_count().await, 3);
459 }
460
461 #[tokio::test]
462 async fn test_agent_memory_prune_delegates() {

Callers

nothing calls this directly

Calls 1

rememberMethod · 0.80

Tested by

no test coverage detected