Commit graph

9 commits

Author SHA1 Message Date
Darkatse
c9b380aa70 refactor(chat): unify payload and metadata commit sessions
Route full saves and metadata updates through one bounded commit protocol,
with session-owned staging and atomic publication that preserves message bytes.
Simplify behavioral coverage and keep documentation focused on core contracts.
2026-10-01 00:53:02 -04:00
sun19970908
84807b53d4
fix(storage): stream chat summary index snapshots to bound peak memory (#305)
* fix(storage): stream chat summary index snapshots to bound peak memory

The chat summary index buffered the whole metadata-heavy snapshot in memory: flushing deep-cloned every cached ChatSearchResult (including unbounded chat_metadata Value trees) and serialized it into a single Vec<u8>, so the original tree, the clone and the serialized bytes were alive at the same time. On Android, a 118 MB index file made this flush allocate gigabytes within seconds and abort in a tokio worker (memory allocation failed, SIGABRT, no panic visible to users). Related to #215.

The snapshot is now a streamed JSONL document (schema v4): reading parses line by line, writing encodes each entry by reference into a bounded chunk written asynchronously, and the index is published via the standard sync + atomic rename helper. Peak memory is bounded by a single cached entry. Incompatible or corrupt index files are dropped and rebuilt from cold scans, as before.

* fix(storage): keep chat metadata out of summary caches

Cache lightweight directory projections and load full metadata only on request.
Unify header metadata and identity reads, and publish versioned index snapshots
without cloning payloads.

Validation: pnpm run check; native large-metadata allocation measurements.

---------

Co-authored-by: Darkatse <39111369+Darkatse@users.noreply.github.com>
2026-09-30 22:48:53 -04:00
Darkatse
0a58a87128 feat(settings): expose opt-in cold swipe loading
Add a disabled-by-default setting with reload semantics and localized help. Document the cold representation, ownership, and save compatibility contracts.
2026-09-13 04:53:10 -04:00
Darkatse
b78237c058 fix(search): preserve punctuation-only queries 2026-08-12 01:37:57 -04:00
Darkatse
02fef97f44 feat(chat): persist tool calls as first-class messages 2026-08-06 00:11:16 -04:00
Darkatse
a16f1d2f56 refactor(chat): remove windowed mode and restore full-history semantics 2026-07-19 20:57:41 -04:00
Darkatse
5737d9fdca feat(chat api): Add updateJson() and renameKey() to the chat store API. 2026-04-02 01:14:21 -04:00
Darkatse
36410f8bf5 doc: update TauriTavern Chat API Documents 2026-03-20 21:39:20 -04:00
Darkatse
6fe1c0a20a feat (api): Added a dedicated TauriTavern chat API, to facilitate use by authors of memory-related extensions. 2026-03-20 20:01:33 -04:00