Releases: nguquen/opencode-memfs
Releases · nguquen/opencode-memfs
v0.0.12 — Injection cache with content-hash key
Highlights
TASK-111: Injection cache — The rendered <memfs> system-prompt block is now cached per session and only rebuilt at genuine cache-bust moments, preserving the upstream provider's KV-cache prefix (Anthropic, Bedrock, etc.) across many memory mutations.
Features
- Content-hash injection cache — Defers
<memfs>re-renders while disk writes stay immediate. Bust ladder: forced ops → pressure (≥65% context) → TTL elapsed. Hash-unchanged state serves identical cached bytes. memory_flushtool — Agent-facing escape hatch to force a cache refresh on the next turn./memfs-flushcommand — User-facing equivalent viacommand.execute.before.- Force-bust attribution —
memory_promote/memory_demote/memory_flush//memfs-flushnow tag their source, surfaced in refresh logs asreason=forced:<source>. - File logger — One structured line per cache decision appended to
~/.config/opencode/memfs.logfor tailable observability. - Bigger
handoff.mdseed — Raised from 5000 → 8000 chars since this file accumulates plans + decisions during a session.
Fixes
- TTL branch now actually fires —
lastResponseTimeis gated oninfo.finishbeing present, so assistant-message shell creation (which fires right before the next turn'ssystem.transform) no longer resets the clock.
Config additions
| Field | Default | Description |
|---|---|---|
cacheTtl |
"5m" |
Injection-cache sync point (accepts "5m", "30s", "500ms", or ms number) |
refreshThresholdPercentage |
65 |
Context-usage % at which pressure forces a refresh |
refreshOnPromoteDemote |
true |
Whether tier changes force-bust the cache |
Tool count
9 → 10 with the addition of memory_flush.
PRs
- #3 — feat(TASK-111): injection cache with content-hash key
- #4 — docs: correct
<memfs>injection target wording
Full changelog: 8b32168^...v0.0.12