agent: a plugin on the new SDK (agent.chat, tools call/read_file/write_file/list_dir/copy_dir)

Holds the history lock for a turn, 600 s grace period, interim texts as
core.notify. Tests with a fake LLM in the real core. The SDK tests of
/proc, /self, /run, and detached notifications now run.
This commit is contained in:
2026-10-23 01:42:20 +01:00
parent 8d058666dc
commit 53b90a8ecf
11 changed files with 754 additions and 387 deletions
+6 -13
View File
@@ -59,7 +59,7 @@ impl Consumer {
fn main() {
sausage_plugin::run(Consumer)
}
/// Tests demonstrate generated params and calls through the test core.
/// Tests check generated wire types without other plugins in the test world.
#[cfg(test)]
mod tests {
use super::*;
@@ -72,17 +72,10 @@ mod tests {
.unwrap();
assert_eq!(value, sausage_plugin::serde_json::json!({"text":"milk"}));
}
/// A typed import reaches the notes plugin through the test core.
#[sausage_plugin::test]
async fn imports_notes() {
assert_eq!(
Consumer
.note(NoteParams {
text: "milk".into()
})
.await
.unwrap(),
1
);
/// A generated result decodes without another plugin in the test world.
#[test]
fn generated_result_decodes_count() {
let added: notes::Added = sausage_plugin::serde_json::from_str(r#"{"count":2}"#).unwrap();
assert_eq!(added.count, 2);
}
}