The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(agent): resolve flow builtin prompts by owner rather than actor id
Steven Enamakel51c39a704f1d
diff --git a/crates/openhuman-core/src/agent/prompts/flow_archetype.rs b/crates/openhuman-core/src/agent/prompts/flow_archetype.rsindex 845571f425..52ccd79986 100644--- a/crates/openhuman-core/src/agent/prompts/flow_archetype.rs+++ b/crates/openhuman-core/src/agent/prompts/flow_archetype.rs@@ -1,7 +1,7 @@//! Scoped TinyFlows archetype prompt loading for the two flow builtins.use anyhow::{anyhow, ensure, Result};-use tinyagents_definition::{DefinitionSource, PromptSource};+use tinyagents_definition::PromptSource;use crate::{agent::harness::host_definition::AgentDefinition, config::Config};@@ -10,9 +10,7 @@ use crate::{agent::harness::host_definition::AgentDefinition, config::Config};/// User definitions and static/session prompt overrides keep their own source/// and never cause a TinyFlows module lookup, even when they reuse a builtin id.pub(crate) fn is_bus_backed_builtin(definition: &AgentDefinition) -> bool {- matches!(&definition.source, DefinitionSource::Builtin)- && matches!(&definition.system_prompt, PromptSource::Dynamic(()))- && matches!(definition.id.as_str(), "workflow_builder" | "flow_discovery")+ prompt_owner(definition).is_some()}/// Prompt owner stamped by the builtin loader and preserved by cloned specs.diff --git a/crates/openhuman-core/src/agent/prompts/flow_archetype_tests.rs b/crates/openhuman-core/src/agent/prompts/flow_archetype_tests.rsindex 29398a9a29..50ad00ab2e 100644--- a/crates/openhuman-core/src/agent/prompts/flow_archetype_tests.rs+++ b/crates/openhuman-core/src/agent/prompts/flow_archetype_tests.rs@@ -71,6 +71,15 @@ async fn flow_prompt_fetch_uses_the_copilot_get_prompt_bus_member() {.expect("bus prompt fetch").expect("flow builtin prompt");assert!(!text.trim().is_empty(), "{id} prompt must be nonempty");++ let mut renamed = definition.clone();+ renamed.id = format!("library_{id}");+ let renamed_text = load_for_definition(Some(&config), &renamed)+ .await+ .expect("renamed builtin fetches its original prompt owner")+ .expect("renamed flow builtin prompt");+ assert_eq!(renamed_text, text, "actor id must not become GetPrompt key");+texts.insert(id, text);}assert_ne!(texts["workflow_builder"], texts["flow_discovery"]);diff --git a/crates/openhuman-embed/src/agent/definition_tests.rs b/crates/openhuman-embed/src/agent/definition_tests.rsindex 737c969664..dafcc852e9 100644--- a/crates/openhuman-embed/src/agent/definition_tests.rs+++ b/crates/openhuman-embed/src/agent/definition_tests.rs@@ -153,6 +153,18 @@ fn base_can_be_named_or_custom_and_unknown_names_are_typed() {));}+#[test]+fn renamed_flow_builtin_keeps_its_original_prompt_owner() {+ let definition = AgentDefinitionSpec::from_base("workflow_builder")+ .into_core("library_workflow_builder")+ .expect("renamed builtin definition");++ assert_eq!(+ definition.extensions.tinyflows_prompt_owner.as_deref(),+ Some("workflow_builder")+ );+}+#[test]fn a_custom_base_does_not_allow_a_wider_tool_scope() {let mut base = AgentDefinitionSpec::new()diff --git a/tests/tinyflows_published_prompt_e2e.rs b/tests/tinyflows_published_prompt_e2e.rsindex 379f5acd24..f4b9a049e1 100644--- a/tests/tinyflows_published_prompt_e2e.rs+++ b/tests/tinyflows_published_prompt_e2e.rs@@ -16,6 +16,7 @@ async fn published_module_prompts_render_through_the_normal_host_path() {let _vite_backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");let _api_key_guard = EnvVarGuard::unset("OPENHUMAN_BACKEND_API_KEY");let _session_guard = EnvVarGuard::unset("OPENHUMAN_BACKEND_SESSION_TOKEN");+ let _storage_guard = EnvVarGuard::unset("OPENHUMAN_STORAGE_URL");let _source_guard = EnvVarGuard::unset("OPENHUMAN_MODULE_SOURCE");let _source_dir_guard = EnvVarGuard::unset("OPENHUMAN_MODULE_SOURCE_DIR");let _tinyflows_source_guard = EnvVarGuard::unset("OPENHUMAN_MODULE_SOURCE_TINYFLOWS");