From 84e70c0e73460e5db1297c47d02d9b76802bfdf7 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 18 Nov 2026 12:28:29 +0100 Subject: 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) --- tests/cli.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests/cli.rs') diff --git a/tests/cli.rs b/tests/cli.rs index 6c041fb..5a4c03f 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -145,3 +145,28 @@ fn show_renders_a_transcript() { assert!(stdout.contains("on it"), "{stdout}"); assert!(stdout.contains("thinking about it"), "{stdout}"); } + +#[test] +fn a_flag_shaped_value_is_rejected_unless_attached() { + let output = agent().args(["--session", "--list"]).output().unwrap(); + assert_eq!(output.status.code(), Some(2)); + assert!( + String::from_utf8_lossy(&output.stderr).contains("needs a value"), + "{:?}", + String::from_utf8_lossy(&output.stderr) + ); + + // The attached form works and creates a session whose id starts with `-`. + let home = temp_home("dash-session"); + let output = agent() + .env("HOME", &home) + .env("OPENCODE_API_KEY", "test") + .args(["--session=-abc", "--base-url", "http://127.0.0.1:9/v1"]) + .stdin(std::process::Stdio::null()) + .output() + .unwrap(); + assert_eq!(output.status.code(), Some(0), "{output:?}"); + assert!(home + .join(".local/share/agent686/sessions/-abc.jsonl") + .exists()); +} -- cgit v1.2.3