mirror of
https://github.com/bal-spec/sillytavern-character-memory.git
synced 2026-08-17 20:43:52 +00:00
SillyTavern copies chat_metadata into a new branch or checkpoint — saveChat
merges `{ ...chat_metadata, ...withMetadata }` (public/script.js:7347) — so
lastExtractedIndex arrives intact and the `lastIdx >= 0` guard on the
stale-metadata check holds.
But per-chat memory filenames embed the chat ID, and a freshly created branch
has a NEW chat ID, so it never has a memory file of its own. The check read
that as "no memories anywhere", concluded the metadata was stale, and reset
lastExtractedIndex to -1 — forcing a full re-extraction of every copied
message. Reported in #16.
Reproduced against SillyTavern 1.18.0 with a 1000-message chat: branching at
message 500 with perChat on reset the pointer 500 -> -1 and marked all 501
messages unextracted. With perChat off the pointer survived, which is what
made this look unreproducible — the shared file is found regardless of chat ID.
shouldSkipStaleMetadataReset() now also skips when the chat is a branch and
per-chat storage is on. Verified live: same branch now preserves the pointer,
and a genuinely stale non-branch chat still resets as before.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| __mocks__ | ||
| fixtures | ||
| integration | ||
| unit | ||