anomalyco / anomalyco/opencode
TUI: streamed markdown list items truncated when items contain emphasis spans (full text persisted in storage)
@kommander is already working on this.
Since Sep 9, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Environment
- OpenCode: 1.18.29
- Terminal: iTerm2 on macOS
- Model where observed: GLM 5.3 flash (ollama-cloud provider); not observed with other models used in the same setup
Bug
Numbered-list items in streamed assistant responses get truncated in the TUI display when the item text contains inline emphasis (**bold**). The truncation is display-only — the full text is persisted correctly in storage.
Evidence that it is display-only
The assistant message is stored complete in ~/.local/share/opencode/opencode.db (part table, type='text') — all list items fully written — while the TUI shows only the first few words of each item. A response with 4 numbered items displayed as:
What was done this session:
1. Four hardening fixes,
2. All four
3. The
4. Path forward locked in the handover, in order: merge
…while the stored text contains the complete items (each several sentences long). Verified by querying the SQLite part table directly.
Pattern
Across multiple occurrences in one session, the cut points align with inline emphasis spans near the start of list items. The affected model habitually begins list items with **bold** lead-ins; models that use emphasis sparingly do not trigger it. Plain-text responses without emphasis render fully, including the same content re-requested as plain text.
Suspected mechanism (inference — not verified against source)
The streaming markdown renderer appears to leave an unterminated emphasis span when a streaming chunk boundary lands mid-span; the parser state then swallows the remainder of the list item (and sometimes subsequent items) from the display. Storage is unaffected, so the loss is purely in the incremental renderer.
Reproduction
Ask a model to produce a streamed numbered list where each item begins with a bold lead-in (e.g. **Point one.** Explanation…). Observe items truncated in the TUI at or near the first emphasis span.
Workaround
Requesting plain text without markdown emphasis renders fully.
Happy to provide a stored-vs-displayed diff or additional examples if useful.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.