Skip to content
PidebugWeb

Investigate markdown list renumbering behavior in TUI/web-ui

Session from pi-mono-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

14msession
1interventions
GOAL

Understand why typed numbered list items were being auto-renumbered when displayed in the UI, and decide whether to change the rendering behavior.

  1. Prompt · +1m
    In the UI, my typed list numbers get reordered (2,3,OK,H shows as 1,2,3,4). Can we investigate why?
  2. Agent did · +1m
    Searched codebase for markdown rendering logic across tui and web-ui packages, examining markdown.ts, message-renderer-registry.ts, and markdown-block usage to trace how ordered lists are rendered.
  3. Agent did · +3m
    Explained that the UI renders messages as Markdown, so ordered lists are auto-numbered (i+1) regardless of typed digits, per packages/tui/src/components/markdown.ts. Offered three options: honor start number, preserve exact numbers, or treat as plain text.
  4. Prompt · +4m
    Got it. Is this unavoidable? Is there a better modern handling?
  5. Agent did · +4m
    Confirmed this is standard CommonMark/GitHub-style behavior where ordered lists auto-renumber, ignoring literal digits. Suggested workarounds: escaping the dot, using code fences, or modifying the renderer to bypass list parsing.
  6. Intervention · +14m
    Decided not to touch the renderer, since the behavior seemed intentional and matched standard Markdown conventions used by maintainers.
    Why: I didn't want to change behavior that's actually the correct, expected Markdown standard just because it surprised me once.
  7. Outcome · +14m
    No code changes made; confirmed the renumbering is standard CommonMark/marked behavior and left the renderer as-is.
VERDICT

I'd start by asking directly whether this is standard Markdown behavior before diving into a code investigation, since it turned out to be expected CommonMark semantics all along. The right call was backing off from changing the renderer once I realized it matched intended, standard list-numbering behavior rather than a bug.

I tried this · 0

Discussion · 0

How Builds work