Skip to content

Releases

v0.7.1

Choose a tag to compare

@github-actions github-actions released this 11 Nov 14:00
e1b2fca

Updated

  • V2 verified through OpenCode 2.2.7 (was 2.0.31). All smoke tests (128) and real-V2 host test pass against 2.2.7. No API compatibility issues.
  • @opencode/plugin devDependency relaxed to >=2.0.31 (was pinned 2.0.31).
  • All version references updated across CLAUDE.md, docs/faq.md, docs/memory-injection.md, and docs/architecture.md.

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 17 Oct 04:20
3435e83

Added

  • Dual OpenCode V1/V2 support from a single set of entrypoints. The server plugin now default-exports { id, setup, server } (V1 calls server, V2 calls setup); the TUI plugin exports { id, setup, tui }. Floor version remains OpenCode 1.18.29; verified through 2.0.31.
  • Root index.mjs / tui.mjs re-export shims so a local checkout referenced by directory path loads under V2 (which resolves <dir>/index.mjs and <dir>/tui.mjs, not the directory's package.json exports).
  • V2 tool registration via ctx.tool.transform with object JSON Schema input, options: { codemode: false } for V1-parity function-tool exposure, and { content } result wrapping. Memory/rules injection via ctx.session.hook("context") SystemParts; cache invalidation via ctx.tool.hook("execute.after").
  • V2 skill, command, and compaction hooks (ctx.skill.transform, ctx.command.transform, ctx.session.hook("compaction")).
  • V2 TUI browser (setup) using promise dialogs and a ctrl+alt+m keymap layer, alongside the byte-identical V1 tui callback interface.

Changed

  • consolidate_on_compact under V2 is driven by a session.compacted event subscription and enqueues an additional consolidation prompt; V2 has no native-continuation suppression, so it cannot replace the running loop as it does under V1.
  • The V2 setup entrypoint now returns a cleanup that aborts the consolidation subscription, so a config-triggered plugin reload does not leave a stale loop that double-consolidates alongside the new one.

Tests

  • 128 smoke tests plus a V2 fake-context seam (__core.setupV2) and promise-dialog TUI coverage.
  • Host suites split by major: npm run test:host:v1 (OpenCode 1.18.x) and npm run test:host:v2 (OpenCode 2.0.31).

v0.6.7

Choose a tag to compare

@github-actions github-actions released this 03 Oct 10:30
cc5c656

Fixed

  • Attach memory and rules to every fresh OpenCode model request, including later steps and other sessions. Detect config, index, directory, tombstone, and sentinel changes before cache reuse; do not consume cross-process notifications.
  • Queue automatic consolidation with noReply: true, preserve agent/model/variant, retain native continuation on API failure, and resume pending work in the fallback prompt.
  • Fail closed on local and shared contention; treat EPERM as alive, capture per-acquisition release tokens, and bound stale reclaim when deletion fails.
  • Validate safe regular topic files and no-follow reads, reserve the index filename, preserve unrelated removed-topic slug collisions, and enforce pinned TUI removal inside the lock.
  • Refuse FIFO reads without blocking; detect trusted config-symlink target edits before cache reuse.
  • Flush and clean atomic temporary writes, persist removal intent before dropping discoverability, roll back ordinary topic/index write failures, and preserve racing config creation and existing legacy backups.
  • Lock local-to-shared migration in consistent order, copy atomically, respect both removal lists, and retry failed migrations only marking success after completion.
  • Preserve JSONC literal commas, refresh topic metadata, compare full duplicate timestamps while retaining pins, heal stale flags, correct repair totals and malformed-field recovery, and surface TUI refusal/filesystem results.

Changed

  • inject_every_n_turns now controls forced disk refreshes in model requests; memory is always injected and system tokens are not inherently free.
  • Documentation records current host compatibility, co-tenant coordination, and per-file recovery boundaries.

Tests

  • 92 to 120 smoke tests, plus real-process OpenCode/OpenCode and OpenCode/pi writer checks.
  • npm run test:host verifies native tool execution, subsequent requests, another session, and automatic consolidation with a real OpenCode 1.18.34 server and local fake model.

v0.6.6

Choose a tag to compare

@github-actions github-actions released this 21 Sep 12:34
689d53a

Fixed

  • Ambiguous partial matches refused: remove_memory/pin_memory no longer mutate the first substring hit — an exact name wins, multiple partial candidates are reported and nothing is touched (openpi-memory parity).
  • Lock double-reclaim race: .lock now holds a pid\tts\trand token; stale reclaim re-verifies inode+mtime before unlinking (two simultaneous reclaimers can't clobber each other's fresh lock) and release is compare-and-delete.
  • Stuck drift note: the /memory repair maintenance note no longer counts intentionally-removed (tombstoned) files, so it can't persist forever after repeated removals.
  • Repair timestamp forgery: repair_memory sanitizes recovered frontmatter timestamps — a corrupted co-tenant last_updated: can no longer forge a [pin] onto an index line.
  • Split-brain consolidation recap: the recap now uses one canonical topic, OCL Last Session Recap, whose slug is exactly ocl-last-session-recap.md (the old prompt promised a filename it never produced).
  • TUI over-match: setPin/removeEntry act only on the parsed entry line, never on a foreign line whose summary merely mentions ](file.md).
  • Carry-over retry: a failed or lock-contended first merge is retried on the next cache refresh within the same process, not only on the next session.

