Safety + import-pipeline patch. Kills the infinite Stop-hook recursion loop that burned Claude Pro tokens on unkeyed installs, repairs every empty viewer tab after import-jsonl, derives lessons and crystals automatically from imported sessions, and opens up OpenAI-compatible embedding endpoints.
Contributors
- @Edison-A-N — #186:
OPENAI_BASE_URL+OPENAI_EMBEDDING_MODELenv vars (unlocks Azure / vLLM / LM Studio for embeddings). - @Tanmay-008 and @tanmaishi — #111 / #179 follow-ups: multimodal image memory (Phase 1 CLIP visual embeddings + vision-search), 500MB disk quota LRU eviction, memory deletion parity, multiple CodeRabbit review passes across the multimodal path.
- @rohitg00 — #187 Stop-hook recursion 5-layer defense, #188 viewer empty-tabs + import pipeline, #189 OpenAI dimensions lookup, #190 README/website refresh, #191 release.
Thanks to everyone. External PRs merged via admin rebase after local verification.
Security
- Stop-hook recursion loop (#187, follow-up to #149). A user with no provider key and
AGENTMEMORY_AUTO_COMPRESS=falsecould still trigger unbounded recursion: Stop hook →/summarize→provider.summarize()→ agent-sdk provider spawned a Claude Agent SDK child session that inherited the same plugin hooks, whose own Stop fired, spawning another child, etc. Fixed at five layers in defense-in-depth:detectProvider()treats empty-string keys as unset and returns thenoopprovider by default. The agent-sdk fallback now requires explicitAGENTMEMORY_ALLOW_AGENT_SDK=trueopt-in.- New
NoopProviderreturns empty strings; callers detect.name === 'noop'and short-circuit. agent-sdkprovider setsAGENTMEMORY_SDK_CHILD=1before spawningquery()and restores the previous value infinally.- All 12 hook scripts inline an
isSdkChildContext(payload)guard checking both env marker andpayload.entrypoint === 'sdk-ts'. /summarizeshort-circuits withno_providerwhen the noop provider is active.
Added
OPENAI_BASE_URL/OPENAI_EMBEDDING_MODEL(#186, thanks @Edison-A-N). Azure OpenAI, vLLM, LM Studio, and other OpenAI-compatible proxies now work for embeddings. Defaults preserved.OPENAI_EMBEDDING_DIMENSIONS(#189).dimensionsderives from the model via a lookup table (3-small=1536, 3-large=3072, ada-002=1536) and the env var overrides for custom / self-hosted endpoints.- Auto-derived lessons + crystals on
import-jsonl(#188). Each imported session produces one crystal (narrative, tool outcomes, files, lessons) and up to 20 heuristic lessons. Content-addressed IDs (fingerprintId) so re-imports bump reinforcements instead of duplicating. - Multimodal Phase 1 (#179 series, thanks @tanmaishi + @Tanmay-008). Optional CLIP visual embeddings and vision-search on top of managed image store, with LRU eviction and refcount parity.
- Session preview on the sessions list (#188).
Session.firstPromptpopulated by bothimport-jsonland livemem::observe; viewer renders a 140-char preview. - Richer session detail panel (#188). 4-stat grid, top-10 tool bar chart, activity breakdown, file list, metadata.
Changed
- Default provider is now
noopwhen no API key is set (see Security). /agentmemory/auditreturns{ entries, success }to match viewer shape./agentmemory/replay/sessionsuseskv.listdirectly: sub-50ms on 600+ sessions.- Viewer WS has a 5s connect timeout so the
CONNECTING…banner no longer sticks forever. import-jsonlruns synthetic compression + BM25 indexing, fixing consolidation and search on imported data.
Fixed
- CI + publish workflows use two-step
npm install --package-lock-only+npm ci(lockfiles stay gitignored). image-quota-cleanupfails closed on refCount read errors.mem::observeguardsraw.userPromptas a string before sanitizing.- Viewer Actions tab reads
frontier(notactions) from/frontier. - Agent-sdk branch of
detectProviderrespects the computedmaxTokensinstead of hardcoding 4096.
Infrastructure
StateScope/StateScopeKeyinterface for theKV.statescope.onnxruntime-node+onnxruntime-webdeclared asoptionalDependencies.FALLBACK_PROVIDERShonors theAGENTMEMORY_ALLOW_AGENT_SDKgate.- README provider table + env block refreshed; hero test badge 654 → 827.
- 827 tests (up from 812 in v0.9.1).
@agentmemory/mcpshim bumped to 0.9.2 (was stuck at 0.9.0).
Full CHANGELOG: https://github.com/rohitg00/agentmemory/blob/main/CHANGELOG.md#092--2026-04-22
Full diff: v0.9.1...v0.9.2