From c19b2e53e44bd3a59370dca47a4b05528ca7da20 Mon Sep 17 00:00:00 2001 From: Willow Sparks Date: Mon, 2 Nov 2026 13:18:03 +0000 Subject: [PATCH] test(cli): validate persisted tool status through session logs The tool-error-status integration tests still treated outer SessionLog envelopes as FileEntry, failing the header assertion before reaching persisted result checks. Read the file through the shared strict session reader and retain all header, IDs, parent links, SDK/provider events, result flags and disk/history equality assertions unchanged. No raw/legacy fallback or production changes. Source-only correction; native focused tests pending explicit build slot. --- crates/pa-cli/tests/tool_error_status.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/pa-cli/tests/tool_error_status.rs b/crates/pa-cli/tests/tool_error_status.rs index 27494dac6..5c3a3f414 100644 --- a/crates/pa-cli/tests/tool_error_status.rs +++ b/crates/pa-cli/tests/tool_error_status.rs @@ -272,10 +272,10 @@ async fn assert_persisted_status(is_error: bool) { ["user", "assistant", "toolResult", "assistant"] ); assert_eq!(normalized_message(messages[2].clone()), expected); - let rows = std::fs::read_to_string(&path) - .unwrap() - .lines() - .map(|line| serde_json::from_str::(line).unwrap()) + let rows = pa_core::session::read::read_entries(&path) + .expect("valid persisted session log") + .iter() + .map(|entry| serde_json::to_value(entry).unwrap()) .collect::>(); assert_eq!(rows[0]["type"], "session"); assert_eq!(rows[0]["id"], session_id); -- knotmirror 0.0.1