Skip to content

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

feat(core): prevent voice note edits outside of channel context

Steven Enamakel3b2abc1e5655
diff --git a/crates/openhuman-core/src/threads/ops/edit.rs b/crates/openhuman-core/src/threads/ops/edit.rs
index 63360d2e1b..6cce22efaf 100644
--- a/crates/openhuman-core/src/threads/ops/edit.rs
+++ b/crates/openhuman-core/src/threads/ops/edit.rs
@@ -90,6 +90,15 @@ pub async fn edit_message(
) -> Result<Outcome<Value>, ThreadsError> {
let client_id = request.client_id.unwrap_or_else(|| "system".to_string());
let thread_id = request.thread_id;
+ if request
+ .attachments
+ .iter()
+ .any(|part| matches!(part, tinychannels_bus::ContentPart::VoiceNote { .. }))
+ {
+ return Err(ThreadsError::Message(
+ "voice notes must be sent through channel.web_chat".into(),
+ ));
+ }
// Validate typed uploads before cancellation or truncation. The folded
// marker form is deliberately discarded: modern edits persist opaque refs
// on the replacement row and give those refs to the trusted runner.