mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
Render streamed Markdown incrementally (#34045)
## 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
This commit is contained in:
@@ -24,7 +24,7 @@ use uuid::Uuid;
|
||||
|
||||
use self::viewer::materialize_document;
|
||||
|
||||
const DIRECTIVE_PREFIX: &str = "::codex-inline-vis{";
|
||||
pub(crate) const DIRECTIVE_PREFIX: &str = "::codex-inline-vis{";
|
||||
const MAX_FRAGMENT_BYTES: u64 = 2 * 1024 * 1024;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
||||
Reference in New Issue
Block a user