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=...]prefixThe 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