Skip to content

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

chore: files changed src/openhuman/agent/tinyagents/host/model_resolver.rs,src/openhuman/agent/tinya

Steven Enamakel5aef9f3fcaba
diff --git a/src/openhuman/agent/tinyagents/host/model_resolver.rs b/src/openhuman/agent/tinyagents/host/model_resolver.rs
index 49dd56b524..094a49d98e 100644
--- a/src/openhuman/agent/tinyagents/host/model_resolver.rs
+++ b/src/openhuman/agent/tinyagents/host/model_resolver.rs
@@ -218,6 +218,13 @@ impl<State: Send + Sync> ChatModel<State> for StatelessModel {
self.inner.profile()
}
+ // Forwarded so the harness response cache scopes on the *real* model. The
+ // trait default declines identity, and `scoped_cache_key` then folds a fixed
+ // "anonymous-model" marker — every wrapped model would share one key space.
+ fn cache_identity(&self) -> Option<String> {
+ self.inner.cache_identity()
+ }
+
async fn invoke(
&self,
_state: &State,
diff --git a/src/openhuman/agent/tinyagents/model.rs b/src/openhuman/agent/tinyagents/model.rs
index 1fabd88b24..5c4c747c14 100644
--- a/src/openhuman/agent/tinyagents/model.rs
+++ b/src/openhuman/agent/tinyagents/model.rs
@@ -440,6 +440,10 @@ impl ChatModel<()> for RouteRecordingModel {
self.inner.profile()
}
+ fn cache_identity(&self) -> Option<String> {
+ self.inner.cache_identity()
+ }
+
async fn invoke(
&self,
state: &(),
@@ -496,6 +500,10 @@ impl ChatModel<()> for ProfileOverrideModel {
Some(&self.profile)
}
+ fn cache_identity(&self) -> Option<String> {
+ self.inner.cache_identity()
+ }
+
async fn invoke(
&self,
state: &(),
@@ -538,6 +546,14 @@ impl ChatModel<()> for MaxTokensModel {
self.inner.profile()
}
+ // Every host wrapper forwards `cache_identity`: the trait default declines
+ // identity, and the harness response cache then keys every wrapped model
+ // under one "anonymous-model" marker, so a shared cache could serve a
+ // local model's answer to a hosted one.
+ fn cache_identity(&self) -> Option<String> {
+ self.inner.cache_identity()
+ }
+
async fn invoke(
&self,
state: &(),
diff --git a/src/openhuman/inference/provider/factory_part_02.rs b/src/openhuman/inference/provider/factory_part_02.rs
index 365859f325..f192d2f3ea 100644
--- a/src/openhuman/inference/provider/factory_part_02.rs
+++ b/src/openhuman/inference/provider/factory_part_02.rs
@@ -217,6 +217,10 @@ impl ChatModel<()> for DefaultTemperatureChatModel {
self.inner.profile()
}
+ fn cache_identity(&self) -> Option<String> {
+ self.inner.cache_identity()
+ }
+
async fn invoke(
&self,
state: &(),