You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 743556f
Browse filesBrowse the repository at this point in the historyBrowse files
authored and
Chris Zhang
committed
fix(memory-core): index cron runId so mirror transcripts skip dreaming corpus
cron runs sometimes leave a second transcript whose basename equals the
runId embedded in the sessionKey, distinct from `entry.sessionId`. With
classification only indexing `entry.sessionId`, that mirror file looks
like an unowned orphan: `lookupSessionKeyForTranscriptPath` returns null,
`isCronRunTranscriptPath` returns false, and the file's content slips
into the dreaming session corpus despite the operator's
`agent:<id>:cron:` prefix exclusion.
Add `extractCronRunIdFromSessionKey` in `src/sessions/session-key-utils.ts`
and let `loadSessionTranscriptClassificationForSessionsDir` register the
extracted runId in both `cronRunSessionIds` and (when not already taken)
`sessionIdToSessionKey`. This makes the existing sessionId-fallback in
`extractSessionIdFromTranscriptFileName` recognize mirror files —
including their `.deleted.<ts>` / `.reset.<ts>` rotated variants — as
cron-owned, so dreaming auto-skips them via `generatedByCronRun` even
without operator-supplied `excludeSessionKeyPrefixes`.
Tests: `session-key-utils.test.ts` covers the extractor's accept/reject
boundary and asserts agreement with `isCronRunSessionKey`.
`session-files.test.ts` adds two regression cases:
- a mirror transcript named after the runId (live + rotated) resolves
back to the cron sessionKey and is reported as cron-owned;
- a registered explicit-session entry whose sessionId collides with some
cron's runId is not overwritten by the runId fallback.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
0 commit comments