Markdown being stripped #7883

Open
opened 2026-02-16 18:08:34 -05:00 by yindo · 1 comment
Owner

Originally created by @joneslloyd on GitHub (Jan 28, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

I have a custom instruction in /Users/me/.config/opencode/instructions/formatting.md containing among other things:

# Response Formatting Requirements

Always structure your responses using clear markdown formatting:

- By default don't put information into tables for questions (but do put information into tables when creating or updating files)
- Use headings (##, ###) to organise sections, always
- Use bullet points or numbered lists for multiple items
- Use code blocks with language tags for any code
- Use **bold** for key terms and emphasis
- Use tables when comparing options or listing structured data
- Break long responses into logical sections with headings

And a config file in /Users/me/.config/opencode/opencode.json containing:

{
  "$schema": "https://opencode.ai/config.json",
  "instructions": ["~/.config/opencode/instructions/formatting.md"]
}

When I ask a question, every time the markdown headers are stripped from the response (at least when using both Opus 4.5 and also Kimi K2.5).

What's interesting is that:

  • No other markdown (asterisks etc) is removed, only the hashes # (or "pound sign" as y'all say)
  • It is capable of adding full markdown headings when writing to a file (whatever.md) but it strips them when writing to the terminal

Plugins

None (fresh install)

OpenCode version

1.1.39

Steps to reproduce

  • Add a custom instruction (or don't – It makes no difference)
  • Ask for a response in markdown
  • Check the terminal
  • Even if I explicitly ask for it to re-send as markdown with the hierarchical headings preserved, they are still absent (it believes they're there)

Screenshot and/or share link

No response

Operating System

macOS 26.2

Terminal

Warp

Originally created by @joneslloyd on GitHub (Jan 28, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description I have a custom instruction in `/Users/me/.config/opencode/instructions/formatting.md` containing among other things: ``` # Response Formatting Requirements Always structure your responses using clear markdown formatting: - By default don't put information into tables for questions (but do put information into tables when creating or updating files) - Use headings (##, ###) to organise sections, always - Use bullet points or numbered lists for multiple items - Use code blocks with language tags for any code - Use **bold** for key terms and emphasis - Use tables when comparing options or listing structured data - Break long responses into logical sections with headings ``` And a config file in `/Users/me/.config/opencode/opencode.json` containing: ``` { "$schema": "https://opencode.ai/config.json", "instructions": ["~/.config/opencode/instructions/formatting.md"] } ``` When I ask a question, every time the markdown headers are stripped from the response (at least when using both Opus 4.5 and also Kimi K2.5). What's interesting is that: - No other markdown (asterisks etc) is removed, only the hashes `#` (or "pound sign" as y'all say) - It _is_ capable of adding full markdown headings when writing to a file (`whatever.md`) but it strips them when writing to the terminal ### Plugins None (fresh install) ### OpenCode version 1.1.39 ### Steps to reproduce - Add a custom instruction (or don't – It makes no difference) - Ask for a response in markdown - Check the terminal - Even if I explicitly ask for it to re-send as markdown with the hierarchical headings preserved, they are still absent (it believes they're there) ### Screenshot and/or share link _No response_ ### Operating System macOS 26.2 ### Terminal Warp
yindo added the bug label 2026-02-16 18:08:34 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 28, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #5675: markdown user messages aren't formatted
  • #5591: Quotes in code getting stripped in model output
  • #8222: JSON code blocks strip quotation marks in TUI markdown renderer
  • #8733: Subagent not reading markdown instructions from agent definition file
  • #7671: Markdown table formatting
  • #7779: GLM 4.7 thinking process not properly formatted - missing leading tags
  • #10419: Desktop: markdown rendering issue
  • #9899: The TUI is merging lines of text when the terminal window is small
  • #10998: Run Command message won't display command ran in Zed

These issues suggest a pattern of markdown formatting being stripped or improperly rendered in terminal output, particularly in the TUI markdown renderer. Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 28, 2026): This issue might be a duplicate of existing issues. Please check: - #5675: markdown user messages aren't formatted - #5591: Quotes in code getting stripped in model output - #8222: JSON code blocks strip quotation marks in TUI markdown renderer - #8733: Subagent not reading markdown instructions from agent definition file - #7671: Markdown table formatting - #7779: GLM 4.7 thinking process not properly formatted - missing leading tags - #10419: Desktop: markdown rendering issue - #9899: The TUI is merging lines of text when the terminal window is small - #10998: Run Command message won't display command ran in Zed These issues suggest a pattern of markdown formatting being stripped or improperly rendered in terminal output, particularly in the TUI markdown renderer. Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7883