From 8dbe3d277bfc6a4f331a2a73a28db1c770b81117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com> Date: Sun, 14 Jun 2026 17:04:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:=20FR-R3=20liveEvents=20?= =?UTF-8?q?=E9=99=90=E9=95=BF=E9=98=B2=E5=86=85=E5=AD=98=E8=86=A8=E8=83=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit push 后超 200 条截断保留最近(原无限制,长工作流执行致数组无限增长);来源 fullstack-review §4(待复核→确认) FR-S5 核实降级:ai_approve 无对话归属校验属实,但 UI 隔离+restore 只载当前对话历史限制触发,本地单机低危,降级文档说明 --- src/stores/project.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/stores/project.ts b/src/stores/project.ts index e032be8..d3ba025 100644 --- a/src/stores/project.ts +++ b/src/stores/project.ts @@ -211,6 +211,10 @@ function createStore() { try { // 固时间戳(FR-C1):formattedEvents computed 重算时用事件发生时刻,非当前时刻 state.liveEvents.push({ ...payload, _ts: Date.now() }) + // 限长(FR-R3):防 liveEvents 无限增长撑爆内存,保留最近 200 条 + if (state.liveEvents.length > 200) { + state.liveEvents.splice(0, state.liveEvents.length - 200) + } // 处理人工审批请求 // WorkflowEvent serde tag=type rename_all=snake_case → type='human_approval_request',字段扁平(无 data 包装)(B-03b-R7) if (payload.event?.type === 'human_approval_request') {