From 0daf40d950e6484584caba7173abd3f90b3299a0 Mon Sep 17 00:00:00 2001 From: john Date: Thu, 10 Sep 2026 09:33:47 +0800 Subject: [PATCH] docs(context): note agent memory shadow setup for fusion E2E Allow custom shadow portal probe messages and document admin-db steps to enable recall_fusion_resolved without turning on active injection. Co-authored-by: Cursor --- docs/context-runtime-local-dev.md | 19 ++++++++++++++++++- .../run-context-runtime-shadow-portal-e2e.mjs | 9 +++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/docs/context-runtime-local-dev.md b/docs/context-runtime-local-dev.md index bffc71d..0c103a9 100644 --- a/docs/context-runtime-local-dev.md +++ b/docs/context-runtime-local-dev.md @@ -74,7 +74,24 @@ node scripts/run-context-runtime-shadow-portal-e2e.mjs # 通过 → CONTEXT_RUNTIME_SHADOW_PORTAL_OK ``` -`recall_fusion_resolved` 在 agent memory 关闭时可能缺失,脚本会 WARN 但不阻断。 +`recall_fusion_resolved` 需要 **agent memory resolve 开启**(admin-db `runtimeControl.agentResolveEnabled=true` + `agentInjectionMode=shadow`,**不要**开 `active` injection)。缺失时脚本 WARN 但不阻断。 + +本地曾用(仅 dev,不入库): + +```bash +# admin-db 写入 shadow resolve(示例 one-shot) +node -e " +import { createDbPool } from './db.mjs'; +import { createMemoryV2AdminConfigService } from './memory-v2-admin-config.mjs'; +const pool = createDbPool(); +const svc = createMemoryV2AdminConfigService(pool); +await svc.updateAdminConfig({ + runtimeControl: { agentResolveEnabled: true, agentInjectionMode: 'shadow' }, + chatIntentRouter: { memoryResolveEnabled: true }, +}, { updatedBy: 'local:context-runtime-shadow' }); +await pool.end(); +" +``` ## 用户自测清单(有 LLM 配额时) diff --git a/scripts/run-context-runtime-shadow-portal-e2e.mjs b/scripts/run-context-runtime-shadow-portal-e2e.mjs index 905691e..b8b0725 100644 --- a/scripts/run-context-runtime-shadow-portal-e2e.mjs +++ b/scripts/run-context-runtime-shadow-portal-e2e.mjs @@ -149,11 +149,16 @@ async function runPortalTurn(pool) { user_message: { id: randomUUID(), role: 'user', - content: [{ type: 'text', text: '帮我搜索一下今天上海的天气,简要回答即可' }], + content: [{ + type: 'text', + text: process.env.MEMIND_SHADOW_E2E_MESSAGE + ?? '你还记得我的偏好吗,一句话回答即可', + }], metadata: { userVisible: true, agentVisible: true, - displayText: 'context runtime shadow agent ping', + displayText: process.env.MEMIND_SHADOW_E2E_DISPLAY + ?? 'context runtime shadow memory ping', }, }, }),