fix: make drawer_id deterministic for idempotent writes

Remove datetime.now() from drawer_id hash so same content + wing + room
always produces the same ID. This enables the idempotency check that
returns "already_exists" on duplicate writes.
This commit is contained in:
bensig
2026-04-09 08:26:47 -07:00
parent 32297fdae8
commit 0717caea5c
+1 -1
View File
@@ -330,7 +330,7 @@ def tool_add_drawer(
if not col:
return _no_palace()
drawer_id = f"drawer_{wing}_{room}_{hashlib.sha256((content[:100] + datetime.now().isoformat()).encode()).hexdigest()[:24]}"
drawer_id = f"drawer_{wing}_{room}_{hashlib.sha256((wing + room + content[:100]).encode()).hexdigest()[:24]}"
_wal_log(
"add_drawer",