Skip to content

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

refactor(prompts): move subagent prompt rendering under agent tree

Steven Enamakeld6a6831f3766
diff --git a/crates/openhuman-core/src/agent/prompts/mod.rs b/crates/openhuman-core/src/agent/prompts/mod.rs
index ca6189821c..bdcf8cfb4d 100644
--- a/crates/openhuman-core/src/agent/prompts/mod.rs
+++ b/crates/openhuman-core/src/agent/prompts/mod.rs
@@ -11,6 +11,8 @@ pub use agents_md::{AGENTS_MD_FILENAME, AgentsMdContent, load_agents_md, load_ag
pub mod builder;
pub use builder::{GLOBAL_STYLE_SUFFIX, SystemPromptBuilder, TieredPrompt};
+#[path = "render_helpers/subagent.rs"]
+mod subagent;
pub(crate) use subagent::harness_json_tool_prompt;
pub use subagent::{render_subagent_system_prompt, render_subagent_system_prompt_with_format};
diff --git a/crates/openhuman-core/src/agent/prompts/mod_tests.rs b/crates/openhuman-core/src/agent/prompts/mod_tests.rs
index 8f36616c2f..07b7808ff8 100644
--- a/crates/openhuman-core/src/agent/prompts/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/prompts/mod_tests.rs
@@ -1,4 +1,6 @@
use super::*;
+use crate::prompts::*;
+use crate::prompts::sections::*;
use async_trait::async_trait;
use std::collections::HashSet;
use std::path::Path;
diff --git a/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs b/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs
index e3868c58aa..8e65c22fe7 100644
--- a/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs
+++ b/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs
@@ -5,9 +5,9 @@
//! for callers that only hold indices into the parent's tool vec.
use super::builder::GLOBAL_STYLE_SUFFIX;
-use super::sections::GROUNDING_BODY;
+use crate::prompts::sections::GROUNDING_BODY;
use super::types::*;
-use super::workspace_files::{inject_workspace_file, write_agents_md_blocks};
+use crate::prompts::{inject_workspace_file, write_agents_md_blocks};
use std::fmt::Write;
use std::path::Path;
use tinytools_agent::dialect::ToolCallFormat;
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
index 4213f29721..5619e2c1ea 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
@@ -22,7 +22,7 @@ use crate::agent::subagent_host::types::{
use crate::agent::tinyagents::budget::MAX_SPAWN_DEPTH;
use crate::agent_registry::host_definition::{AgentDefinition, AgentDefinitionRegistry};
use crate::inference::provider::AGENT_TURN_MAX_OUTPUT_TOKENS;
-use crate::prompts::render_subagent_system_prompt_with_format;
+use crate::agent::prompts::render_subagent_system_prompt_with_format;
use tinyagents_definition::{
AgentTier, IterationPolicy, PromptSource, SandboxMode as AgentSandboxMode,
validate_tier_transition,
diff --git a/crates/openhuman-core/src/prompts/workspace_files.rs b/crates/openhuman-core/src/prompts/workspace_files.rs
index 204c70907f..8c8bb28810 100644
--- a/crates/openhuman-core/src/prompts/workspace_files.rs
+++ b/crates/openhuman-core/src/prompts/workspace_files.rs
@@ -242,20 +242,18 @@ pub fn inject_workspace_file_capped(
}
pub fn default_workspace_file_content(filename: &str) -> &'static str {
- // The bundled identity files live at `crates/openhuman-core/src/agent/prompts/`
- // (owned by the `agent/` tree because they describe agent identity).
- // This module is under `agent/prompts/render_helpers/`, so the relative path
- // walks up one level back into `agent/prompts/`.
+ // The bundled identity files remain next to the agent prompt builder; only
+ // the reusable workspace-file handling moved into this domain.
match filename {
- "SOUL.md" => include_str!("../SOUL.md"),
- "IDENTITY.md" => include_str!("../IDENTITY.md"),
+ "SOUL.md" => include_str!("../agent/prompts/SOUL.md"),
+ "IDENTITY.md" => include_str!("../agent/prompts/IDENTITY.md"),
// The user-facing agent's role brief and writing style, moved out of
// the compiled `orchestrator/prompt.md` so both are tunable on disk
// without a rebuild (#5701). Same sync-and-inject contract as
// SOUL.md / IDENTITY.md: the bundled copy seeds the workspace, and a
// user edit wins from the next session on.
- "ROLE.md" => include_str!("../ROLE.md"),
- "STYLE.md" => include_str!("../STYLE.md"),
+ "ROLE.md" => include_str!("../agent/prompts/ROLE.md"),
+ "STYLE.md" => include_str!("../agent/prompts/STYLE.md"),
_ => "",
}
diff --git a/vendor/tinyagents b/vendor/tinyagents
index a988182bc9..a48a7ce8f2 160000
--- a/vendor/tinyagents
+++ b/vendor/tinyagents
@@ -1 +1 @@
-Subproject commit a988182bc935733364496fa63db7aad17cd3ae8c
+Subproject commit a48a7ce8f2071a181a669fe28e2aa4700868141e