Skip to content

[Ubuntu 24.04][Agent&Skills] OpenClaw TUI strips __double_underscores__ inside code blocks — Python dunder syntax corrupted #4849

Description

@hulynn

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

  1. nemoclaw onboard with any NVIDIA Endpoints model (e.g. nvidia/nemotron-3-nano-omni-30b-a3b-reasoning)
  2. nemoclaw my-assistant connect && openclaw tui
  3. Send: Write a Python function that uses if __name__ == "__main__":
  4. 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

Activity

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

Metadata

Metadata

Assignees

Labels

NV QABugs found by the NVIDIA QA Teamarea: uiWeb UI, terminal display, visual layout, or UX behaviorintegration: openclawOpenClaw integration behaviorneeds: unblockBlocked item needs dependency or decision resolvedplatform: ubuntuAffects Ubuntu Linux environments

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions