From 4c33f210da64b78deb9d02a4a004435676de4e36 Mon Sep 17 00:00:00 2001 From: john Date: Sat, 1 Aug 2026 21:37:02 +0800 Subject: [PATCH] fix(memory-v2): align Runtime Control section enabled badge with active switches. Runtime control has no top-level enabled field; derive section status from agent resolve, injection mode, and lifecycle flags so the admin page matches saved production config. Co-authored-by: Cursor --- src/admin/pages/MemoryV2Page.tsx | 8 ++++--- src/admin/pages/memory-v2-config.ts | 34 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/admin/pages/memory-v2-config.ts diff --git a/src/admin/pages/MemoryV2Page.tsx b/src/admin/pages/MemoryV2Page.tsx index 51f2a19..770ee57 100644 --- a/src/admin/pages/MemoryV2Page.tsx +++ b/src/admin/pages/MemoryV2Page.tsx @@ -16,6 +16,7 @@ import type { MemoryV2RuntimeStatusResponse, PersonalMemoryCandidateListResponse, } from '../../types'; +import { isMemoryV2SectionEnabled } from './memory-v2-config'; type BackendKey = | 'pgvector' @@ -923,7 +924,8 @@ export function MemoryV2Page() { {CAPABILITIES.map((capability, index) => { const section = draft[capability.key]; const currentSection = current[capability.key]; - const enabled = Boolean(section.enabled); + const enabled = isMemoryV2SectionEnabled(capability.key, section); + const savedEnabled = isMemoryV2SectionEnabled(capability.key, currentSection); const accent = BACKEND_ACCENTS[index % BACKEND_ACCENTS.length]; return (
)} - - 当前保存:{Boolean(currentSection.enabled) ? '启用' : '关闭'} + + 当前保存:{savedEnabled ? '启用' : '关闭'}