aboutsummaryrefslogtreecommitdiffstats
path: root/tests/sessions.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-18 12:28:29 +0100
committersalmonik <salmonik@tuta.io>2026-11-18 12:28:29 +0100
commit84e70c0e73460e5db1297c47d02d9b76802bfdf7 (patch)
treeff0cd75141a28d7112b4f82b2c74bdba91b332a3 /tests/sessions.rs
parent0.9.0: distinguishable tool errors, separated stderr, configurable limits (diff)
downloadagent686-84e70c0e73460e5db1297c47d02d9b76802bfdf7.tar.gz
agent686-84e70c0e73460e5db1297c47d02d9b76802bfdf7.zip
0.9.1: correctness fixes from the audit
- 64 MiB limit detected by file length, so pipelines and redirects are reported - bash temp files removed on every path via a scope guard - validate requires content/new as the schemas declare (present, may be empty) - Session::open folds in model-switch records; resume matches --list - combining mark at a wrap boundary no longer counts as a new row - --flag=value accepted; flag-shaped values rejected - dead code removed; last_reply folded into open (one read per resume)
Diffstat (limited to '')
-rw-r--r--tests/sessions.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/sessions.rs b/tests/sessions.rs
index 748b689..b381888 100644
--- a/tests/sessions.rs
+++ b/tests/sessions.rs
@@ -159,7 +159,9 @@ fn last_reply_prefers_content_and_falls_back_to_reasoning() {
159 .append(&json!({ "role": "assistant", "content": null }), Some("only thinking")) 159 .append(&json!({ "role": "assistant", "content": null }), Some("only thinking"))
160 .unwrap(); 160 .unwrap();
161 161
162 let reply = session::last_reply("reply").expect("there is a reply"); 162 drop(session);
163 let (opened, _system, _messages) = Session::open("reply").expect("open");
164 let reply = opened.last_reply.expect("there is a reply");
163 assert_eq!(reply.content, "the answer", "prefers a real block"); 165 assert_eq!(reply.content, "the answer", "prefers a real block");
164 assert_eq!(reply.reasoning, "the thinking", "and its own reasoning"); 166 assert_eq!(reply.reasoning, "the thinking", "and its own reasoning");
165 167
@@ -168,7 +170,9 @@ fn last_reply_prefers_content_and_falls_back_to_reasoning() {
168 session 170 session
169 .append(&json!({ "role": "assistant", "content": null }), Some("thoughts")) 171 .append(&json!({ "role": "assistant", "content": null }), Some("thoughts"))
170 .unwrap(); 172 .unwrap();
171 let reply = session::last_reply("reasoning-only").unwrap(); 173 drop(session);
174 let (opened, _system, _messages) = Session::open("reasoning-only").unwrap();
175 let reply = opened.last_reply.unwrap();
172 assert!(reply.content.is_empty()); 176 assert!(reply.content.is_empty());
173 assert_eq!(reply.reasoning, "thoughts"); 177 assert_eq!(reply.reasoning, "thoughts");
174} 178}