ab-replay: write_note로 생긴 intraday-notes 흔적도 정리

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
kimandClaude Sonnet 5.5 committed 2026-10-17 18:19:41 +09:00
1 parent f25dbde2fe
commit a3b8734cc7
1 file changed
+8
+8
View File
@@ -102,6 +102,8 @@ def main():
today = datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d")
daily = os.path.join(USER_DIR, "workspace", "memory", today + ".md")
before = open(daily, "rb").read() if os.path.exists(daily) else None
notes = os.path.join(USER_DIR, "workspace", "memory", today + "-intraday-notes.md")
notes_before = open(notes, "rb").read() if os.path.exists(notes) else None # 모델이 write_note로 남긴 흔적 정리용
token = login()
if not token:
@@ -116,6 +118,12 @@ def main():
for p in glob.glob(os.path.join(USER_DIR, "**", "ab_*.json"), recursive=True):
try: os.remove(p)
except OSError: pass
if os.path.exists(notes):
cur = open(notes, "rb").read()
if notes_before is None:
os.remove(notes)
elif cur.startswith(notes_before):
open(notes, "wb").write(notes_before)
if before is not None and os.path.exists(daily):
now = open(daily, "rb").read()
if now.startswith(before):