aboutsummaryrefslogtreecommitdiffstats
path: root/tests/sessions.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-15 17:16:08 +0100
committersalmonik <salmonik@tuta.io>2026-11-15 17:16:08 +0100
commit14e56289391ea95b493c2a20c87f8d88047aa051 (patch)
treed0acf1cc35369688d92c781e31fb7afc30c38b7a /tests/sessions.rs
parent0.5.3: session locking, UTF-8 and size guards for edit, correct character widths (diff)
downloadagent686-14e56289391ea95b493c2a20c87f8d88047aa051.tar.gz
agent686-14e56289391ea95b493c2a20c87f8d88047aa051.zip
0.6.0: transcript viewer, turn summary, yolo floor, model/version records
- --show renders a session without locking it - status line summarises writes, commands and denials per turn - sessions record harness version; model switches are appended and listed - --yolo refuses $HOME and / unless AGENT686_ALLOW_HOME=1
Diffstat (limited to '')
-rw-r--r--tests/sessions.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/sessions.rs b/tests/sessions.rs
index f21be24..1d40f64 100644
--- a/tests/sessions.rs
+++ b/tests/sessions.rs
@@ -95,3 +95,18 @@ fn a_session_cannot_be_open_twice() {
95 drop(first); 95 drop(first);
96 Session::open("locked").expect("after the first handle closes it is available"); 96 Session::open("locked").expect("after the first handle closes it is available");
97} 97}
98
99#[test]
100fn listing_reports_the_model_in_use_after_a_switch() {
101 let _env = ENV_LOCK.lock().unwrap_or_else(|e| e.into_inner());
102 let dir = temp_dir("model-switch");
103 std::env::set_var("AGENT686_DATA", &dir);
104
105 let system = json!({ "role": "system", "content": "x" });
106 let mut session = Session::create_as("switch".into(), "model-a", &system).unwrap();
107 session.record_model("model-b").unwrap();
108
109 let listed = session::list().unwrap();
110 assert_eq!(listed.len(), 1);
111 assert_eq!(listed[0].model, "model-b");
112}