fix: use microsecond timestamp and full content hash in diary entry ID (#819)

This commit is contained in:
shafdev
2026-04-14 01:36:04 +05:30
committed by GitHub
parent c9fbf7c50a
commit 5db651a543
2 changed files with 47 additions and 1 deletions
+4 -1
View File
@@ -836,7 +836,10 @@ def tool_diary_write(agent_name: str, entry: str, topic: str = "general"):
return _no_palace()
now = datetime.now()
entry_id = f"diary_{wing}_{now.strftime('%Y%m%d_%H%M%S')}_{hashlib.sha256(entry[:50].encode()).hexdigest()[:12]}"
entry_id = (
f"diary_{wing}_{now.strftime('%Y%m%d_%H%M%S%f')}_"
f"{hashlib.sha256(entry.encode()).hexdigest()[:12]}"
)
_wal_log(
"diary_write",