Investigate markdown list renumbering behavior in TUI/web-ui
Session from pi-mono-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk
Click a segment to jump to that moment
14msession
1interventions
by library · 12h
GOAL
Understand why typed numbered list items were being auto-renumbered when displayed in the UI, and decide whether to change the rendering behavior.
- +1mPrompt · +1mIn the UI, my typed list numbers get reordered (2,3,OK,H shows as 1,2,3,4). Can we investigate why?
- +1mAgent did · +1mSearched 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.
- +3mAgent did · +3mExplained 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.
- +4mPrompt · +4mGot it. Is this unavoidable? Is there a better modern handling?
- +4mAgent did · +4mConfirmed 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.
- +14mIntervention · +14mDecided 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.
- +14mOutcome · +14mNo 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.