Skip to content

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

feat(core): validate watcher state key identity

Steven Enamakel3dbbcb5e2679
diff --git a/crates/openhuman-core/src/config/workspace/state.rs b/crates/openhuman-core/src/config/workspace/state.rs
index 33d2f89e58..f066808c0b 100644
--- a/crates/openhuman-core/src/config/workspace/state.rs
+++ b/crates/openhuman-core/src/config/workspace/state.rs
@@ -134,6 +134,9 @@ impl WatcherStateStore {
let page = kv.list(KEY_PREFIX, cursor, PAGE_SIZE).await?;
for item in page.items {
let state = decode_state(&item.doc)?;
+ if item.id != key_for(&state.path) {
+ return Err(anyhow!("watcher state key identity mismatch"));
+ }
if !state.deleted {
states.push(FileState {
path: PathBuf::from(state.path),