sillytavern-character-memory/test
bal-spec 572af212bd fix: don't reset the extraction pointer on branches under per-chat storage
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>
2026-07-31 23:56:26 -07:00
..
__mocks__ feat: add i18n support with Traditional Chinese locale 2026-03-20 07:39:48 -07:00
fixtures v2.1.6 — UX redesign, injection viewer, unified editor, token breakdown 2026-03-07 15:20:14 -08:00
integration test: fix chunked-consolidation live test never testing chunking 2026-07-28 23:07:09 -07:00
unit fix: don't reset the extraction pointer on branches under per-chat storage 2026-07-31 23:56:26 -07:00