Conversation
A session's transcript is appended to for as long as that session stays open, so the same
path holds more every day the session runs. The skip test was the path alone, which froze
each session at whatever length it happened to be the first night it was scanned.
On this machine one session was stored at 195 messages from a file that had reached 16,379
lines five days later. Nothing downstream could tell: the daily run reported no errors, the
journal simply stopped gaining entries, because the only sessions arriving after that were
subagents and those are not summarized.
A file is now re-read when its modification time is later than the ingest that stored it,
and its session replaced. The comparison is at whole seconds, because the ingest time is
written by datetime('now') and a file written inside the same second as its own ingest is
not a file that grew afterwards.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XewuV2izBAhDPD2gEsGbKf
The timer multiplies the setting by sixty thousand, so the default of 60 is hourly. The settings screen already says minutes and labels the field with it; only this file disagreed, and it made a reader expect a sync a minute. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XewuV2izBAhDPD2gEsGbKf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happens today
ingestSessionsskips a file when its path is already insessions:A transcript is appended to for as long as its session stays open, so the same path holds
more every day that session runs. Once a file has been seen it is never read again, and the
session stays at whatever length it happened to be the first time it was scanned.
Nothing downstream can tell. The run reports no errors, and the sessions that keep arriving
afterwards are mostly subagents, which
groupSessionsByDateAndProjectexcludes — so thejournal simply stops gaining entries and every daily run still exits 0.
Measured on one machine: a session was stored at 195 messages from a file that had
reached 16,379 lines five days later. Journal entries stopped four days before anybody
noticed. After the change that session re-read as 1,082 messages, and main sessions
appeared for the two days the table had been missing.
What this changes
A file already seen is read again when its modification time is later than the ingest that
stored it, and the session is replaced.
The replacing path is the one
--forcealready used: the duplicate-id guard and thedelete-then-insert inside the transaction both now key off
replacingrather thanforce.No new machinery.
Two details worth naming:
datetime('now')writes UTC without a zone, soingested_atis parsed as UTC explicitly.Comparing milliseconds against seconds reads any file written in the same second as its own
ingest as newer than it, and re-reads it forever. The existing
skips already-ingested sessionstest catches that.Also
README.mdsaidauto_sync_intervalis seconds.startTimermultiplies it by60 * 1000,and the settings screen already says minutes and labels the field with it. Only the README
disagreed, and it made a reader expect a sync a minute rather than an hour.
Tests
One added: a fixture is ingested, a real message appended, its mtime pushed past the ingest,
and the session asserted to be re-read, to have grown, and to have been replaced rather than
duplicated.
bun run checkpasses: 95 tests, typecheck clean.