Skip to content

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

feat(tinyagents): add context composer to host bundle

Steven Enamakel26133cbc2c0a
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs b/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs
index 5d1806eb05..f1618abdf2 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs
@@ -127,7 +127,8 @@ impl OpenHumanHostBundleFactory {
inputs: OpenHumanHostBundleInputs,
turn: &OpenHumanRunContext,
) -> OpenHumanHostBundle {
- let context = Arc::new(OpenHumanContextComposer::new(Arc::clone(&inputs.config)));
+ let context = Arc::new(OpenHumanContextComposer::new(Arc::clone(&inputs.config))
+ .with_dispatch(turn.dispatch_ctx()));
let registered_tools = Arc::new(
inputs
.tool_sets
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
index dc1f29a371..8bdba90316 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
@@ -74,6 +74,7 @@ use crate::agent::prompts::{
PromptContext, PromptTool, SystemPromptBuilder,
};
use crate::config::{Config, DEFAULT_MODEL};
+use crate::core::runtime::DispatchCtx;
use tinyskills::Skill as Workflow;
/// Composes OpenHuman's system prompt for a TinyAgents turn.
@@ -127,10 +128,17 @@ impl OpenHumanContextComposer {
model_name,
tool_call_format: ToolCallFormat::Json,
connected_integrations: Vec::new(),
+ dispatch: None,
builder: SystemPromptBuilder::with_defaults(),
}
}
+ /// Binds the turn's dispatch context, which the composer reads config under.
+ pub fn with_dispatch(mut self, dispatch: DispatchCtx) -> Self {
+ self.dispatch = Some(dispatch);
+ self
+ }
+
/// Pins the model name rendered into the runtime section.
pub fn with_model_name(mut self, model_name: impl Into<String>) -> Self {
self.model_name = model_name.into();