Description
The OpenClaw TUI markdown renderer treats __ (double-underscore pairs) as bold markers even inside fenced code blocks. Python code containing dunder syntax (__name__, __main__, __init__, etc.) is displayed with the underscores removed, corrupting the code shown to the user. Confirmed on NemoClaw v0.0.59 with both Nano Omni 30B and Ultra 550B. The API response contains the correct text — this is a client-side rendering bug.
Environment
Device: Ubuntu 24.04 server (galaxy-sku2-018, aarch64)
OS: Ubuntu 24.04.4 LTS
Architecture: aarch64
Node.js: v22.22.3
npm: 10.9.8
Docker: 29.5.2
OpenShell CLI: 0.0.44
NemoClaw: v0.0.59
OpenClaw: 2026.5.27 (27ae826)
Steps to Reproduce
nemoclaw onboard with any NVIDIA Endpoints model (e.g. nvidia/nemotron-3-nano-omni-30b-a3b-reasoning)
nemoclaw my-assistant connect && openclaw tui
- Send:
Write a Python function that uses if __name__ == "__main__":
- Observe the model response in the TUI
Expected Result
Code block displays verbatim Python: if __name__ == "__main__":. Function names like is_palindrome display on a single line.
Actual Result
if name == "main":
def is
_palindrome(s: str) -> bool:
__name__ becomes name, __main__ becomes main. Function name is_palindrome splits at the underscore: "def is" on one line, "_palindrome(s: str) -> bool:" on the next.
Logs
API-level verification confirms the raw response from inference.local contains the correct text:
"if __name__ == \"__main__\":"
This confirms the corruption is in TUI rendering, not in model output.
TUI screen capture (tmux capture-pane):
if name == "main":
def is
_palindrome(s: str) -> bool:
...
Root cause: The markdown renderer applies inline bold formatting (__text__ → bold) even inside fenced code blocks. Python dunders (__name__, __init__, etc.) are treated as bold markers, stripping the __ pairs. Single underscores in identifiers (is_palindrome) are treated as italic openers, causing line breaks at the underscore position. Fix: skip bold/italic parsing for tokens inside code fences and inline code spans (CommonMark spec explicitly excludes formatting inside code spans).
NVB#6272825
Description
The OpenClaw TUI markdown renderer treats
__(double-underscore pairs) as bold markers even inside fenced code blocks. Python code containing dunder syntax (__name__,__main__,__init__, etc.) is displayed with the underscores removed, corrupting the code shown to the user. Confirmed on NemoClaw v0.0.59 with both Nano Omni 30B and Ultra 550B. The API response contains the correct text — this is a client-side rendering bug.Environment
Steps to Reproduce
nemoclaw onboardwith any NVIDIA Endpoints model (e.g.nvidia/nemotron-3-nano-omni-30b-a3b-reasoning)nemoclaw my-assistant connect && openclaw tuiWrite a Python function that uses if __name__ == "__main__":Expected Result
Code block displays verbatim Python:
if __name__ == "__main__":. Function names likeis_palindromedisplay on a single line.Actual Result
__name__becomesname,__main__becomesmain. Function nameis_palindromesplits at the underscore:"def is"on one line,"_palindrome(s: str) -> bool:"on the next.Logs
API-level verification confirms the raw response from
inference.localcontains the correct text:This confirms the corruption is in TUI rendering, not in model output.
TUI screen capture (
tmux capture-pane):Root cause: The markdown renderer applies inline bold formatting (
__text__→ bold) even inside fenced code blocks. Python dunders (__name__,__init__, etc.) are treated as bold markers, stripping the__pairs. Single underscores in identifiers (is_palindrome) are treated as italic openers, causing line breaks at the underscore position. Fix: skip bold/italic parsing for tokens inside code fences and inline code spans (CommonMark spec explicitly excludes formatting inside code spans).NVB#6272825