Skip to content

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

chore(core): remove unused memory-related modules and simplify builtin agent tests

Steven Enamakel23582bb3d912
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 62a76897ab..3041990cdf 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
@@ -34,43 +34,15 @@ fn presentation_agent_absent_when_documents_off() {
);
}
-#[test]
-fn automatic_memory_agents_do_not_expose_call_memory_agent() {
- for def in load_builtins().expect("built-in TOML must parse") {
- if def.trigger_memory_agent != TriggerMemoryAgent::Always {
- continue;
- }
-
- let exposes_call_memory_agent = match &def.tools {
- ToolScope::Named(tools) => tools.iter().any(|tool| tool == "call_memory_agent"),
- ToolScope::Wildcard => false,
- };
-
- assert!(
- !exposes_call_memory_agent,
- "{} uses trigger_memory_agent but still exposes call_memory_agent",
- def.id
- );
- assert!(
- !def.subagents
- .iter()
- .any(|entry| matches!(entry, SubagentEntry::AgentId(id) if id == "agent_memory")),
- "{} uses trigger_memory_agent but still lists agent_memory in subagents",
- def.id
- );
- }
-}
-
#[test]
fn trigger_reactor_has_agentic_hint_and_narrow_tools() {
let def = find("trigger_reactor");
assert!(matches!(def.model, ModelSpec::Hint(ref h) if h == "agentic"));
match &def.tools {
ToolScope::Named(tools) => {
- assert!(!tools.iter().any(|t| t == "call_memory_agent"));
assert!(
- tools.iter().any(|t| t == "memory_store"),
- "trigger_reactor needs memory_store"
+ tools.iter().any(|t| t == "memory"),
+ "trigger_reactor needs the memory tool"
);
// A worker with no `[subagents]` allowlist can never dispatch a
// spawn, so listing the tool only advertised a dead route.
@@ -180,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, LearnedContextData, 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();
@@ -196,14 +166,10 @@ fn every_builtin_has_a_prompt_body() {
tools: &empty_tools,
workflows: &[],
dispatcher_instructions: "",
- learned: LearnedContextData::default(),
visible_tool_names: &empty_visible,
tool_call_format: ToolCallFormat::PFormat,
connected_integrations: &empty_integrations,
connected_identities_md: String::new(),
- include_profile: false,
- include_memory_md: false,
- curated_snapshot: None,
user_identity: None,
personality_roster: vec![],
agents_md_global: None,
@@ -333,7 +299,6 @@ fn master_agent_has_coding_hint_and_named_tools() {
!tools.iter().any(|t| t == "spawn_subagent"),
"spawn_subagent must not appear — removed in #1141"
);
- assert!(!tools.iter().any(|t| t == "call_memory_agent"));
// The Master Agent owns the ordinary coding loop directly.
// Keep its mutation surface intentionally small: one patch
// mechanism for existing files, file_write for new files,
@@ -371,27 +336,17 @@ fn master_agent_has_coding_hint_and_named_tools() {
"Master Agent must have direct inspect tool `{direct}`"
);
}
- // The unified `memory` tool handles direct recall, keyword
- // search, writes, and forgetting without a sub-agent round-trip.
- // Preferences retain their dedicated direct tool.
- for direct in ["memory", "save_preference"] {
- assert!(
- tools.iter().any(|t| t == direct),
- "orchestrator must have direct memory tool `{direct}` (#4762)"
- );
- }
+ // Direct memory surface: recall/store are the product's core and
+ // must be one first-class direct tool, not a sub-agent spawn
+ // (over-delegation, #4744).
+ assert!(
+ tools.iter().any(|t| t == "memory"),
+ "orchestrator must have the direct `memory` tool"
+ );
}
ToolScope::Wildcard => panic!("orchestrator must have named tool allowlist"),
}
- // #6958: a coding turn routinely needs 50-180 model calls (every other
- // harness on the DeepSWE sample did); 50 stopped all ten tasks before a
- // single source edit.
- assert_eq!(def.max_iterations, 200);
- // Memory retrieval is on-demand (via the `agent_memory` subagent,
- // surfaced as `delegate_retrieve_memory`), not an eager pre-turn
- // pre-fetch. The allowlist entry is what makes that route reachable
- // (see the `agent_memory::tools` allowlist gate).
- assert_eq!(def.trigger_memory_agent, TriggerMemoryAgent::Never);
+ assert_eq!(def.max_iterations, 50);
assert!(
!def.omit_memory_context,
"the user-facing agent opens new sessions with the memory context"
@@ -532,26 +487,6 @@ fn planner_has_readonly_mcp_discovery_not_execute() {
}
}
-/// The archivist is registered but deliberately not a chat delegate: the
-/// post-commit session-memory extraction runs it by id
-/// (`runtime_session.rs`), and a delegate would add its schema to every turn.
-#[test]
-fn the_orchestrator_does_not_delegate_to_the_archivist() {
- let orchestrator = find("orchestrator");
- assert!(
- !orchestrator
- .subagents
- .iter()
- .any(|entry| matches!(entry, SubagentEntry::AgentId(id) if id == "archivist")),
- "`archivist` is back on the orchestrator's subagent list"
- );
- assert_eq!(
- find("archivist").id,
- "archivist",
- "archivist must stay registered"
- );
-}
-
/// The specialists the inline skills replaced must not come back as
/// orchestrator delegates, and the ones kept for workflow runs must not
/// become chat delegates.
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware.rs b/crates/openhuman-core/src/agent/tinyagents/middleware.rs
index a356a065e2..a90db76d97 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware.rs
@@ -29,14 +29,10 @@ mod cli_rpc_only;
mod cost_budget;
mod credential_scrub;
mod embedder_hooks;
-mod fetched_site;
mod loop_guards;
-mod memory_protocol;
-mod nudge_injector;
mod packed_tool_route;
mod repeated_failure;
mod research_budget;
-mod shell_turn_budget;
mod tool_exposure;
mod tool_outcome_capture;
mod tool_output;
@@ -50,11 +46,9 @@ pub(crate) use cost_budget::CostBudgetMiddleware;
pub(crate) use credential_scrub::credential_scrub_middleware;
pub(crate) use embedder_hooks::EmbedderToolHooksMiddleware;
pub(crate) use loop_guards::is_repeat_call_exempt;
-pub use memory_protocol::memory_protocol_middleware;
pub(crate) use packed_tool_route::PackedToolRouteMiddleware;
pub(crate) use repeated_failure::RepeatedToolFailureMiddleware;
pub(crate) use research_budget::ResearchBudgetMiddleware;
-pub(crate) use shell_turn_budget::install_time_notes;
pub(crate) use tool_exposure::OpenHumanToolExposureShadowMiddleware;
pub(crate) use tool_outcome_capture::ToolOutcomeCaptureMiddleware;
pub(crate) use tool_policy::ToolPolicyMiddleware;
diff --git a/crates/openhuman-core/src/config/mod.rs b/crates/openhuman-core/src/config/mod.rs
index ab72f061a0..4422ca89bd 100644
--- a/crates/openhuman-core/src/config/mod.rs
+++ b/crates/openhuman-core/src/config/mod.rs
@@ -9,7 +9,6 @@
pub mod app_env;
pub mod daemon;
-pub mod migration_helpers;
pub mod migrations;
pub mod ops;
pub mod schema;
@@ -47,21 +46,18 @@ pub use schema::{
CurlConfig, DashboardConfig, DecisionModel, DelegateAgentConfig, DiagramViewerConfig,
DictationActivationMode, DictationConfig, DiscordConfig, DockerRuntimeConfig, EmailConfig,
EmbeddingRouteConfig, GitbooksConfig, HttpHeader, HttpRequestConfig, IMessageConfig,
- IntegrationToggle, IntegrationsConfig, LarkConfig, LearningConfig, LegacySearchInputs,
- LinqConfig, LlmBackend, LocalAiConfig, LocalJailConfig, MatrixConfig, McpAuthConfig,
- McpClientConfig, McpClientIdentityConfig, McpServerConfig, McpToolExposure, MemoryConfig,
- MemoryTreeConfig, ModelRouteConfig, MultimodalConfig, MultimodalFileConfig,
- ObservabilityConfig, OrchestratorModelConfig, PrivacyConfig, PrivacyMode, ProxyConfig,
- ProxyScope, ReflectionSource, ReliabilityConfig, ResourceLimitsConfig, RuntimeConfig,
+ IntegrationToggle, IntegrationsConfig, LarkConfig, LegacySearchInputs, LinqConfig,
+ LocalAiConfig, MatrixConfig, McpAuthConfig, McpClientConfig, McpClientIdentityConfig,
+ McpServerConfig, McpToolExposure, MemoryConfig, ModelRouteConfig, MultimodalConfig,
+ MultimodalFileConfig, ObservabilityConfig, OrchestratorModelConfig, PrivacyConfig, PrivacyMode,
+ ProxyConfig, ProxyScope, ReliabilityConfig, ResourceLimitsConfig, RuntimeConfig,
RuntimePoolConfig, RuntimePoolLangConfig, SandboxBackend, SandboxConfig, SchedulerConfig,
SchedulerGateConfig, SchedulerGateMode, SearchConfig, SearchEngineCredentials,
SearchPresentation, SearchProviderSettings, SearchRoute, SearxngConfig, SecretsConfig,
- SecurityConfig, ShellConfig, SlackConfig, StorageConfig, StorageProviderConfig,
- StorageProviderSection, StreamMode, SttEngine, TeamModelConfig, TelegramConfig,
- TokenjuiceConfig, UpdateConfig, UpdateRestartStrategy, VoiceActivationMode, VoiceServerConfig,
- WebSearchConfig, WebhookConfig, YuanbaoConfig, DEFAULT_CLOUD_LLM_MODEL,
- DEFAULT_MEMORY_SYNC_INTERVAL_SECS, DEFAULT_MODEL, LEGACY_TIER_MODELS,
- MANAGED_MULTIMODAL_MODELS, MANAGED_SEARCH_PROVIDERS, MEMORY_SYNC_INTERVAL_PRESETS_SECS,
+ SecurityConfig, ShellConfig, SlackConfig, StreamMode, SttEngine, TeamModelConfig,
+ TelegramConfig, TokenjuiceConfig, UpdateConfig, UpdateRestartStrategy, VoiceActivationMode,
+ VoiceServerConfig, WebSearchConfig, WebhookConfig, YuanbaoConfig, DEFAULT_MODEL,
+ LEGACY_TIER_MODELS, MANAGED_MULTIMODAL_MODELS, MANAGED_SEARCH_PROVIDERS,
MODEL_IMAGE_GENERATION_AGENT, MODEL_MANAGED_DEFAULT, MODEL_MEDIA_UNDERSTANDING,
MODEL_VIDEO_GENERATION_AGENT, SEARCH_ENGINE_BRAVE, SEARCH_ENGINE_DISABLED, SEARCH_ENGINE_EXA,
SEARCH_ENGINE_MANAGED, SEARCH_ENGINE_PARALLEL, SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY,