fix: gists show the conversation's real date, not the summarize-run date
Summaries displayed s.created_at (set to now() at summarize time), so every imported gist read 2026-06-16. Derive the actual session date from the earliest exchange timestamp (MIN(created_at) per session — the preserved original date, same source the era rollups use) via a correlated subquery in the summary readers. New Summary.session_started_at field; chat shows it (falling back to created_at). No schema change / backfill needed — always correct from source. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ SUMMARY_K = 3 # other-session gists
|
||||
|
||||
|
||||
def _summary_note(summaries: list[memory.Summary]) -> Message:
|
||||
lines = [f"- ({s.created_at[:10]}) {s.content}" for s in summaries]
|
||||
lines = [f"- ({(s.session_started_at or s.created_at)[:10]}) {s.content}" for s in summaries]
|
||||
body = "Gist of earlier sessions (compacted — ask if you need specifics):\n" + "\n".join(lines)
|
||||
return {"role": "system", "content": body}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user