v0.2.1
What's Changed
Performance
- In-memory embedding cache with TTL — eliminates repeated blob deserialization on every
ctx_searchcall. 60s TTL, invalidated on write/delete/update - FTS pre-filtering for semantic search — narrows cosine similarity candidates from O(N) to O(k) before scoring. Falls back to full scan when FTS returns no matches
- Scoped raw-message cache — compartment trigger evaluation now loads OpenCode's message DB once instead of twice per evaluation
- Cached scoped tag assignments — avoids 16k+ regex iterations per transform pass in long sessions (size-based invalidation)
- WeakMap prepared statement caching — added to storage-tags.ts and storage-ops.ts for consistency
Bug Fixes
- Session cleanup: FTS index data now cleaned on session deletion — prevents unbounded DB growth
- Memory TTL enforcement:
expires_atpredicate added to all active-memory queries — expired memories no longer persist forever - Embedding credential rotation: API key hash included in embedding model identity — provider key changes now trigger re-embedding
- Per-model scheduler threshold:
modelKeythreaded throughscheduler.shouldExecute()— per-modelexecute_threshold_percentagenow applies to queue execution decisions - Compaction transaction:
updateSessionMetamoved inside compaction transaction boundary - Dreamer queue index: Added
idx_dream_queue_pending(started_at, enqueued_at) - Dream timer lifecycle: Timer returns cleanup function, properly unref'd
Refactoring
- Extracted
insertCompartmentRows/insertFactRowshelpers — replaces 4 duplicate INSERT sites - Removed dead exports:
DreamingConfigSchema,DreamingConfig,getQueueSize,hasPendingOps,parseJsoncSafe,createTagContentResolver - Documented intentional patterns to prevent repeat audit noise
Full Changelog: v0.2.0...v0.2.1
Full Changelog: v0.2.0...v0.2.1