()
| 395 | |
| 396 | #[tokio::test] |
| 397 | async fn test_agent_memory_working_overflow_trims() { |
| 398 | let memory = AgentMemory { |
| 399 | store: Arc::new(InMemoryStore::new()), |
| 400 | short_term: Arc::new(RwLock::new(VecDeque::new())), |
| 401 | working: Arc::new(RwLock::new(Vec::new())), |
| 402 | max_short_term: 100, |
| 403 | max_working: 3, |
| 404 | relevance_config: RelevanceConfig::default(), |
| 405 | }; |
| 406 | for i in 0..5 { |
| 407 | memory |
| 408 | .add_to_working( |
| 409 | MemoryItem::new(format!("task {i}")).with_importance(i as f32 * 0.2), |
| 410 | ) |
| 411 | .await |
| 412 | .unwrap(); |
| 413 | } |
| 414 | assert_eq!(memory.get_working().await.len(), 3); |
| 415 | } |
| 416 | |
| 417 | #[tokio::test] |
| 418 | async fn test_agent_memory_recall_by_tags() { |
nothing calls this directly
no test coverage detected