Fix activity replay after refresh

This commit is contained in:
wuyang6
2026-05-11 21:16:41 +08:00
parent 47f08dba04
commit e89e35c6fd
2 changed files with 14 additions and 5 deletions
@@ -406,13 +406,13 @@ export function toReplayRepository(
if (message.role === "tool") continue;
if (message.role !== "user" && message.role !== "assistant") continue;
const content = cleanStoredContent(message.content ?? "");
if (!content) continue;
if (content.trimStart().startsWith("<system-reminder>")) continue;
const id = `${fallbackSessionId}-${index}`;
const toolParts =
message.role === "assistant"
? toToolParts(message.tool_calls ?? [], toolResults, content)
: [];
if (!content && !toolParts.length) continue;
if (content.trimStart().startsWith("<system-reminder>")) continue;
const id = `${fallbackSessionId}-${index}`;
const shouldShowAssistantText =
message.role !== "assistant" ||
!toolParts.length ||