Skip to content

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

refactor(agent): rename prompt module to prompts for consistency

Steven Enamakel0f8a09004da8
diff --git a/crates/openhuman-core/src/agent/prompts/mod.rs b/crates/openhuman-core/src/agent/prompts/mod.rs
index 16a9c6a1ff..9ec694941e 100644
--- a/crates/openhuman-core/src/agent/prompts/mod.rs
+++ b/crates/openhuman-core/src/agent/prompts/mod.rs
@@ -20,9 +20,9 @@ pub mod render_helpers;
pub use render_helpers::{
current_datetime_line, default_workspace_file_content, inject_inline_content,
inject_workspace_file, inject_workspace_file_capped, render_ambient_environment,
- render_datetime, render_identity, render_runtime, render_safety,
- render_subagent_system_prompt, render_subagent_system_prompt_with_format, render_tools,
- render_user_identity, render_workspace, sync_workspace_file,
+ render_datetime, render_identity, render_runtime, render_safety, render_subagent_system_prompt,
+ render_subagent_system_prompt_with_format, render_tools, render_user_identity,
+ render_workspace, sync_workspace_file,
};
#[cfg(test)]
diff --git a/crates/openhuman-core/src/agent/prompts/mod_tests_subagent_render_tests.rs b/crates/openhuman-core/src/agent/prompts/mod_tests_subagent_render_tests.rs
index 3a1088cc87..431cee3e42 100644
--- a/crates/openhuman-core/src/agent/prompts/mod_tests_subagent_render_tests.rs
+++ b/crates/openhuman-core/src/agent/prompts/mod_tests_subagent_render_tests.rs
@@ -175,17 +175,31 @@ fn render_with_files(files: &[(&str, &str)], options: SubagentRenderOptions) ->
#[test]
fn subagent_identity_flag_gates_bootstrap_files_and_never_injects_v1_memory_files() {
let files = [
- ("SOUL.md", "# Soul
-ctx"),
- ("IDENTITY.md", "# Identity
-ctx"),
- ("PROFILE.md", "# User Profile
-Name: Jane Doe"),
- ("MEMORY.md", "# Long-term memory
-User prefers terse Rust answers."),
+ (
+ "SOUL.md",
+ "# Soul
+ctx",
+ ),
+ (
+ "IDENTITY.md",
+ "# Identity
+ctx",
+ ),
+ (
+ "PROFILE.md",
+ "# User Profile
+Name: Jane Doe",
+ ),
+ (
+ "MEMORY.md",
+ "# Long-term memory
+User prefers terse Rust answers.",
+ ),
];
- let with_identity =
- render_with_files(&files, SubagentRenderOptions::from_definition_flags(false, true));
+ let with_identity = render_with_files(
+ &files,
+ SubagentRenderOptions::from_definition_flags(false, true),
+ );
assert!(with_identity.contains("### SOUL.md"), "{with_identity}");
assert!(with_identity.contains("### IDENTITY.md"), "{with_identity}");
diff --git a/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rs
index ec93839403..e13a72d926 100644
--- a/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rs
@@ -14,7 +14,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rs
index f4a2ae81db..33465e4267 100644
--- a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rs
@@ -13,7 +13,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rs
index a96138a607..c06de50cd9 100644
--- a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::agent::prompts::{ToolCallFormat};
+use crate::agent::prompts::ToolCallFormat;
use std::collections::HashSet;
#[test]
diff --git a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
index 34a61a14aa..963dda46aa 100644
--- a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
@@ -152,9 +152,7 @@ fn coding_agent_prompts_reference_action_sandbox_not_stale_workspace() {
#[test]
fn every_builtin_has_a_prompt_body() {
- use crate::agent::prompts::{
- ConnectedIntegration, PromptContext, PromptTool, ToolCallFormat,
- };
+ use crate::agent::prompts::{ConnectedIntegration, PromptContext, PromptTool, ToolCallFormat};
let empty_tools: Vec<PromptTool<'_>> = Vec::new();
let empty_integrations: Vec<ConnectedIntegration> = Vec::new();
let empty_visible: std::collections::HashSet<String> = std::collections::HashSet::new();
diff --git a/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs b/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs
index 13cc9363ea..749670c816 100644
--- a/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs
@@ -250,11 +250,7 @@ fn morning_briefing_is_read_only() {
// for every registered tool.
match &def.tools {
ToolScope::Named(tools) => {
- for required in [
- "composio_execute",
- "tool_search",
- "current_time",
- ] {
+ for required in ["composio_execute", "tool_search", "current_time"] {
assert!(
tools.iter().any(|t| t == required),
"morning_briefing needs `{required}`"
diff --git a/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rs
index a482489ce2..0b426cde48 100644
--- a/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rs
@@ -17,7 +17,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs
index 687bd46953..db153a9621 100644
--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs
@@ -13,8 +13,8 @@
use crate::agent::harness::definition::SubagentEntry;
use crate::agent::harness::AgentDefinitionRegistry;
use crate::agent::prompts::{
- render_datetime, render_identity, render_tools, render_workspace,
- ConnectedIntegration, PromptContext, ToolCallFormat,
+ render_datetime, render_identity, render_tools, render_workspace, ConnectedIntegration,
+ PromptContext, ToolCallFormat,
};
use crate::skills::ops_types::Workflow;
use crate::tools::orchestrator_tools::sanitise_slug;
diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
index 03ea7bea73..0d186e75ac 100644
--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::agent::prompts::{ToolCallFormat};
+use crate::agent::prompts::ToolCallFormat;
use std::collections::HashSet;
#[test]
diff --git a/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rs
index 7d9ac3b697..2619e896a6 100644
--- a/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rs
@@ -5,9 +5,7 @@
//! in the order it wants — so the output IS what the LLM sees, no
//! post-processing in the runner.
-use crate::agent::prompts::{
- render_datetime, render_tools, render_workspace, PromptContext,
-};
+use crate::agent::prompts::{render_datetime, render_tools, render_workspace, PromptContext};
use anyhow::Result;
const ARCHETYPE: &str = include_str!("prompt.md");
@@ -17,7 +15,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rs
index 3531759966..b38c582fe0 100644
--- a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rs
@@ -10,7 +10,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rs
index a0cbea0427..c74800261d 100644
--- a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::agent::prompts::{ToolCallFormat};
+use crate::agent::prompts::ToolCallFormat;
use std::collections::HashSet;
#[test]
diff --git a/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rs
index f07f472f78..3ee4484f3e 100644
--- a/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rs
@@ -22,7 +22,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rs
index 4932aeb0f2..d0f8f653ee 100644
--- a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rs
@@ -1,8 +1,6 @@
//! System prompt builder for the `task_manager_agent` built-in agent.
-use crate::agent::prompts::{
- render_safety, render_tools, render_workspace, PromptContext,
-};
+use crate::agent::prompts::{render_safety, render_tools, render_workspace, PromptContext};
use anyhow::Result;
const ARCHETYPE: &str = include_str!("prompt.md");
@@ -12,7 +10,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rs
index d3070b0c36..edb03fae3d 100644
--- a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::agent::prompts::{ToolCallFormat};
+use crate::agent::prompts::ToolCallFormat;
use std::collections::HashSet;
#[test]
diff --git a/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rs
index 4b737d285e..220ac357f9 100644
--- a/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rs
@@ -15,7 +15,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rs
index afaa153e46..1b273b99c1 100644
--- a/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rs
@@ -15,7 +15,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rs
index 2fd0e24b94..dbdc9a717e 100644
--- a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rs
@@ -13,7 +13,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rs
index e6b3a6cd98..1986af6c4e 100644
--- a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::agent::prompts::{ToolCallFormat};
+use crate::agent::prompts::ToolCallFormat;
use std::collections::HashSet;
#[test]
diff --git a/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rs
index 3e50d116a3..0503f89948 100644
--- a/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rs
@@ -14,7 +14,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
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 d0afc96369..aad99f19bb 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
@@ -326,47 +326,6 @@ pub(crate) async fn run_subagent_direct(
.map(std::sync::Arc::new)
.map_err(|e| e.to_string());
- // Deterministic fast path for the pure-retrieval memory agent (#4677).
- // Both `retrieve_memory` (chat delegate) and `call_memory_agent` land
- // here via `run_subagent`; short-circuit with the E2GraphRAG hits when
- // data is present so the happy path costs ~1 deterministic pass instead
- // of a ≤6-iteration model walk (~30–40s of round-trips). Falls through
- // to the full sub-agent when the fast path is disabled/errs/finds
- // nothing (the empty/degraded case is handled by #4655).
- if definition.id == AGENT_MEMORY_ID {
- if let Some(outcome) = Box::pin(try_deterministic_memory_retrieval(
- task_prompt,
- definition,
- &task_id,
- started,
- &loaded_config,
- ))
- .await
- {
- // The fast path completes a real delegation and returns here,
- // short-circuiting the recorder below — so record it too, or a
- // turn whose only delegations are deterministic memory
- // retrievals never accumulates a sample and the budget gate
- // stays disarmed for the whole turn (#5804 review).
- //
- // Including it cannot weaken the gate. `observed_max` is a
- // running **maximum**, so a short sample can only leave it
- // where it was — an earlier revision of this comment claimed
- // the opposite and was wrong about its own statistic. What it
- // does buy is a correct `observed_samples` count and a gate
- // that arms on a turn shaped entirely from fast-path work.
- if let Some(dispatch) = options.run_context.dispatch.as_deref() {
- dispatch.record_subagent_elapsed(started.elapsed());
- }
- usage_finalizer.finish(crate::agent::tinyagents::host::SubagentUsageEntry {
- task_id: task_id.clone(),
- agent_id: definition.id.clone(),
- usage: outcome.usage,
- });
- return Ok(outcome);
- }
- }
-
tracing::info!(
agent_id = %definition.id,
task_id = %task_id,
@@ -1192,5 +1151,5 @@ async fn run_typed_mode(
}
#[cfg(test)]
-#[path = "runner_fast_path_tests_tests.rs"]
-mod fast_path_tests;
+#[path = "runner_result_cap_tests.rs"]
+mod result_cap_tests;
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/runner_fast_path_tests_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops/runner_fast_path_tests_tests.rs
deleted file mode 100644
index 4169fa8753..0000000000
--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner_fast_path_tests_tests.rs
+++ /dev/null
@@ -1,145 +0,0 @@
-use super::{
- apply_max_result_chars, format_deterministic_memory_hits, parse_memory_fast_path_enabled,
- MEMORY_FAST_PATH_LIMIT,
-};
-use crate::memory::api::provider::retrieval::{RetrievalHit, RetrievalNodeKind, RetrievalResponse};
-use chrono::Utc;
-
-// The contract's hit, not the engine's. `tree_kind` is an open `String`
-// here where the engine's is a `TreeKind` enum; the module serialises that
-// enum with `rename_all = "snake_case"`, so `"source"` is the same value
-// the engine's `TreeKind::Source` encodes to — no fixture drift, and one
-// fewer `tinycortex::` import in the tree (#5560).
-fn hit(content: &str, scope: &str, score: f32) -> RetrievalHit {
- RetrievalHit {
- node_id: "n1".into(),
- node_kind: RetrievalNodeKind::Summary,
- tree_id: "t1".into(),
- tree_kind: Some("source".into()),
- tree_scope: scope.into(),
- level: 1,
- content: content.into(),
- entities: vec![],
- topics: vec![],
- time_range_start: Utc::now(),
- time_range_end: Utc::now(),
- score,
- child_ids: vec![],
- source_ref: None,
- }
-}
-
-#[test]
-fn fast_path_enabled_by_default_and_opt_out_parsing() {
- // Unset / unrecognised → enabled (fast path on by default).
- assert!(parse_memory_fast_path_enabled(None));
- assert!(parse_memory_fast_path_enabled(Some("1")));
- assert!(parse_memory_fast_path_enabled(Some("yes")));
- // Explicit falsy values → disabled (fall back to the model walk).
- for off in ["0", "false", "no", "off", " OFF ", "False"] {
- assert!(
- !parse_memory_fast_path_enabled(Some(off)),
- "{off:?} must disable the fast path"
- );
- }
-}
-
-#[test]
-fn format_returns_none_for_no_hits() {
- // Empty response → None so the caller falls back to the full sub-agent
- // (the empty/degraded case is #4655's territory, not this fast path).
- let resp = RetrievalResponse::default();
- assert!(format_deterministic_memory_hits(&resp).is_none());
-}
-
-#[test]
-fn format_renders_hits_with_scope_content_and_score() {
- let resp = RetrievalResponse {
- hits: vec![
- hit("Q3 OKR is to ship memory v2", "notes", 0.91),
- hit("prefers concise replies", "profile", 0.80),
- ],
- total: 2,
- truncated: false,
- };
- let out = format_deterministic_memory_hits(&resp).expect("hits present → Some");
- assert!(out.contains("Retrieved 2 relevant memories"), "{out}");
- assert!(out.contains("[notes] Q3 OKR is to ship memory v2"), "{out}");
- assert!(out.contains("[profile] prefers concise replies"), "{out}");
- assert!(out.contains("(relevance 0.91)"), "{out}");
- // Numbered list, no LLM synthesis needed.
- assert!(out.contains("1. ") && out.contains("2. "), "{out}");
-}
-
-#[test]
-fn format_singular_wording_for_one_hit() {
- let resp = RetrievalResponse {
- hits: vec![hit("only one", "memory", 0.5)],
- total: 1,
- truncated: false,
- };
- let out = format_deterministic_memory_hits(&resp).unwrap();
- assert!(out.contains("Retrieved 1 relevant memory"), "{out}");
-}
-
-#[test]
-fn format_truncates_oversized_hit_body() {
- let big = "x".repeat(5_000);
- let resp = RetrievalResponse {
- hits: vec![hit(&big, "memory", 0.42)],
- total: 1,
- truncated: false,
- };
- let out = format_deterministic_memory_hits(&resp).unwrap();
- assert!(
- out.contains(" …"),
- "oversized body must be ellipsised: {out}"
- );
- assert!(
- out.chars().count() < big.chars().count(),
- "output must be shorter than the raw 5k-char body"
- );
-}
-
-#[test]
-fn fast_path_limit_is_small_single_digit() {
- // Guards against an accidental blow-up of the deterministic fan-out.
- assert!(
- (1..=16).contains(&MEMORY_FAST_PATH_LIMIT),
- "fast-path limit should stay small: {MEMORY_FAST_PATH_LIMIT}"
- );
-}
-
-#[test]
-fn max_result_chars_none_is_noop() {
- // No cap → output untouched (the `agent_memory` default).
- let mut out = "hello world".to_string();
- apply_max_result_chars(&mut out, None, "agent_memory");
- assert_eq!(out, "hello world");
-}
-
-#[test]
-fn max_result_chars_under_cap_is_noop() {
- let mut out = "short".to_string();
- apply_max_result_chars(&mut out, Some(100), "agent_memory");
- assert_eq!(out, "short");
-}
-
-#[test]
-fn max_result_chars_over_cap_truncates_with_marker() {
- let mut out = "x".repeat(50);
- apply_max_result_chars(&mut out, Some(10), "agent_memory");
- assert!(out.starts_with(&"x".repeat(10)), "{out}");
- assert!(out.ends_with("[...truncated]"), "{out}");
- // 10 kept chars + the marker, and shorter than the 50-char original.
- assert!(out.chars().count() < 50, "{out}");
-}
-
-#[test]
-fn max_result_chars_truncates_on_char_boundary_for_multibyte() {
- // Cap lands mid-run of multi-byte chars; must not panic or split a char.
- let mut out = "é".repeat(20); // each 'é' is 2 bytes
- apply_max_result_chars(&mut out, Some(5), "agent_memory");
- assert!(out.starts_with(&"é".repeat(5)), "{out}");
- assert!(out.ends_with("[...truncated]"), "{out}");
-}
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/runner_result_cap_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops/runner_result_cap_tests.rs
new file mode 100644
index 0000000000..b3e7a0bc2d
--- /dev/null
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner_result_cap_tests.rs
@@ -0,0 +1,35 @@
+use super::apply_max_result_chars;
+
+#[test]
+fn max_result_chars_none_is_noop() {
+ // No cap → output untouched (the `agent_memory` default).
+ let mut out = "hello world".to_string();
+ apply_max_result_chars(&mut out, None, "worker");
+ assert_eq!(out, "hello world");
+}
+
+#[test]
+fn max_result_chars_under_cap_is_noop() {
+ let mut out = "short".to_string();
+ apply_max_result_chars(&mut out, Some(100), "worker");
+ assert_eq!(out, "short");
+}
+
+#[test]
+fn max_result_chars_over_cap_truncates_with_marker() {
+ let mut out = "x".repeat(50);
+ apply_max_result_chars(&mut out, Some(10), "worker");
+ assert!(out.starts_with(&"x".repeat(10)), "{out}");
+ assert!(out.ends_with("[...truncated]"), "{out}");
+ // 10 kept chars + the marker, and shorter than the 50-char original.
+ assert!(out.chars().count() < 50, "{out}");
+}
+
+#[test]
+fn max_result_chars_truncates_on_char_boundary_for_multibyte() {
+ // Cap lands mid-run of multi-byte chars; must not panic or split a char.
+ let mut out = "é".repeat(20); // each 'é' is 2 bytes
+ apply_max_result_chars(&mut out, Some(5), "worker");
+ assert!(out.starts_with(&"é".repeat(5)), "{out}");
+ assert!(out.ends_with("[...truncated]"), "{out}");
+}
diff --git a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs
index 53cceeeb28..f222afa66b 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs
@@ -70,14 +70,6 @@ async fn start_channels_inner(mut config: Config) -> Result<()> {
// thread/client only (C5) — never carries memory content or the raw
// recall query, only a short clipped preview.
crate::web_chat::register_memory_activity_surface_subscriber();
- // Spawn the per-toolkit provider periodic sync scheduler. This is
- // a thin tokio task that ticks every minute and dispatches into
- // any provider whose `sync_interval_secs` has elapsed for an
- // active Composio connection. Safe to call here even though
- // `bootstrap_core_runtime` may also start it — `start_periodic_sync`
- // is intentionally cheap and the loop body no-ops when there are
- // no connections.
- crate::integrations::composio::start_periodic_sync();
// Task-sources: subscribe to Composio connection-created events for
// one-shot fetches, and spawn the periodic poll that pulls work from
// configured external sources onto the agent's todo board.
diff --git a/crates/openhuman-core/src/flows/agents/flow_discovery/prompt.rs b/crates/openhuman-core/src/flows/agents/flow_discovery/prompt.rs
index dc4661e12f..b26d9c4e3f 100644
--- a/crates/openhuman-core/src/flows/agents/flow_discovery/prompt.rs
+++ b/crates/openhuman-core/src/flows/agents/flow_discovery/prompt.rs
@@ -18,7 +18,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rs b/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rs
index 60a9655a13..1334b66c60 100644
--- a/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rs
+++ b/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::agent::prompts::{ToolCallFormat};
+use crate::agent::prompts::ToolCallFormat;
use std::collections::HashSet;
fn ctx() -> PromptContext<'static> {
diff --git a/crates/openhuman-core/src/flows/agents/workflow_builder/prompt.rs b/crates/openhuman-core/src/flows/agents/workflow_builder/prompt.rs
index d06a410747..c063eaf1c0 100644
--- a/crates/openhuman-core/src/flows/agents/workflow_builder/prompt.rs
+++ b/crates/openhuman-core/src/flows/agents/workflow_builder/prompt.rs
@@ -17,7 +17,6 @@ pub fn build(ctx: &PromptContext<'_>) -> Result<String> {
out.push_str(ARCHETYPE.trim_end());
out.push_str("\n\n");
-
let tools = render_tools(ctx)?;
if !tools.trim().is_empty() {
out.push_str(tools.trim_end());
diff --git a/crates/openhuman-core/src/tools/orchestrator_tools_tests.rs b/crates/openhuman-core/src/tools/orchestrator_tools_tests.rs
index ef64e8469d..a6cbd7fb6d 100644
--- a/crates/openhuman-core/src/tools/orchestrator_tools_tests.rs
+++ b/crates/openhuman-core/src/tools/orchestrator_tools_tests.rs
@@ -128,7 +128,7 @@ fn collects_agentid_entries_and_expands_skills_wildcard_to_deferred_actions() {
// see tinyhumansai/openhuman#1624. Re-add the leading entry
// when the registration in `collect_orchestrator_tools` is
// restored.
- "research", // researcher's delegate_name override
+ "research", // researcher's delegate_name override
"delegate_critic", // critic has no delegate_name → default
// Actions sorted by toolkit, then action name.
"GITHUB_CREATE_ISSUE",