Skip to content

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

fix(sandbox): build the live shell handle without the modules feature

M3gA-Mind1c4bf3c219d7
diff --git a/crates/openhuman-core/src/sandbox/shell_live.rs b/crates/openhuman-core/src/sandbox/shell_live.rs
index e33afe61b1..aaccd8b70c 100644
--- a/crates/openhuman-core/src/sandbox/shell_live.rs
+++ b/crates/openhuman-core/src/sandbox/shell_live.rs
@@ -60,32 +60,34 @@ pub(crate) enum LiveHandle {
impl LiveHandle {
/// Read until the process ends or `wait` passes, whichever is first.
pub(crate) async fn read(&mut self, wait: Duration) -> anyhow::Result<LiveRead> {
- match self {
+ // `*self`, not `self`: without `modules` (outside tests) the enum has no
+ // variants, and only a match on the place itself is exhaustive then.
+ match *self {
#[cfg(feature = "modules")]
- Self::TinyBox(live) => live.read(wait).await,
+ Self::TinyBox(ref mut live) => live.read(wait).await,
#[cfg(test)]
- Self::Fixture(live) => live.read(wait).await,
+ Self::Fixture(ref mut live) => live.read(wait).await,
}
}
/// Whether the process has stopped and its resource is released, so a
/// failed read leaves nothing running.
pub(crate) fn finished(&self) -> bool {
- match self {
+ match *self {
#[cfg(feature = "modules")]
- Self::TinyBox(live) => live.released,
+ Self::TinyBox(ref live) => live.released,
#[cfg(test)]
- Self::Fixture(live) => live.finished(),
+ Self::Fixture(ref live) => live.finished(),
}
}
/// Stop the process and return what it wrote since the previous read.
pub(crate) async fn kill(&mut self) -> anyhow::Result<LiveRead> {
- match self {
+ match *self {
#[cfg(feature = "modules")]
- Self::TinyBox(live) => live.kill().await,
+ Self::TinyBox(ref mut live) => live.kill().await,
#[cfg(test)]
- Self::Fixture(live) => live.kill().await,
+ Self::Fixture(ref mut live) => live.kill().await,
}
}
}