Skip to content

Markdown rendering broken since opentui upgrade from 0.1.79 to 0.1.88+ #21299

Closed

Description

@ars-ppi

Description

Bug

Markdown in assistant responses is not rendered — headings (###), bold (**text**), code blocks, and inline code all appear as raw text.

Environment

  • Tested on macOS Tahoe 26.4 (Terminal + iTerm2) and WSL2/Windows
  • OpenCode versions tested: v1.3.0, v1.3.13, v1.3.17
  • TERM=xterm-256color

What works

  • OpenCode v1.2.0 (opentui 0.1.79) — markdown renders correctly

What doesn't work

  • OpenCode v1.3.0+ (opentui 0.1.88+) — markdown is raw text
  • Setting OPENCODE_EXPERIMENTAL_MARKDOWN=false does not fix it — the fallback <code filetype="markdown"> path is also broken with opentui 0.1.88+

Root cause analysis

The opentui upgrade from 0.1.79 → 0.1.88 (introduced in v1.3.0 via #18079) appears to have regressed both rendering paths:

  • The new <markdown> component (default since v1.3.0)
  • The old <code filetype="markdown"> fallback

Both worked with opentui 0.1.79 in v1.2.0.

Version comparison

OpenCode opentui Markdown flag default Renders?
v1.2.0 0.1.79 opt-in (false) ✅ Yes
v1.3.0 0.1.88 opt-out (true) ❌ No
v1.3.13 0.1.95 opt-out (true) ❌ No
v1.3.17 0.1.96 opt-out (true) ❌ No

Relevant code

  • packages/opencode/src/flag/flag.ts:70 — OPENCODE_EXPERIMENTAL_MARKDOWN changed from truthy() (opt-in) to !falsy() (opt-out)
  • packages/opencode/src/cli/cmd/tui/routes/session/index.tsx — Both <markdown> and <code filetype="markdown"> paths affected
  • Commit that upgraded opentui: 040f551 (Upgrade opentui to 0.1.88 #18079)

Plugins

None

OpenCode version

1.3.13 - 1.3.17

Steps to reproduce

  1. Start OpenCode v1.3.0 or later
  2. Ask any question that produces a markdown-formatted response
  3. Headings, bold, code blocks render as raw plaintext

Screenshot and/or share link

No response

Operating System

Windows 11
MacOS
Linux Ubuntu 24.04

Terminal

Git Bash
Zsh
WSL2 Ubuntu

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Apr 7, 2026
  2. kommander commented on Apr 12, 2026

    @kommander
    Collaborator

    Could you share a screenshot and raw session data with /export where that happens?

  3. pahe-ppi commented on Apr 17, 2026

    @pahe-ppi

    Hi @kommander,
    I'm not @ars-ppi, but a colleague with the same observations. Tables seem to work fine, but everything else is broken. Here you go:

    Image Image

    session-ses_265c.md

  4. kommander commented on Apr 17, 2026

    @kommander
    Collaborator

    That is very odd. Session looks normal. I cannot reproduce any issue. Are you sure that is on the latest version? cc @simonklee any ideas? We reverted the parser bundling issue, so that should be in. There are no parser logs for debugging anymore unfortunately.

  5. simonklee commented on Apr 17, 2026

    @simonklee
    Member

    I have not seen this at all. But can investigate.

  6. pahe-ppi commented on Apr 17, 2026

    @pahe-ppi

    @kommander the linked session was created with v4.1.6, so not the latest latest, but almost.

  7. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  8. Mithras commented on May 8, 2026

    @Mithras

    I'm having the same issue. I run opencode in a container:

    FROM archlinux
    
    RUN pacman -Sy --noconfirm --needed base-devel git curl ripgrep nodejs bun uv chromium
    
    RUN mkdir -p /usr/local/bin/bun \
        && BUN_INSTALL=/usr/local/bin/bun bun i -g \
        opencode-ai@latest \
        oh-my-opencode-slim@latest \
        @tarquinen/opencode-dcp@latest \
        @th0rgal/ralph-wiggum@latest
    
    ENV PATH="$PATH:/usr/local/bin/bun/bin"
    
    ARG UNAME=opencode
    ARG UID=1000
    ARG GID=1000
    RUN groupadd -g $GID $UNAME
    RUN useradd -m -u $UID -g $GID $UNAME -G wheel \
        && passwd -d $UNAME \
        && echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers.d/temp
    
    
    USER $UNAME
    
    WORKDIR /home/$UNAME
    
    RUN mkdir -p ~/.config/opencode ~/.local/share/opencode ~/.local/state/opencode
    
    # RUN git clone https://aur.archlinux.org/paru.git \
    #     && cd paru \
    #     && makepkg -si --noconfirm
    
    # RUN sudo pacman -Sy --noconfirm opencode
    
    RUN sudo rm /etc/sudoers.d/temp
    
    ENV OPENCODE_ENABLE_EXA=1
    
    ENV TERM=xterm-256color
    ENV COLORTERM=truecolor
    # ENV OTUI_TREE_SITTER_WORKER_PATH=/usr/local/bin/bun/install/global/node_modules/@opentui/core/parser.worker.js
    
    ENTRYPOINT ["opencode"]
    

    Tried arch package, bun install from root and bun install from user. All are the same: onyl tables are renderd properly, no other markdown works.

  9. Mithras commented on May 8, 2026

    @Mithras

    I'm having the same issue. I run opencode in a container:

    FROM archlinux
    
    RUN pacman -Sy --noconfirm --needed base-devel git curl ripgrep nodejs bun uv chromium
    
    RUN mkdir -p /usr/local/bin/bun \
        && BUN_INSTALL=/usr/local/bin/bun bun i -g \
        opencode-ai@latest \
        oh-my-opencode-slim@latest \
        @tarquinen/opencode-dcp@latest \
        @th0rgal/ralph-wiggum@latest
    
    ENV PATH="$PATH:/usr/local/bin/bun/bin"
    
    ARG UNAME=opencode
    ARG UID=1000
    ARG GID=1000
    RUN groupadd -g $GID $UNAME
    RUN useradd -m -u $UID -g $GID $UNAME -G wheel \
        && passwd -d $UNAME \
        && echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers.d/temp
    
    
    USER $UNAME
    
    WORKDIR /home/$UNAME
    
    RUN mkdir -p ~/.config/opencode ~/.local/share/opencode ~/.local/state/opencode
    
    # RUN git clone https://aur.archlinux.org/paru.git \
    #     && cd paru \
    #     && makepkg -si --noconfirm
    
    # RUN sudo pacman -Sy --noconfirm opencode
    
    RUN sudo rm /etc/sudoers.d/temp
    
    ENV OPENCODE_ENABLE_EXA=1
    
    ENV TERM=xterm-256color
    ENV COLORTERM=truecolor
    # ENV OTUI_TREE_SITTER_WORKER_PATH=/usr/local/bin/bun/install/global/node_modules/@opentui/core/parser.worker.js
    
    ENTRYPOINT ["opencode"]
    

    Tried arch package, bun install from root and bun install from user. All are the same: onyl tables are renderd properly, no other markdown works.

    Figured it out for my setup. I had some permission issues in the container volume. Essentially ~/.local/share/opentui/tree-sitter/ is installed regardless of what/where opencode executable is. If it can't for whatever reason (permission issues), it falls back to txt for everything except tables.

  10. ars-ppi commented on May 11, 2026

    @ars-ppi
    Author

    thanks @Mithras that worked for me too:

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions