Skip to content

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

chore: files changed crates/openhuman-core/src/agent/experience/capture.rs,crates/openhuman-core/src

Steven Enamakel228e44a0e0e2
diff --git a/crates/openhuman-core/src/agent/experience/capture.rs b/crates/openhuman-core/src/agent/experience/capture.rs
index 60a715060c..a2a843eb7d 100644
--- a/crates/openhuman-core/src/agent/experience/capture.rs
+++ b/crates/openhuman-core/src/agent/experience/capture.rs
@@ -4,8 +4,7 @@ use std::sync::Arc;
use crate::agent::experience::store::AgentExperienceStore;
use crate::agent::experience::types::{
- redact_text, stable_experience_id, AgentExperience,
- ExperienceOutcome, ExperienceSource,
+ redact_text, stable_experience_id, AgentExperience, ExperienceOutcome, ExperienceSource,
};
use crate::agent::hooks::{PostTurnHook, ToolCallRecord, TurnContext};
use crate::memory::Memory;
@@ -26,10 +25,7 @@ impl AgentExperienceCaptureHook {
}
pub fn from_store(store: AgentExperienceStore, enabled: bool) -> Self {
- Self {
- store,
- enabled,
- }
+ Self { store, enabled }
}
pub fn extract_candidates(ctx: &TurnContext) -> Vec<AgentExperience> {
diff --git a/crates/openhuman-core/src/agent/experience/ops.rs b/crates/openhuman-core/src/agent/experience/ops.rs
index 596e41d5c0..77b31aabcd 100644
--- a/crates/openhuman-core/src/agent/experience/ops.rs
+++ b/crates/openhuman-core/src/agent/experience/ops.rs
@@ -272,8 +272,7 @@ pub struct RetrieveParams {
}
#[derive(Debug, Deserialize, Default)]
-pub struct ListParams {
-}
+pub struct ListParams {}
#[derive(Debug, Deserialize)]
pub struct DismissParams {
@@ -357,9 +356,7 @@ pub async fn dismiss(params: DismissParams) -> Result<RpcOutcome<DismissResult>,
let stores = open_query_stores().await?;
let mut dismissed = false;
for store in stores {
- dismissed |= store
- .dismiss(&params.id)
- .await?;
+ dismissed |= store.dismiss(&params.id).await?;
}
Ok(RpcOutcome::single_log(
DismissResult {
diff --git a/crates/openhuman-core/src/agent/experience/schemas.rs b/crates/openhuman-core/src/agent/experience/schemas.rs
index 7b4dbfe774..d312d19af0 100644
--- a/crates/openhuman-core/src/agent/experience/schemas.rs
+++ b/crates/openhuman-core/src/agent/experience/schemas.rs
@@ -120,14 +120,12 @@ pub fn schemas(function: &str) -> ControllerSchema {
namespace: "agent_experience",
function: "dismiss",
description: "Mark an operating experience as dismissed so retrieval ignores it.",
- inputs: vec![
- FieldSchema {
- name: "id",
- ty: TypeSchema::String,
- comment: "Experience id to dismiss.",
- required: true,
- },
- ],
+ inputs: vec![FieldSchema {
+ name: "id",
+ ty: TypeSchema::String,
+ comment: "Experience id to dismiss.",
+ required: true,
+ }],
outputs: vec![FieldSchema {
name: "result",
ty: TypeSchema::Object {
diff --git a/crates/openhuman-core/src/agent/experience/store.rs b/crates/openhuman-core/src/agent/experience/store.rs
index 5e8e4280ae..6eb6791b52 100644
--- a/crates/openhuman-core/src/agent/experience/store.rs
+++ b/crates/openhuman-core/src/agent/experience/store.rs
@@ -1,6 +1,4 @@
-use crate::agent::experience::types::{
- stable_experience_id, AgentExperience, ExperienceHit,
-};
+use crate::agent::experience::types::{stable_experience_id, AgentExperience, ExperienceHit};
use crate::memory::safety::sanitize_text;
use crate::memory::{Memory, MemoryCategory};
use base64::Engine as _;
@@ -61,7 +59,6 @@ pub struct ExperienceQuery {
pub max_hits: usize,
}
-
#[derive(Clone)]
pub struct AgentExperienceStore {
memory: Arc<dyn Memory>,
@@ -142,7 +139,6 @@ impl AgentExperienceStore {
Ok(experiences)
}
-
pub async fn dismiss(&self, id: &str) -> Result<bool, String> {
let key = storage_key(id);
let Some(mut experience) = self.fetch(&key).await? else {
@@ -154,7 +150,6 @@ impl AgentExperienceStore {
Ok(true)
}
-
pub async fn retrieve(&self, query: ExperienceQuery) -> Result<Vec<ExperienceHit>, String> {
if query.max_hits == 0 {
return Ok(Vec::new());
diff --git a/crates/openhuman-core/src/agent/experience/store_tests.rs b/crates/openhuman-core/src/agent/experience/store_tests.rs
index 0b475e7bbf..1d2941c482 100644
--- a/crates/openhuman-core/src/agent/experience/store_tests.rs
+++ b/crates/openhuman-core/src/agent/experience/store_tests.rs
@@ -81,7 +81,6 @@ async fn put_list_and_dismiss_round_trip() {
assert!(listed[0].dismissed);
}
-
#[tokio::test]
async fn retrieve_ignores_dismissed_records() {
let (store, _) = fresh_store();
diff --git a/crates/openhuman-core/src/agent/experience/types.rs b/crates/openhuman-core/src/agent/experience/types.rs
index 1586b280d6..d6132e92ef 100644
--- a/crates/openhuman-core/src/agent/experience/types.rs
+++ b/crates/openhuman-core/src/agent/experience/types.rs
@@ -80,7 +80,6 @@ pub fn stable_experience_id(
format!("exp_{}", &digest[..24])
}
-
fn outcome_key(outcome: ExperienceOutcome) -> &'static str {
match outcome {
ExperienceOutcome::Success => "success",
diff --git a/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs b/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs
index 24e782b7d8..1ccf7d9705 100644
--- a/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs
+++ b/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs
@@ -206,7 +206,7 @@ impl Agent {
&self,
) -> crate::agent::tinyagents::host::OpenHumanExperienceStore {
crate::agent::tinyagents::host::OpenHumanExperienceStore::new(self.memory_arc())
- .with_shared_recall_memory(self.shared_experience_memory.clone())
+ .with_shared_recall_memory(self.shared_experience_memory.clone())
}
/// The agent's working directory.
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rs
index 3e8f0b7dce..b7c396911d 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rs
@@ -332,7 +332,6 @@ fn named_scope_drops_denied_tools_and_keeps_extras() {
);
}
-
// ── config-backed custom agents ───────────────────────────────────────
fn config_with(entries: Vec<AgentRegistryEntry>) -> Arc<Config> {
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/experience_store.rs b/crates/openhuman-core/src/agent/tinyagents/host/experience_store.rs
index 4e8b61c81e..f8bd886299 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/experience_store.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/experience_store.rs
@@ -69,8 +69,8 @@ use crate::agent::experience::store::{
retrieve_across_stores, AgentExperienceStore, ExperienceQuery,
};
use crate::agent::experience::types::{
- redact_text, stable_experience_id, AgentExperience,
- ExperienceHit, ExperienceOutcome, ExperienceSource,
+ redact_text, stable_experience_id, AgentExperience, ExperienceHit, ExperienceOutcome,
+ ExperienceSource,
};
use crate::memory::Memory;
@@ -229,11 +229,7 @@ impl OpenHumanExperienceStore {
// first agent's record. Using the one hashed field that is free
// keeps identity per-agent without inventing a tool trace or
// reaching into the domain's digest.
- id: stable_experience_id(
- &task_summary,
- std::slice::from_ref(&agent_key),
- outcome,
- ),
+ id: stable_experience_id(&task_summary, std::slice::from_ref(&agent_key), outcome),
// Left at zero so `put` stamps creation time itself, and preserves
// the original `created_at_ms` when this id already exists.
created_at_ms: 0,
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/experience_store_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/experience_store_tests.rs
index c44a379669..74a1c3ad8e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/experience_store_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/experience_store_tests.rs
@@ -327,10 +327,6 @@ fn partial_outcomes_read_as_unsuccessful() {
assert!(mapped.outcome.contains("do not repeat the failed call"));
}
- let record = adapter().to_domain(&exp("planner", &long, "ok", true));
- assert_eq!(record.task_summary.chars().count(), MAX_SUMMARY_CHARS);
-}
-
#[test]
fn recorded_rows_carry_no_fabricated_tool_trace() {
// A fake tool sequence would corrupt `score_experience`'s tool-overlap
diff --git a/crates/openhuman-core/src/cron/scheduler/agent_run.rs b/crates/openhuman-core/src/cron/scheduler/agent_run.rs
index ed7282aa4b..e560188289 100644
--- a/crates/openhuman-core/src/cron/scheduler/agent_run.rs
+++ b/crates/openhuman-core/src/cron/scheduler/agent_run.rs
@@ -241,23 +241,23 @@ pub(super) fn build_agent_for_cron_job(
) -> anyhow::Result<BuiltCronAgent> {
let agent_id = job.agent_id.as_deref().unwrap_or("orchestrator");
match Agent::from_config_for_agent(config, agent_id) {
- Ok(agent) => {
- tracing::debug!(
- job_id = %job.id,
- agent_id = %agent_id,
- "[cron] built scheduled job agent from definition"
- );
- Ok(BuiltCronAgent { agent })
- }
- Err(e) => {
- tracing::warn!(
- job_id = %job.id,
- agent_id = %agent_id,
- error = %e,
- "[cron] failed to build agent from definition; falling back to canonical orchestrator"
- );
- Agent::from_config_for_agent(config, "orchestrator")
- .map(|agent| BuiltCronAgent { agent })
- }
+ Ok(agent) => {
+ tracing::debug!(
+ job_id = %job.id,
+ agent_id = %agent_id,
+ "[cron] built scheduled job agent from definition"
+ );
+ Ok(BuiltCronAgent { agent })
+ }
+ Err(e) => {
+ tracing::warn!(
+ job_id = %job.id,
+ agent_id = %agent_id,
+ error = %e,
+ "[cron] failed to build agent from definition; falling back to canonical orchestrator"
+ );
+ Agent::from_config_for_agent(config, "orchestrator")
+ .map(|agent| BuiltCronAgent { agent })
+ }
}
}