Skip to content

Releases: rickross/opencode-acm

v0.5.29 — ACM-11 Fixed, Clean Release

02 Apr 22:28

Choose a tag to compare

What's Changed

Bug Fix: System-reminder leaking into Mattermost DMs (ACM-11)

The messages.transform hook was incorrectly injecting the <system-reminder> block onto outbound Mattermost DM messages, causing agents to see each other's token counts and timestamps inline in chat.

Root cause: OpenCode wraps inbound Mattermost messages in multiple ways before they reach the hook:

  • [Metadata: sender=...] prefix
  • The user sent the following message: wrapper
  • <system-reminder> wrapper (when a previous leak had already baked into message content)

The initial heuristic only caught [Metadata: — missing the other two shapes.

Fix: Broadened the skip condition to detect all three patterns, plus \n[Metadata: sender= anywhere near the top of the message text. Injection is now skipped for any message matching any of these patterns.

Housekeeping

  • Removed debug logging added during ACM-11 diagnosis (v0.5.26–v0.5.28)

Notes

  • OpenCode's own Mattermost plugin wraps inbound DMs in <system-reminder> tags — this is OpenCode transport behavior and is outside ACM's control
  • v0.5.24-stable is tagged as a known-good rollback point if needed
  • All dependencies are standard public packages (@opencode-ai/plugin, @opencode-ai/sdk, zod) — no private or idiosyncratic dependencies

v0.5.23 — Aurora Review Fixes

02 Apr 20:28

Choose a tag to compare

What's Changed

Bug Fixes

  • acm_info now reports effective system-reminder state — previously read only from the env var, missing the systemReminder: false plugin option path. Now reads from the resolved effective state set at plugin init.
  • Removed fake create_backup arg from acm_repair — the argument was advertised but never implemented. Removed to avoid misleading users. Backup support can be added properly in a future release.

Improvements

  • acm_diagnose verbose mode implementedverbose=true now shows full message IDs, role, part counts per issue, and a session summary block. Previously the verbose arg was declared but unused.
  • acm_fetch description corrected — docs previously said "active context" but the implementation searches the full session history (intentional wayback behavior). Description now matches reality.

Housekeeping

  • Version string now read from package.json — no more stray hardcoded version strings in tool implementations.

Thanks to Aurora for the thorough code review that surfaced all four of these issues.

v0.5.14 — Accurate token count matching TUI status bar

02 Apr 17:33

Choose a tag to compare

Changes

  • Fix token count to use t.total from output.messages — matches TUI status bar exactly
  • Root cause: previous versions used input + output + cache sum which doesn't match Anthropic's totalTokens field
  • t.total is set directly from the AI SDK's usage.totalTokens which Anthropic populates with the full context size
  • Falls back to explicit sum for providers that don't set totalTokens

Upgrade

npm install -g opencode-acm@latest

v0.5.11 — Fix context limit source to match TUI

02 Apr 15:18

Choose a tag to compare

Changes

  • Use config.providers() instead of provider.list() to get the override-applied context limit
  • This is the same source the TUI uses for the status bar percentage
  • Fixes limit showing 800,000 instead of the user-configured value from opencode.json

Upgrade

npm install -g opencode-acm@latest

v0.5.10 — Fix context limit to use opencode.json overrides

02 Apr 15:14

Choose a tag to compare

Changes

  • Fix context limit in <context-status> to use the user-overridden value from opencode.json
  • Uses provider.list() (same source as TUI status bar) instead of the raw model object from the hook
  • Falls back to the hook's model limit if provider list call fails

Upgrade

npm install -g opencode-acm@latest

v0.5.9 — Configurable system-reminder

02 Apr 14:57

Choose a tag to compare

Changes

  • Add systemReminder plugin option (default: true)
  • Disable via plugin options in opencode.json:
    "plugins": [["npm:opencode-acm", { "systemReminder": false }]]
  • Or via env var: OPENCODE_ACM_SYSTEM_REMINDER=0

Upgrade

npm install -g opencode-acm@latest

v0.5.8 — Context-status injected into message stream

02 Apr 14:50

Choose a tag to compare

Changes

  • ACM-10: Switch context-status injection from system prompt to message stream
    • Injects <system-reminder> as a synthetic part on the last user message each turn
    • Agent sees it naturally in context without needing to execute code to inspect it
    • Mirrors openfork's original approach (lastUserMsg.parts.push(...))
    • Token count and percentage match OpenCode's status bar (same formula)
    • Deduplication prevents stacking multiple reminders
    • system.transform now strips stale static context-status blocks from team prompts and stores model limit for use in messages.transform

Upgrade

npm install -g opencode-acm@latest

v0.5.7 — Accurate context-status injection

02 Apr 14:45

Choose a tag to compare

Changes

  • ACM-10: Inject accurate <context-status> block into system-reminder every turn
    • Token count, percentage, and limit now match exactly what OpenCode shows in the status bar
    • Uses same formula as session-context-metrics.ts: tokens.input + output + reasoning + cache.read + cache.write
    • Token counts cached in messages.transform (where message data is available), consumed in system.transform
    • Removes stale/duplicate context-status blocks before injecting fresh one
    • Falls back gracefully when no token data is available yet (first turn)
  • Replaced hardcoded March 19 example in irelate-team-prompt.txt with a placeholder

Upgrade

npm install -g opencode-acm@latest

v0.5.6 - ACM-4/5: Fix size labels, clarify search semantics

01 Apr 20:26

Choose a tag to compare

ACM-4: Fix size reporting labels

Renamed messageBytesmessageChars and relabeled all output from KB/bytes to ~Kchars with a note that this is a character count approximation, not bytes or tokens.

ACM-5: Clarify acm_search full-history semantics

Updated acm_search description to clearly state it searches full session history by default — the wayback machine behavior is intentional. Agents can recall context from before compaction boundaries.

v0.5.5 - ACM-9: System-reminder injection

01 Apr 20:26

Choose a tag to compare

ACM-9: Inject system-reminder with wall-clock time and context limit

Implements experimental.chat.system.transform to inject a <system-reminder> block on every turn containing:

  • Current wall-clock time (locale string with timezone)
  • Context token limit (from OPENCODE_CONTEXT_STATUS_LIMIT env or model context window)

Skips injection if OpenCode has already injected its own time-containing system-reminder to avoid duplication.