Skip to content

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

chore: I can't write an accurate commit message from this input — the diff itself is empty. The fi

Steven Enamakele1312ca97af5
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs b/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs
index 9018d2c7d6..31946d5b59 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs
@@ -320,6 +320,7 @@ pub(in super::super) async fn run_subagent_via_graph(
"[subagent_host:graph] sub-agent run errored; persisting recovered transcript before returning (#4466)"
);
super::transcript::persist_failed_run(
+ &dispatch,
transcripts.as_ref(),
&workspace_dir,
transcript_stem,
@@ -489,6 +490,7 @@ pub(in super::super) async fn run_subagent_via_graph(
// initial user prompt was already written when the worker thread was created.
if let Some(thread_id) = worker_thread_id {
mirror_worker_thread(
+ &dispatch,
&workspace_dir,
&thread_id,
agent_id,
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/graph/transcript.rs b/crates/openhuman-core/src/agent/subagent_host/ops/graph/transcript.rs
index 3285aa4a2c..e8ce3e9ad8 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/graph/transcript.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/graph/transcript.rs
@@ -225,6 +225,7 @@ pub(super) fn persist_subagent_transcript(
/// number of model calls a provider answered.
#[allow(clippy::too_many_arguments)]
pub(super) fn persist_failed_run(
+ ctx: &crate::core::runtime::DispatchCtx,
transcripts: &dyn TranscriptLocator,
workspace_dir: &std::path::Path,
transcript_stem: &str,
@@ -266,6 +267,7 @@ pub(super) fn persist_failed_run(
if let Some(thread_id) = worker_thread_id {
mirror_worker_thread_from_history(
+ ctx,
workspace_dir,
thread_id,
agent_id,
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/graph/worker_mirror.rs b/crates/openhuman-core/src/agent/subagent_host/ops/graph/worker_mirror.rs
index 8aa32bd3c8..5c0e003599 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/graph/worker_mirror.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/graph/worker_mirror.rs
@@ -13,6 +13,7 @@ use tinytools_agent::dialect::{DialectRole, TranscriptEntry};
/// task_id}` only, dropping the fields worker-thread consumers key on.
#[allow(clippy::too_many_arguments)]
fn append_worker_message(
+ ctx: &crate::core::runtime::DispatchCtx,
workspace_dir: &std::path::Path,
thread_id: &str,
agent_id: &str,
@@ -52,7 +53,7 @@ fn append_worker_message(
created_at: chrono::Utc::now().to_rfc3339(),
};
if let Err(err) = append_message(
- &DispatchCtx::ambient(),
+ ctx,
workspace_dir.to_path_buf(),
thread_id,
message,
@@ -76,6 +77,7 @@ fn append_worker_message(
/// `iteration` counter, `final` on the trailing message, `tool_calls` on an
/// assistant round, and `tool_call_id` / `tool_name` on each tool result.
pub(super) fn mirror_worker_thread(
+ ctx: &crate::core::runtime::DispatchCtx,
workspace_dir: &std::path::Path,
thread_id: &str,
agent_id: &str,
@@ -147,6 +149,7 @@ pub(super) fn mirror_worker_thread(
{
iteration += 1;
append_worker_message(
+ ctx,
workspace_dir,
thread_id,
agent_id,
@@ -182,6 +185,7 @@ pub(super) fn mirror_worker_thread(
/// `conversation`) is available. `failure_final`, when set, is appended as a
/// trailing `agent` failure marker.
pub(super) fn mirror_worker_thread_from_history(
+ ctx: &crate::core::runtime::DispatchCtx,
workspace_dir: &std::path::Path,
thread_id: &str,
agent_id: &str,
@@ -195,6 +199,7 @@ pub(super) fn mirror_worker_thread_from_history(
"assistant" if !m.content.trim().is_empty() => {
iteration += 1;
append_worker_message(
+ ctx,
workspace_dir,
thread_id,
agent_id,
@@ -206,6 +211,7 @@ pub(super) fn mirror_worker_thread_from_history(
}
"tool" if !m.content.trim().is_empty() => {
append_worker_message(
+ ctx,
workspace_dir,
thread_id,
agent_id,