Align note IDs with todo IDs (6-char hex)

Notes generated 5-char IDs via a 20-try collision loop while todos
generated 6-char IDs in one shot. Mixed widths across the agent's
view made the two tools look unrelated. Match todo's shape — same
length, same one-shot generation. Collision retry is unnecessary at
scan-scale (a few hundred items vs 16^6 keys).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
0xallam
2026-05-24 18:10:57 -07:00
parent bdc3c5470e
commit 940319f28a
+1 -8
View File
@@ -176,14 +176,7 @@ def _create_note_impl(
"note_id": None,
}
note_id = ""
for _ in range(20):
candidate = str(uuid.uuid4())[:5]
if candidate not in _notes_storage:
note_id = candidate
break
if not note_id:
return {"success": False, "error": "Failed to allocate note ID", "note_id": None}
note_id = str(uuid.uuid4())[:6]
timestamp = datetime.now(UTC).isoformat()
note = {