Changed

  • write_memory collapses summary whitespace and caps it at 500 chars (openpi parity) before frontmatter, index, and result message.
  • .ocl-removed is now documented as shared: openpi-memory reads/writes the same file in the shared dir, so either tool's removals are honored by both.

Tests

  • 86 → 92: ambiguous-match refusal, lock token + stolen-lock release, tombstone-aware drift count, repair timestamp sanitizing, summary cap, TUI parse-based matching.

v0.6.5

Choose a tag to compare

@github-actions github-actions released this 15 Sep 03:14
d2aa4d2

MEMORY.md is a line-oriented flatfile (one topic = one index line), but topic names and summaries are free-form markdown. This release closes the gap between the two, plus a JSONC-parser and a filename-validation hardening.

Fixed

  • Phantom index-line injection: a topic or summary containing a newline used to be written verbatim into an index line, splitting one record into two physical lines. Under shared_dir (where foreign index lines are trusted on read) a crafted summary could therefore inject an arbitrary - [Name](file) entry. sanitizeIndexField now collapses newlines to spaces and strips link-breaking [, ], (, ) from the name and summary before they reach the index. Topic-file content is unchanged (newlines there are normal).
  • Link-metacharacter topic names: a ] in a topic name silently broke parseIndexLine on read-back, making the entry invisible to every tool and the TUI while its file remained on disk (drift). Names are now sanitized at the source so the whole write path (slug, name-match, frontmatter, index) uses one consistent clean value.
  • Block comments in memory.jsonc: stripJsonc handled only // line comments, so a valid /* … */ JSONC comment made the entire config fail to parse — silently reverting every setting to defaults (only a console.error) and injecting raw JSONC into the prompt. stripJsonc is now string-literal-aware for both comment styles.

Changed

  • isSafeFilename hardened: filenames are now also rejected if they start with a . (tool-internal / hidden files: .ocl-removed, .lock, dotfiles) or contain []() (which break the - [name](filename) index shape). Applied automatically at every existing read-time boundary — the TUI hides such entries, remove_memory/pin_memory/write_memory refuse them, and repair_memory skips such orphan files.
  • A topic whose name has no slug-formable characters (e.g. "!!!") is rejected with a clear error instead of producing a .md file that the read-back guard would then silently orphan.

Tests

  • 79 → 86: newline-in-summary injection, newline/bracket topic collapse, paren-in-filename entry hidden + refused, leading-dot file skipped by repair, /* */ block-comment parsing, */-inside-a-string safety, and the extended isSafeFilename rejections.

v0.6.4

Choose a tag to compare

@github-actions github-actions released this 04 Sep 04:14
a56f84f

Fixed

  • Fail-closed shared writes: on lock contention, wait + auto-retry once, then return "store busy" instead of writing unlocked (all tools + TUI, via withLock).
  • Lock liveness reclaim: .lock is PID-stamped; a >10s stale lock is reclaimed only after kill(pid,0) proves the holder dead (foreign/unparseable payloads: >60s).
  • Append-mode timestamp is frontmatter-scoped: write_memory append no longer runs its last_updated/created bump over the whole file — it now edits only the frontmatter block (matching mode: "replace"), so a body line beginning last_updated: is never rewritten.
  • No unlocked read-path index write: readMemoryIndex returns the initial index in-memory when MEMORY.md is absent instead of writing it without the lock; the file is now created only via the locked tool/carry-over paths (removes the last unlocked write under shared_dir).
  • TUI missing-index guard: setPin/removeEntry return "No memory index found." if the index was deleted mid-session instead of throwing an unhandled rejection.

Added

  • /memory repair (repair_memory): additive re-index of on-disk topic files missing from MEMORY.md ([stale?], dated from frontmatter); idempotent. Shared-mode drift surfaces a non-mutating maintenance note.
  • Intentional-removal tombstone: remove_memory records the removed topic's filename in a .ocl-removed list inside the active memory dir.
    • repair_memory now skips anything listed, separating removed from "orphan".
    • Re-write_memory-ing that topic reclaims its on-disk file and clears the tombstone.

