Skip to content

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

fix(threads): handle missing run in todo list\n\nWhen a todo item references a run that no longer exists, the todo list now gracefully handles the missing run instead of panicking. This prevents crashes when runs are deleted independently of their associated todos.\n\nAuto-committed-on: dragonfly\n

Steven Enamakelb2daa3deacb8
diff --git a/src/openhuman/threads/todos/runs.rs b/src/openhuman/threads/todos/runs.rs
index a1a9bdbbea..70db7d0487 100644
--- a/src/openhuman/threads/todos/runs.rs
+++ b/src/openhuman/threads/todos/runs.rs
@@ -266,6 +266,12 @@ mod tests {
}
}
+ /// Lowercase-hex encode a thread id, matching [`super::legacy_thread_id`]'s
+ /// decoder so test-built keys round-trip through the migration.
+ fn hex_key(id: &str) -> String {
+ id.as_bytes().iter().map(|b| format!("{b:02x}")).collect()
+ }
+
#[tokio::test]
async fn create_and_list_run() {
let dir = tempdir().unwrap();