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(memory): bridge the four defaulted module members instead of refusing\n\n`MemorySourceSync::run_source_sync`, `bootstrap_connection` and\n`is_toolkit_syncable`, and `MemoryMaintenance::diagnose`, each carry a default\nbody that returns `Unsupported`. `ModuleMemoryProvider` implemented every\nrequired member and silently inherited all four defaults, so each call was\nanswered by the default rather than dispatched to the module.\n\nA defaulted trait member cannot break an implementor at compile time, which is\nwhy this was invisible: when the members were added to the contract the bridge\nkept compiling and began refusing at runtime.\n\nThe pinned artifact serves all four. They are declared in the module's METHODS\nlist (tinymemory-module/src/lib.rs:774) and their wire names are canonical bus\nconstants (tinymemory-bus/src/names.rs:287-300). The host simply never sent the\ncall: before this change `grep -rn RunSourceSync src/` returned nothing.\n\nSymptom: the manual "Sync now" / "All in" button failed for every source with\n`unsupported capability: source_sync`, while the module's own scheduler kept\ningesting normally because it runs inside the module and never crosses this\nbridge.\n\nThe capability list is untouched. It was already correct: `as_source_sync()`\nreturned `Some` and the refusal came one call later.\n\nCloses #5801\n
M3gA-Mind5d377716bf12
diff --git a/src/openhuman/modules/memory.rs b/src/openhuman/modules/memory.rsindex e91bbfbfe5..887e81c74b 100644--- a/src/openhuman/modules/memory.rs+++ b/src/openhuman/modules/memory.rs@@ -167,13 +167,14 @@ use tinymemory_api::provider::types::{};use tinymemory_api::provider::{AddressBookSeedOutcome, ChunkDetail, ChunkEmbedding, ChunkListRow, ChunkQuery,- ConversationSegment, CoverWindowQuery, EntityMatch, EpisodicEvent, EpisodicTurn, FacetType,- FastRetrieveQuery, MemoryChunks, MemoryCodingSessions, MemoryCore, MemoryDiff, MemoryDocuments,- MemoryEntities, MemoryEpisodic, MemoryGoals, MemoryGraph, MemoryIngest, MemoryMaintenance,- MemoryPeople, MemoryPortability, MemoryProfile, MemoryProvider, MemoryRecall, MemoryRetrieval,- MemorySourceSink, MemorySourceSync, MemoryToolMemory, MemoryTree, PersonHandle,- PersonInteraction, PersonRecord, PersonScore, ProfileFacet, RankedPerson, ResolvedPerson,- RetrievalHit, RetrievalResponse, SourceRetrievalQuery, SourceTotal, UserState,+ ConversationSegment, CoverWindowQuery, Diagnosis, EntityMatch, EpisodicEvent, EpisodicTurn,+ FacetType, FastRetrieveQuery, MemoryChunks, MemoryCodingSessions, MemoryCore, MemoryDiff,+ MemoryDocuments, MemoryEntities, MemoryEpisodic, MemoryGoals, MemoryGraph, MemoryIngest,+ MemoryMaintenance, MemoryPeople, MemoryPortability, MemoryProfile, MemoryProvider,+ MemoryRecall, MemoryRetrieval, MemorySourceSink, MemorySourceSync, MemoryToolMemory,+ MemoryTree, PersonHandle, PersonInteraction, PersonRecord, PersonScore, ProfileFacet,+ RankedPerson, ResolvedPerson, RetrievalHit, RetrievalResponse, SourceRetrievalQuery,+ SourceTotal, UserState,};use tinymemory_api::recall::OwnedRecallOpts;use tinymemory_api::tool_memory::ToolMemoryRule;@@ -1079,6 +1080,9 @@ impl MemoryMaintenance for ModuleMemoryProvider {async fn purge_all(&self) -> Result<PurgeOutcome, MemoryError> {module_call!(self, "purge_all", "PurgeAll", ())}+ async fn diagnose(&self) -> Result<Diagnosis, MemoryError> {+ module_call!(self, "diagnose", "Diagnose", ())+ }}#[async_trait]@@ -1095,6 +1099,24 @@ impl MemorySourceSync for ModuleMemoryProvider {(toolkit, connection_id))}+ async fn run_source_sync(&self, source_id: &str) -> Result<SyncRunOutcome, MemoryError> {+ module_call!(self, "run_source_sync", "RunSourceSync", (source_id,))+ }+ async fn bootstrap_connection(+ &self,+ toolkit: &str,+ connection_id: &str,+ ) -> Result<(), MemoryError> {+ module_call!(+ self,+ "bootstrap_connection",+ "BootstrapConnection",+ (toolkit, connection_id)+ )+ }+ async fn is_toolkit_syncable(&self, toolkit: &str) -> Result<bool, MemoryError> {+ module_call!(self, "is_toolkit_syncable", "IsToolkitSyncable", (toolkit,))+ }async fn source_sync_state(&self,toolkit: &str,diff --git a/src/openhuman/modules/memory_tests.rs b/src/openhuman/modules/memory_tests.rsindex 0713121eeb..0b6863bae4 100644--- a/src/openhuman/modules/memory_tests.rs+++ b/src/openhuman/modules/memory_tests.rs@@ -414,3 +414,65 @@ fn the_ingest_bus_grace_is_wide_enough_to_order_the_two_timers() {reliably order the RPC's timeout ahead of the bus deadline");}++/// Every `MemorySourceSync` and `MemoryMaintenance` member the trait defaults+/// must be bridged to the module rather than left to inherit the default.+///+/// Three of these members carry a default body that returns+/// `Unsupported(SourceSync)`, and `diagnose` one that returns+/// `Unsupported(Maintenance)`. A defaulted member cannot break an implementor at+/// compile time, so when they were added to the contract `ModuleMemoryProvider`+/// kept compiling and silently began refusing — which is #5801: the manual+/// "Sync now" button answered `unsupported capability: source_sync` while the+/// module's own scheduler, which never crosses this bridge, kept syncing fine.+///+/// The discriminator needs no module. With the host disabled, `proxy()` fails+/// with `MemoryError::Other`, so a member that really dispatches through+/// `module_call!` reports `Other` while one that fell through to the default+/// reports `Unsupported`. Asserting "not Unsupported" therefore asserts the+/// dispatch itself, which is the part that was missing.+#[tokio::test]+async fn the_defaulted_members_dispatch_to_the_module_instead_of_refusing() {+ use tinymemory_api::provider::{MemoryMaintenance, MemorySourceSync};++ let mut config = Config::default();+ config.modules.enabled = false;+ let provider = ModuleMemoryProvider::new(Arc::new(config));++ let refused = |label: &str, error: MemoryError| {+ assert!(+ !matches!(error, MemoryError::Unsupported { .. }),+ "{label} answered from the trait default instead of dispatching to the \+ module — the `module_call!` arm is missing, so every caller gets \+ `unsupported capability` however capable the artifact is. Got {error:?}"+ );+ };++ refused(+ "run_source_sync",+ provider+ .run_source_sync("src_whatever")+ .await+ .expect_err("a disabled host cannot succeed"),+ );+ refused(+ "bootstrap_connection",+ provider+ .bootstrap_connection("gmail", "ca_whatever")+ .await+ .expect_err("a disabled host cannot succeed"),+ );+ refused(+ "is_toolkit_syncable",+ provider+ .is_toolkit_syncable("gmail")+ .await+ .expect_err("a disabled host cannot succeed"),+ );+ refused(+ "diagnose",+ MemoryMaintenance::diagnose(&provider)+ .await+ .expect_err("a disabled host cannot succeed"),+ );+}