fix(memory): handle non-string timestamp and missing role in raw_archive

This commit is contained in:
santhreal
2026-08-01 20:14:28 +08:00
committed by Xubin Ren
parent e152e7bc0b
commit 4c387f6633
2 changed files with 22 additions and 5 deletions
+4 -5
View File
@@ -713,11 +713,10 @@ class MemoryStore:
if tools_used
else ""
)
timestamp = cast(str, message.get("timestamp", "?"))
role = cast(str, message["role"])
lines.append(
f"[{timestamp[:16]}] {role.upper()}{tools}: {content}"
)
raw_timestamp = message.get("timestamp")
timestamp = str(raw_timestamp) if raw_timestamp is not None else "?"
role = str(message.get("role") or "unknown")
lines.append(f"[{timestamp[:16]}] {role.upper()}{tools}: {content}")
return "\n".join(lines)
def raw_archive(