From 9df73a200acaf78f11fc6f883a22ac3b2bc89a97 Mon Sep 17 00:00:00 2001 From: Linghong Date: Wed, 16 Sep 2026 06:35:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=BF=9B=E8=A1=8C=E4=B8=AD?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E8=B0=83=E7=94=A8=E8=80=97=E6=97=B6=E8=AE=A1?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优先使用运行快照的时间差,缺少更新时间时才回退到本地时钟。 同步执行过程测试使用当前回合标识。 --- .../src/features/project-workspace/ToolCallGroup.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src/features/project-workspace/ToolCallGroup.tsx b/apps/ai-game-creator-shell/src/features/project-workspace/ToolCallGroup.tsx index 9396c17df..ec2ab047a 100644 --- a/apps/ai-game-creator-shell/src/features/project-workspace/ToolCallGroup.tsx +++ b/apps/ai-game-creator-shell/src/features/project-workspace/ToolCallGroup.tsx @@ -76,7 +76,17 @@ export function ToolCallGroup({ // min(startedAt) → max(updatedAt),不掺入本地时钟。 const totalDurationMs = running ? startedAt > 0 - ? Math.max(0, Date.now() - startedAt) + ? (() => { + const latestUpdatedAt = Math.max( + ...orderedCalls.map((call) => call.updatedAt || 0), + ); + // A running snapshot can still carry a monotonic update time. Use + // that delta when available; fall back to wall-clock elapsed time + // for live events that have no update timestamp yet. + return latestUpdatedAt > startedAt + ? latestUpdatedAt - startedAt + : Math.max(0, Date.now() - startedAt); + })() : null : turnToolCallDurationMs(orderedCalls); const durationText = formatTurnDuration(totalDurationMs);