Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

Merge origin/main into claim/issue-10495

[._.]/ Adam Eivyc41b3c21f26e
diff --cc server/routes/memory.test.js
index b771ffd35b,132cd457eb..77aa71d479
--- a/server/routes/memory.test.js
+++ b/server/routes/memory.test.js
@@@ -50,22 -46,11 +50,22 @@@ vi.mock('../services/memorySync.js', (
applyRemoteChanges: vi.fn()
}));
- import { ensureBackend, getMemories, getTimeline, archiveMemory, purgeMemory, applyDecay } from '../services/memoryBackend.js';
+ import { ensureBackend, getMemories, getTimeline, archiveMemory, purgeMemory, applyDecay, linkMemories } from '../services/memoryBackend.js';
import { checkHealth } from '../lib/db.js';
import * as memorySync from '../services/memorySync.js';
+import { findRecentRunsUsingMemory } from '../services/memoryRunUsage.js';
describe('Memory Routes', () => {
+ it('GET /:id/runs lists recent runs that used the memory (#10495)', async () => {
+ const app = express();
+ app.use('/api/memory', memoryRoutes);
+ findRecentRunsUsingMemory.mockResolvedValue([{ runId: 'r1', agentId: 'a1' }]);
+ const res = await request(app).get('/api/memory/mem-1/runs');
+ expect(res.status).toBe(200);
+ expect(res.body.runs).toEqual([{ runId: 'r1', agentId: 'a1' }]);
+ expect(findRecentRunsUsingMemory).toHaveBeenCalledWith('mem-1');
+ });
+
let app;
beforeEach(() => {