aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tools.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-15 18:00:12 +0100
committersalmonik <salmonik@tuta.io>2026-11-15 18:00:12 +0100
commit8ae5bd48cf233315b5f36a7a6b39002a5e77f74b (patch)
tree71c9b71f90f3cc64544dd506041468ee9bcbcda1 /tests/tools.rs
parent0.6.2: resizing no longer duplicates the prompt (diff)
downloadagent686-8ae5bd48cf233315b5f36a7a6b39002a5e77f74b.tar.gz
agent686-8ae5bd48cf233315b5f36a7a6b39002a5e77f74b.zip
0.7.0: resume shows where you left off; no approval for unparsable calls
- --continue prints the last answer, or the last reasoning block if there was none - tool arguments are validated before prompting, so an empty bash call becomes an error for the model instead of a blank approval - empty placeholder tool calls are dropped and reported - sessions tolerate invalid UTF-8 lines from a torn write - AGENT686_DEBUG_STREAM=1 dumps SSE frames
Diffstat (limited to '')
-rw-r--r--tests/tools.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/tools.rs b/tests/tools.rs
index 77c1698..a400df0 100644
--- a/tests/tools.rs
+++ b/tests/tools.rs
@@ -419,3 +419,18 @@ fn glob_follows_file_symlinks_but_not_directories() {
419 assert!(text.contains("link.rs"), "{text}"); 419 assert!(text.contains("link.rs"), "{text}");
420 assert!(text.contains("inner.rs"), "{text}"); 420 assert!(text.contains("inner.rs"), "{text}");
421} 421}
422
423#[test]
424fn validate_rejects_calls_that_cannot_run() {
425 use agent686::tools::validate;
426
427 assert!(validate("bash", &json!({ "cmd": "" })).is_err());
428 assert!(validate("bash", &json!({})).is_err());
429 assert!(validate("bash", &json!({ "cmd": "ls" })).is_ok());
430
431 assert!(validate("read", &json!({ "path": " " })).is_err());
432 assert!(validate("edit", &json!({ "path": "a", "old": "" })).is_err());
433 assert!(validate("grep", &json!({ "pattern": "" })).is_err());
434 // Empty content is how you create an empty file.
435 assert!(validate("write", &json!({ "path": "a", "content": "" })).is_ok());
436}