feat(memory): add gated agent recall and lifecycle controls

This commit is contained in:
john
2026-07-16 21:05:27 +08:00
parent c1012da120
commit 6e460336f7
13 changed files with 655 additions and 3 deletions
+19
View File
@@ -33,6 +33,12 @@ test('resolveMemoryV2Policy uses legacy memory flag for backward compatibility',
}).vectorEnabled,
true,
);
const runtimePolicy = resolveMemoryV2Policy({ env: {} });
assert.equal(runtimePolicy.agentResolveEnabled, false);
assert.equal(runtimePolicy.agentInjectionMode, 'off');
assert.deepEqual(runtimePolicy.agentCanaryUserIds, []);
assert.equal(runtimePolicy.agentResolveLimit, 3);
assert.equal(runtimePolicy.promotionEnabled, false);
});
test('legacy backend adapts existing conversation memory service', async () => {
@@ -446,6 +452,19 @@ test('Memory V2 getStatus exposes policy and backend contract details', () => {
eventLogEnabled: true,
vectorEnabled: true,
failOpen: true,
runtimeControl: {
agentResolveEnabled: false,
agentInjectionMode: 'off',
agentCanaryUserIds: [],
agentResolveLimit: 3,
agentResolveTimeoutMs: 1200,
promotionEnabled: false,
compactionV2Enabled: false,
reflectionEnabled: false,
lifecycleWorkerEnabled: false,
lifecycleRolloutMode: 'off',
lifecycleRolloutUserIds: [],
},
backends: [
{
name: 'legacy-conversation-memory',