Skip to content

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

feat(memory): advertise hosted memory's families and gate coding sessions on their own

Shanu8d1ae1abf590
diff --git a/app/src/pages/Brain.tsx b/app/src/pages/Brain.tsx
index b5d3955966..5608ba18a6 100644
--- a/app/src/pages/Brain.tsx
+++ b/app/src/pages/Brain.tsx
@@ -435,7 +435,10 @@ export default function Brain() {
{activeTab === 'sources' && (
<div className="space-y-5 animate-fade-up">
<MemoryEngineRow />
- <MemoryFamilyGate family="sources">
+ {/* Coding sessions are a family of their own: an engine
+ can accept synced items without reading local agent
+ transcripts (hosted memory does exactly that). */}
+ <MemoryFamilyGate family="coding_sessions">
<CodingSessionsCard onToast={addToast} />
</MemoryFamilyGate>
<MemoryFamilyGate family="sources">
diff --git a/app/src/pages/__tests__/Brain.test.tsx b/app/src/pages/__tests__/Brain.test.tsx
index b3b9e94645..2ae673fc98 100644
--- a/app/src/pages/__tests__/Brain.test.tsx
+++ b/app/src/pages/__tests__/Brain.test.tsx
@@ -200,18 +200,18 @@ describe('Brain page', () => {
expect(screen.queryByTestId('brain-sync-activity-card')).toBeNull();
});
- // A remote engine without the Sources family (hosted CortexDB) has no
+ // A remote engine without the Sources family (a direct CortexDB) has no
// `memory_sources.*` RPCs at all: the sync panels must say so rather than
// render and fail.
it('shows the sync panels as unavailable on an engine without sources', async () => {
graphExportMock.mockResolvedValue(makeGraph(0));
- engineMock.get.mockResolvedValue({ driver: 'tinyhumans' });
+ engineMock.get.mockResolvedValue({ driver: 'cortex' });
engineMock.list.mockResolvedValue({
- active: 'tinyhumans',
+ active: 'cortex',
engines: [
{
- id: 'tinyhumans',
- label: 'CortexDB (via TinyHumans)',
+ id: 'cortex',
+ label: 'CortexDB',
capabilities: ['core', 'recall', 'portability', 'answer'],
},
],
@@ -225,4 +225,32 @@ describe('Brain page', () => {
expect(screen.queryByTestId('brain-sync-activity')).toBeNull();
expect(screen.queryByTestId('brain-sync-activity-card')).toBeNull();
});
+
+ // Hosted memory accepts synced items but reads no local agent transcripts:
+ // the sources registry renders, the coding-sessions card says it is not
+ // available instead of calling an RPC the engine refuses.
+ it('gates the coding sessions card on its own family', async () => {
+ graphExportMock.mockResolvedValue(makeGraph(0));
+ engineMock.get.mockResolvedValue({ driver: 'tinyhumans' });
+ engineMock.list.mockResolvedValue({
+ active: 'tinyhumans',
+ engines: [
+ {
+ id: 'tinyhumans',
+ label: 'CortexDB (via TinyHumans)',
+ capabilities: ['core', 'recall', 'portability', 'answer', 'sources', 'documents'],
+ },
+ ],
+ });
+ await act(async () => {
+ renderWithProviders(<Brain />, { initialEntries: ['/?tab=sources'] });
+ });
+ await waitFor(() => {
+ const gated = screen
+ .getAllByTestId('memory-family-unavailable')
+ .map(node => node.getAttribute('data-family'));
+ expect(gated).toContain('coding_sessions');
+ expect(gated).not.toContain('sources');
+ });
+ });
});
diff --git a/crates/openhuman-core/src/memory/ops/engine.rs b/crates/openhuman-core/src/memory/ops/engine.rs
index a00664f95a..92cc5a139d 100644
--- a/crates/openhuman-core/src/memory/ops/engine.rs
+++ b/crates/openhuman-core/src/memory/ops/engine.rs
@@ -133,13 +133,27 @@ fn expected_capabilities(id: &str) -> Vec<String> {
}
"mem0" => &[C::ConversationIngest, C::Graph],
"cognee" => &[C::Graph],
- "cortex" | "tinyhumans" => &[
+ "cortex" => &[
C::DocumentIngest,
C::ConversationIngest,
C::LearningIngest,
C::EventIngest,
C::Answer,
],
+ // The direct wire's families, plus the ones only the hosted wire serves
+ // (tinymemory `docs/specs/tinyhumans-hosted-families.md`).
+ "tinyhumans" => &[
+ C::DocumentIngest,
+ C::ConversationIngest,
+ C::LearningIngest,
+ C::EventIngest,
+ C::Answer,
+ C::Goals,
+ C::ToolMemory,
+ C::Documents,
+ C::Sources,
+ C::Maintenance,
+ ],
_ => &[],
};
caps.extend(extra.iter().map(|c| c.as_str()));
diff --git a/crates/openhuman-core/src/memory/ops/engine_tests.rs b/crates/openhuman-core/src/memory/ops/engine_tests.rs
index 5063567026..fda5ab1608 100644
--- a/crates/openhuman-core/src/memory/ops/engine_tests.rs
+++ b/crates/openhuman-core/src/memory/ops/engine_tests.rs
@@ -61,6 +61,22 @@ fn every_remote_engine_is_listed_with_at_least_the_mandatory_families() {
assert!(hosted.hosted);
assert!(!hosted.needs_key);
assert!(hosted.capabilities.iter().any(|c| c == "answer"));
+ // The families only the hosted wire serves (tinymemory
+ // `docs/specs/tinyhumans-hosted-families.md`); a direct CortexDB has none.
+ for family in ["goals", "tool_memory", "documents", "sources", "maintenance"] {
+ assert!(
+ hosted.capabilities.iter().any(|c| c == family),
+ "tinyhumans must advertise {family}: {:?}",
+ hosted.capabilities
+ );
+ if let Some(direct) = engines.iter().find(|e| e.id == "cortex") {
+ assert!(
+ !direct.capabilities.iter().any(|c| c == family),
+ "cortex must not advertise {family}: {:?}",
+ direct.capabilities
+ );
+ }
+ }
}
#[test]