mirror of
https://github.com/sdwolf4103/opencode-working-memory.git
synced 2026-06-02 06:19:36 +02:00
5e9ada6859
Root cause: OpenCode's default compaction template uses --- separators. When our plugin adds structured context (Memory candidates: format), the model strictly follows the template, outputting --- at position 0. The markdown textmate grammar treats this as YAML frontmatter, applying the 'comment' syntax scope (purple + italic in themes like palenight). Fix: Set output.prompt in the compacting hook to replace the entire template with a ---free version. Uses only ## Markdown headings and explicitly forbids YAML frontmatter, horizontal rules, and delimiter lines. Preserves context from other plugins by merging output.context. - Replace compactionContextHeader() with buildCompactionPrompt() - Set output.prompt instead of pushing to output.context - Merge existing output.context from other plugins before clearing - Add 'Instructions' section to the template (per architect review) - Update tests: verify output.prompt, ---free format, context merging