Skip to content

Render streamed Markdown incrementally - #34045

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/748171c4ed58923329b59c48ea3c2afa4819ec88
Jul 18, 2026
Merged

Render streamed Markdown incrementally#34045
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/748171c4ed58923329b59c48ea3c2afa4819ec88

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 18, 2026

Copy link
Copy Markdown

Render streamed Markdown incrementally

Why

Streaming TUI responses repeatedly rendered the entire accumulated Markdown source for each committed delta, including blocks whose output could no longer change.

What changed

  • Retain rendered output for completed top-level Markdown blocks and rerender only the final mutable block as new source arrives.
  • Track block boundaries during the existing Markdown parser pass and map them through table-fence normalization.
  • Preserve canonical full rendering when source-wide state may affect earlier output, including reference link definitions and inline visualizations, and when the width or render mode changes.
  • Append raw-mode lines directly while preserving blank lines.

Testing

Added coverage that compares incremental output with full rendering across paragraphs, headings, lists, block quotes, code fences, tables, HTML blocks, links, visualizations, render-mode changes, and normalized table fences.

## Why

Streaming TUI responses repeatedly rendered the entire accumulated Markdown source for each committed delta, including blocks whose output could no longer change.

## What changed

- Retain rendered output for completed top-level Markdown blocks and rerender only the final mutable block as new source arrives.
- Track block boundaries during the existing Markdown parser pass and map them through table-fence normalization.
- Preserve canonical full rendering when source-wide state may affect earlier output, including reference link definitions and inline visualizations, and when the width or render mode changes.
- Append raw-mode lines directly while preserving blank lines.

## Testing

Added coverage that compares incremental output with full rendering across paragraphs, headings, lists, block quotes, code fences, tables, HTML blocks, links, visualizations, render-mode changes, and normalized table fences.

GitOrigin-RevId: 748171c4ed58923329b59c48ea3c2afa4819ec88
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/748171c4ed58923329b59c48ea3c2afa4819ec88 branch from aaa55d7 to 537e69a Compare July 18, 2026 18:02
@copyberry
copyberry Bot merged commit 537e69a into main Jul 18, 2026
32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/748171c4ed58923329b59c48ea3c2afa4819ec88 branch July 18, 2026 18:03
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants