diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-15 03:11:22 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-15 03:11:22 +0100 |
| commit | 343f2a8a6148b8004d6f4d74fb779b4f30c9686a (patch) | |
| tree | 2ea1ddab346565309da644517c3478d2a9096e55 /tests/mock.rs | |
| parent | M0: streaming provider, SSE decoder, mock provider, i686 build gate (diff) | |
| download | agent686-343f2a8a6148b8004d6f4d74fb779b4f30c9686a.tar.gz agent686-343f2a8a6148b8004d6f4d74fb779b4f30c9686a.zip | |
M1-M5: sessions, six tools, approvals, prompt, Ctrl-C, target gate
- append-only JSONL sessions with --continue/--session; reasoning stored, stripped on replay
- read/write/edit/grep/glob + bash with timeout and capped output
- diff-preview approval for the first edit of a session, per-call approval for bash
- system prompt frozen per session with AGENTS.md snapshot and change warning
- SIGINT aborts the turn, second Ctrl-C exits
- glibc gate ignores weak symbols; verified in linux/386 debian:12
- acceptance test (calculator in C) passes on both x86-64 and i386
Diffstat (limited to '')
| -rw-r--r-- | tests/mock.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/mock.rs b/tests/mock.rs index 80d965b..52dec7c 100644 --- a/tests/mock.rs +++ b/tests/mock.rs | |||
| @@ -73,6 +73,7 @@ fn config(base_url: String) -> Config { | |||
| 73 | api_key: "test-key".into(), | 73 | api_key: "test-key".into(), |
| 74 | model: "test-model".into(), | 74 | model: "test-model".into(), |
| 75 | session: "testsession".into(), | 75 | session: "testsession".into(), |
| 76 | yolo: true, | ||
| 76 | } | 77 | } |
| 77 | } | 78 | } |
| 78 | 79 | ||
| @@ -94,6 +95,7 @@ fn streams_text_reasoning_and_usage() { | |||
| 94 | let outcome = provider::chat( | 95 | let outcome = provider::chat( |
| 95 | &config(base), | 96 | &config(base), |
| 96 | &[json!({ "role": "user", "content": "hi" })], | 97 | &[json!({ "role": "user", "content": "hi" })], |
| 98 | &[], | ||
| 97 | &AtomicBool::new(false), | 99 | &AtomicBool::new(false), |
| 98 | &mut sink, | 100 | &mut sink, |
| 99 | ) | 101 | ) |
| @@ -133,6 +135,7 @@ fn assembles_tool_call_arguments_byte_for_byte() { | |||
| 133 | let outcome = provider::chat( | 135 | let outcome = provider::chat( |
| 134 | &config(base), | 136 | &config(base), |
| 135 | &[json!({ "role": "user", "content": "read a.txt" })], | 137 | &[json!({ "role": "user", "content": "read a.txt" })], |
| 138 | &[], | ||
| 136 | &AtomicBool::new(false), | 139 | &AtomicBool::new(false), |
| 137 | &mut sink, | 140 | &mut sink, |
| 138 | ) | 141 | ) |
| @@ -161,6 +164,7 @@ fn surfaces_provider_error_text() { | |||
| 161 | let error = provider::chat( | 164 | let error = provider::chat( |
| 162 | &config(base), | 165 | &config(base), |
| 163 | &[json!({ "role": "user", "content": "hi" })], | 166 | &[json!({ "role": "user", "content": "hi" })], |
| 167 | &[], | ||
| 164 | &AtomicBool::new(false), | 168 | &AtomicBool::new(false), |
| 165 | &mut sink, | 169 | &mut sink, |
| 166 | ) | 170 | ) |
| @@ -184,6 +188,7 @@ fn honours_a_cancelled_turn() { | |||
| 184 | let error = provider::chat( | 188 | let error = provider::chat( |
| 185 | &config(base), | 189 | &config(base), |
| 186 | &[json!({ "role": "user", "content": "hi" })], | 190 | &[json!({ "role": "user", "content": "hi" })], |
| 191 | &[], | ||
| 187 | &AtomicBool::new(true), | 192 | &AtomicBool::new(true), |
| 188 | &mut sink, | 193 | &mut sink, |
| 189 | ) | 194 | ) |
