Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(memory): correct schema definition for memory storage

Steven Enamakela113ca22eb9f
diff --git a/crates/openhuman-core/src/memory/schemas/defs.rs b/crates/openhuman-core/src/memory/schemas/defs.rs
index 5f22b1b502..2da5a675e6 100644
--- a/crates/openhuman-core/src/memory/schemas/defs.rs
+++ b/crates/openhuman-core/src/memory/schemas/defs.rs
@@ -68,11 +68,8 @@ fn cursor() -> FieldSchema {
opt("cursor", TypeSchema::String, "Engine cursor from a previous page.")
}
-/// The schema of `function`.
-///
-/// # Panics
-///
-/// On a function not in [`FUNCTIONS`] (a programming error).
+/// The schema of `function`; an unknown function gets the namespace's
+/// `unknown` placeholder, as every namespace does.
pub fn schema(function: &str) -> ControllerSchema {
let (function, description, inputs, outputs): (&'static str, &'static str, Vec<FieldSchema>, Vec<FieldSchema>) =
match function {
@@ -187,7 +184,12 @@ pub fn schema(function: &str) -> ControllerSchema {
out("{state: ImportState}"),
),
"import_status" => ("import_status", "Progress of the v1 import.", vec![], out("{state: ImportState}")),
- other => panic!("unknown memory function `{other}`"),
+ _ => (
+ "unknown",
+ "Unknown memory controller function.",
+ vec![],
+ vec![req("error", TypeSchema::String, "Lookup error details.")],
+ ),
};
ControllerSchema {
namespace: "memory",