Changed

  • Topic frontmatter now quotes name/description (matches openpi-memory).
  • Recap renamed to ocl-last-session-recap.md (dodges openpi's reserved-slug retirement).

Tests

  • 68 → 79: fail-closed, auto-retry, local best-effort, live/dead-PID reclaim, repair (additive/idempotent/unsafe-skip), drift note, quoted frontmatter, recap filename, frontmatter-scoped append bump, TUI missing-index guard, intentional-removal tombstone (skip + reclaim-on-rewrite).

v0.6.3

Choose a tag to compare

@github-actions github-actions released this 27 Aug 18:38
debd902

Fixed

  • Unsafe index filenames: write_memory and the TUI now reject unsafe filenames from corrupted or shared MEMORY.md entries before file access.
  • Real 50 KB cap: injected index content is now byte-bounded, not merely flagged after oversize content is assembled.
  • Shared merge discovery: an identical pre-existing shared topic file now gains its missing index line without being copied or renamed.

Documentation

  • Corrected cache-refresh behavior: periodic injection re-emits cached state; manual file/config edits need a mutation, compaction, or restart to refresh.

Tests

  • 3 new regressions (65 → 68) for unsafe existing-topic/TUI filenames, the actual byte bound, and an identical shared file missing its index entry.

v0.6.2

Choose a tag to compare

@github-actions github-actions released this 20 Aug 05:54
dbe6397

Fixed

  • Filename slug collisions: two topics slugifying to the same filename no longer silently merge/overwrite — falls back to a numeric suffix.
  • stripJsonc: no longer breaks on // inside config string values (e.g. URLs); parse failures now log via console.error instead of silently reverting to defaults.
  • Tool argument validation: all 3 memory tools reject missing/invalid topic/content/summary with a clean error instead of throwing.
  • pin coercion: strictly boolean now — no longer truthy-matches a stray string "false".
  • Path traversal guard: filenames read back from MEMORY.md (remove/pin/merge) are validated before any file operation.

Documentation

  • New docs/faq.md known-limitations entries: carry-over/lock race window, shared_dir-toggle cache staleness, lock/NFS trade-offs, TUI test coverage, cross-tool coordination, subagent-memory parity gap.

Tests

  • 17 new tests (48 → 65). Beyond coverage for each fix above, three previously-untested paths are now covered: the 50 KB byte-cap truncation branch (distinct from the line-cap branch), resolveDestName's -oclm-2 numeric-suffix fallback on a triple collision, and lock acquisition against a lock genuinely held by a separate OS process (spawned via child_process, not simulated in-process).

v0.6.1

Choose a tag to compare

@github-actions github-actions released this 19 Aug 12:42

Added

  • Merge-aware shared_dir carry-over: first enable now merges with pre-existing shared-dir content instead of silently skipping. Collisions resolved by content comparison; differing-content files renamed with -oclm suffix. Idempotent across multiple process starts, and now skips the full merge scan entirely on every process after the first successful one, via a .shared-dir-migrated sentinel file in the local memory dir. See docs/shared-directory.md.
  • TUI follows shared_dir: TUI plugin reads memory.jsonc fresh on every open and resolves the active directory dynamically. Mutations (pin/unpin/remove) use the same cross-process lock and atomic writes as the server tools.
  • ocl-memory-shared.mjs: pure-logic module shared by both plugins — path/config resolution, locking, atomic writes, carry-over. Eliminates duplication and ensures TUI and server plugin always agree on the active directory.
  • Consolidation seeded by compaction summary: consolidate_on_compact now fetches the most recent compaction summary (already in 0.6.0, just clarified in changelog) and seeds the consolidation prompt from it, rather than re-scanning the full conversation. Falls back to full-scan if no summary is found.

Changed

  • Removed redundant backup-dir creation from carry-over (originals stay in local dir untouched; a copy-not-move operation needs no separate backup).
  • 22 new tests (26 → 48); all 48 pass.

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 19 Aug 07:17

Mirrors several features from the pi coding agent port (openpi-memory) back into this project.

Added

  • shared_dir: opt-in cross-tool memory store at ~/.agents/memory/. First enable copies local memory across (non-destructive). See docs/shared-directory.md.
  • Cross-process advisory lock + atomic writes: guards concurrent writes from this tool and other processes sharing the directory; all file writes now go through temp-file-then-rename.
  • Config relocated to memory.jsonc: moved from memory/RULES.jsonc to ~/.config/opencode/memory.jsonc. Legacy installs auto-migrate on first read (RULES.jsonc.bak kept). See docs/configuration.md.
  • /memory consolidate: scans the session for unpersisted facts, writes each, and updates a Last Session Recap topic.
  • consolidate_on_compact: when true, replaces opencode's post-compaction auto-continue with a consolidation pass seeded by the compaction summary. Only fires on automatic compaction (not manual /compact). See docs/faq.md.
  • TUI follows shared_dir: both plugins now share path/config resolution via ocl-memory-shared.mjs; TUI mutations use the same lock + atomic-write path as the server tools.
  • Larger defaults: byte cap 25 KB → 50 KB; max_lines default 200 → 300, clamp [50, 500] → [50, 1000].

Changed

  • Plugin factory captures input.client for client.session.prompt(...) / client.session.messages(...) (consolidation).
  • 22 new tests (26 → 48).