Skip to content

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

fix(agent): correct hook accessor and usage clone in turn finalization

Steven Enamakela646b255ee67
diff --git a/crates/openhuman-core/src/agent/hooks.rs b/crates/openhuman-core/src/agent/hooks.rs
index aecbe1a2c0..a687bb3290 100644
--- a/crates/openhuman-core/src/agent/hooks.rs
+++ b/crates/openhuman-core/src/agent/hooks.rs
@@ -80,7 +80,7 @@ pub fn embedder_post_turn_hooks_in(
) -> Vec<Arc<dyn LearningSink>> {
let mut hooks = embedder_post_turn_hooks();
if let Some(local) = ctx.host_overrides() {
- hooks.extend(local.learning_hooks().iter().cloned());
+ hooks.extend(local.post_turn_hooks());
}
hooks
}
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session/post_commit.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/post_commit.rs
index 939ddfa53d..0cb6f96a1a 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/post_commit.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/post_commit.rs
@@ -166,7 +166,7 @@ pub(super) async fn finalize_committed_turn(
.lock()
.unwrap_or_else(|poisoned| poisoned.into_inner());
state.last_turn_hit_cap = interrupted;
- state.last_turn_usage = Some(usage);
+ state.last_turn_usage = Some(usage.clone());
state.prelude.clone()
};
// Completion first: `TurnCompleted` is the progress
diff --git a/crates/openhuman-core/src/hooks/ops.rs b/crates/openhuman-core/src/hooks/ops.rs
index 9e55e3969a..8bfad7f36d 100644
--- a/crates/openhuman-core/src/hooks/ops.rs
+++ b/crates/openhuman-core/src/hooks/ops.rs
@@ -57,7 +57,7 @@ pub async fn init(ctx: &DispatchCtx, config: &crate::config::schema::Config) {
}
crate::agent::hooks::replace_embedder_tool_hook(
"configured_hooks",
- Some(std::sync::Arc::new(super::host::engine().clone())),
+ Some(std::sync::Arc::new((*super::host::engine()).clone())),
);
}
diff --git a/crates/openhuman-core/src/profiles/capabilities.rs b/crates/openhuman-core/src/profiles/capabilities.rs
index c79b5cea52..5cac4cb0d8 100644
--- a/crates/openhuman-core/src/profiles/capabilities.rs
+++ b/crates/openhuman-core/src/profiles/capabilities.rs
@@ -302,6 +302,7 @@ impl ToolHook<OpenHumanRunContext> for ProfilePermission {
if rewritten && !decision.is_deny() && !decision.is_ask() {
decision.updated_input = Some(advertised.arguments);
}
+ decision
}
None => ToolHookDecision::deny("this profile has no host tool permission callback"),
}