Skip to content

Releases: nguquen/opencode-memfs

v0.0.12 — Injection cache with content-hash key

20 Apr 08:32
7833b63

Choose a tag to compare

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_flush tool — Agent-facing escape hatch to force a cache refresh on the next turn.
  • /memfs-flush command — User-facing equivalent via command.execute.before.
  • Force-bust attributionmemory_promote / memory_demote / memory_flush / /memfs-flush now tag their source, surfaced in refresh logs as reason=forced:<source>.
  • File logger — One structured line per cache decision appended to ~/.config/opencode/memfs.log for tailable observability.
  • Bigger handoff.md seed — Raised from 5000 → 8000 chars since this file accumulates plans + decisions during a session.

Fixes

  • TTL branch now actually fireslastResponseTime is gated on info.finish being present, so assistant-message shell creation (which fires right before the next turn's system.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