Skip to content

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

fix(host_impls): correct memory allocation size for host buffer

Steven Enamakel541d1edaec0c
diff --git a/src/openhuman/memory/host_impls.rs b/src/openhuman/memory/host_impls.rs
index e1aea03734..e064665476 100644
--- a/src/openhuman/memory/host_impls.rs
+++ b/src/openhuman/memory/host_impls.rs
@@ -169,17 +169,22 @@ impl ChatHost for OpenHumanChatHost {
role: &str,
config: &SeamConfig,
temperature: f64,
- ) -> Result<(Arc<dyn ChatModel<()>>, String), String> {
- crate::openhuman::inference::provider::create_chat_model_with_model_id(
+ ) -> Result<(Arc<dyn tinyagents::harness::model::ChatModel<()>>, String), String> {
+ let (model, model_id) = crate::openhuman::inference::provider::create_chat_model_with_model_id(
role,
host_config(config, &self.config),
temperature,
)
- .map_err(|e| format!("{e:#}"))
+ .map_err(|e| format!("{e:#}"))?;
+ Ok((Arc::new(LegacyChatModelBridge::new(model)), model_id))
}
- fn usage_from_response(&self, response: &ModelResponse) -> Option<UsageInfo> {
- crate::openhuman::agent::tinyagents::model::usage_info_from_response(response)
+ fn usage_from_response(
+ &self,
+ response: &tinyagents::harness::model::ModelResponse,
+ ) -> Option<UsageInfo> {
+ let response = bridge_response_to_new(response).ok()?;
+ crate::openhuman::agent::tinyagents::model::usage_info_from_response(&response)
}
fn summarizer_available(&self, config: &SeamConfig) -> (bool, &'static str) {