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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user