()
| 2386 | |
| 2387 | #[tokio::test(flavor = "multi_thread")] |
| 2388 | async fn test_resume_session_restores_artifacts() { |
| 2389 | let store = Arc::new(crate::store::MemorySessionStore::new()); |
| 2390 | let agent = Agent::from_config(test_config()).await.unwrap(); |
| 2391 | |
| 2392 | let opts = SessionOptions::new() |
| 2393 | .with_session_store(store.clone()) |
| 2394 | .with_session_id("resume-artifacts-test"); |
| 2395 | let session = agent.session("/tmp/test-ws-artifacts", Some(opts)).unwrap(); |
| 2396 | session |
| 2397 | .tool_executor |
| 2398 | .artifact_store() |
| 2399 | .put(crate::tools::ToolArtifact { |
| 2400 | artifact_id: "tool-output:test:a".to_string(), |
| 2401 | artifact_uri: "a3s://tool-output/test/a".to_string(), |
| 2402 | tool_name: "test".to_string(), |
| 2403 | content: "artifact content".to_string(), |
| 2404 | original_bytes: 16, |
| 2405 | shown_bytes: 4, |
| 2406 | }); |
| 2407 | |
| 2408 | session.save().await.unwrap(); |
| 2409 | let opts2 = SessionOptions::new().with_session_store(store.clone()); |
| 2410 | let resumed = agent |
| 2411 | .resume_session("resume-artifacts-test", opts2) |
| 2412 | .unwrap(); |
| 2413 | |
| 2414 | let artifact = resumed |
| 2415 | .get_artifact("a3s://tool-output/test/a") |
| 2416 | .expect("artifact"); |
| 2417 | assert_eq!(artifact.content, "artifact content"); |
| 2418 | } |
| 2419 | |
| 2420 | #[tokio::test(flavor = "multi_thread")] |
| 2421 | async fn test_resume_session_restores_trace_events() { |
nothing calls this directly
no test coverage detected