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);