Skip to content

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

fix(shell): correct environment iteration and shell flavor import

Steven Enamakelf16294ab1af8
diff --git a/crates/openhuman-core/src/tools/impl/system/shell.rs b/crates/openhuman-core/src/tools/impl/system/shell.rs
index 378a997c37..a20f7f8177 100644
--- a/crates/openhuman-core/src/tools/impl/system/shell.rs
+++ b/crates/openhuman-core/src/tools/impl/system/shell.rs
@@ -848,8 +848,9 @@ impl ShellPorts {
fn permit(&self, context: Option<&dyn ToolRunContext>) -> Result<ExecPermit, ExecDenied> {
let action_dir = self.host.effective_action_dir_for_context(context);
let environment = command_environment_for_tool(context)
- .unwrap_or_default()
+ .as_deref()
.into_iter()
+ .flat_map(|environment| environment.iter())
.map(|(name, value)| (name.into(), value.into()))
.collect();
Ok(ExecPermit {
@@ -865,7 +866,7 @@ impl ShellPorts {
impl ExecBackend for ShellPorts {
fn shell_flavor(&self) -> ShellFlavor {
match self.host.runtime.shell_flavor() {
- crate::modules::tinybox::contract::ShellFlavor::Cmd => ShellFlavor::Cmd,
+ crate::modules::tinybox::host_runtime::ShellFlavor::Cmd => ShellFlavor::Cmd,
_ => ShellFlavor::Posix,
}
}