Skip to content

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

fix(threads): correct schema definition for thread metadata

Steven Enamakel2850dace0e90
diff --git a/crates/openhuman-core/src/threads/schemas/schema_defs.rs b/crates/openhuman-core/src/threads/schemas/schema_defs.rs
index aef9fa7a20..7a681675d7 100644
--- a/crates/openhuman-core/src/threads/schemas/schema_defs.rs
+++ b/crates/openhuman-core/src/threads/schemas/schema_defs.rs
@@ -431,6 +431,76 @@ pub(crate) fn schemas(function: &str) -> ControllerSchema {
required: true,
}],
},
+ "edit_message" => ControllerSchema {
+ namespace: "threads",
+ function: "edit_message",
+ description:
+ "Edit a past user message: cancel the thread's in-flight turn, drop that message and everything after it, and restart the turn with the new content.",
+ inputs: vec![
+ FieldSchema {
+ name: "thread_id",
+ ty: TypeSchema::String,
+ comment: "Thread identifier.",
+ required: true,
+ },
+ FieldSchema {
+ name: "message_id",
+ ty: TypeSchema::String,
+ comment: "Id of the user message to edit (from threads.messages_list).",
+ required: true,
+ },
+ FieldSchema {
+ name: "content",
+ ty: TypeSchema::String,
+ comment: "Replacement message content.",
+ required: true,
+ },
+ FieldSchema {
+ name: "client_id",
+ ty: TypeSchema::Option(Box::new(TypeSchema::String)),
+ comment: "Socket client id to attribute the restarted turn to.",
+ required: false,
+ },
+ ],
+ outputs: vec![FieldSchema {
+ name: "request_id",
+ ty: TypeSchema::String,
+ comment: "Request id of the restarted turn.",
+ required: true,
+ }],
+ },
+ "regenerate" => ControllerSchema {
+ namespace: "threads",
+ function: "regenerate",
+ description:
+ "Regenerate a past assistant reply (or, with no message_id, the thread's last turn): cancel the in-flight turn, drop the answer and everything after it, and restart with the same prompt.",
+ inputs: vec![
+ FieldSchema {
+ name: "thread_id",
+ ty: TypeSchema::String,
+ comment: "Thread identifier.",
+ required: true,
+ },
+ FieldSchema {
+ name: "message_id",
+ ty: TypeSchema::Option(Box::new(TypeSchema::String)),
+ comment: "Id of the assistant reply to regenerate (from threads.messages_list); omit to regenerate the last turn.",
+ required: false,
+ },
+ FieldSchema {
+ name: "client_id",
+ ty: TypeSchema::Option(Box::new(TypeSchema::String)),
+ comment: "Socket client id to attribute the restarted turn to.",
+ required: false,
+ },
+ ],
+ outputs: vec![FieldSchema {
+ name: "request_id",
+ ty: TypeSchema::String,
+ comment: "Request id of the restarted turn.",
+ required: true,
+ }],
+ },
_other => ControllerSchema {
namespace: "threads",
function: "unknown",