Skip to content

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

refactor(storage): nest capability filter under selector check

Steven Enamakel6d2d6ba5976b
diff --git a/crates/openhuman-core/src/modules/storage_host_invocation.rs b/crates/openhuman-core/src/modules/storage_host_invocation.rs
index 881134aeb0..acd0ce4d6d 100644
--- a/crates/openhuman-core/src/modules/storage_host_invocation.rs
+++ b/crates/openhuman-core/src/modules/storage_host_invocation.rs
@@ -182,12 +182,14 @@ impl StorageEndpoint for DocumentsOnlyEndpoint {
)
.await
.map_err(HostFailure::Storage)?;
- if call.selector == "Capabilities"
- && let Some(capabilities) = reply
+ if call.selector == "Capabilities" {
+ if let Some(capabilities) = reply
.get_mut("capabilities")
.and_then(Value::as_array_mut)
- {
- capabilities.retain(|capability| capability.as_str() != Some("watch"));
+ {
+ capabilities
+ .retain(|capability| capability.as_str() != Some("watch"));
+ }
}
Ok(storage_grants::filter_reply(&self.grant, filter, reply))
}