mirror of
https://github.com/mudler/LocalAI
synced 2026-05-24 09:28:23 +00:00
File-backed persister for chat history. Each user's conversations live
under {baseDir}/{userID}/conversations.json (anonymous/ when auth is
disabled).
Design choices:
- In-memory cache backed by sync.Mutex so concurrent saves don't
interleave writes.
- Atomic write via tmp file + os.Rename so a crash mid-save never
leaves a corrupted history.
- ID validation regex blocks path-traversal payloads at the store
boundary, in addition to the auth context constraint.
Tests cover round-trip persistence across instances, user isolation,
unsafe-ID rejection, bulk replace migration, and the anonymous fallback
path.
Assisted-by: Claude:claude-opus-4-7
Signed-off-by: TLoE419 <tloemizuchizu@gmail.com>
|
||
|---|---|---|
| .. | ||
| advisorylock | ||
| agentpool | ||
| agents | ||
| chathistory | ||
| dbutil | ||
| distributed | ||
| facerecognition | ||
| finetune | ||
| galleryop | ||
| jobs | ||
| mcp | ||
| messaging | ||
| modeladmin | ||
| monitoring | ||
| nodes | ||
| quantization | ||
| skills | ||
| storage | ||
| testutil | ||
| voicerecognition | ||
| worker | ||