mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:50:52 +00:00
Render follow-up directive labels in the TUI and copied responses (#49089)
## Why
Follow-up directives contain display labels and prompt attributes. Show the labels without exposing directive syntax or prompt text in rendered responses and streaming previews.
## What changed
- Render `:codex-followup[label]{prompt="..."}` as its label, preserving inline Markdown styling and source offsets.
- Replace recognized follow-up directives with their labels when copying whole responses, while retaining the original source.
- Withhold unfinished directives in rich streaming previews and avoid cropping into prompt attributes when the preview window advances.
- Preserve literal code, escaped directives, and malformed source when rendering completed messages or copying responses.
## Testing
Add regression coverage for label formatting, nested brackets and backticks, literal and malformed directives, whole-response copying, and streaming holdback across long prompts and preview window boundaries.
GitOrigin-RevId: dce61d1164de0a576fe95fb2c67b177a1ed414e8
This commit is contained in:
@@ -91,7 +91,8 @@ impl TranscriptState {
|
||||
|
||||
pub(super) fn record_agent_markdown(&mut self, markdown: String, source: String) {
|
||||
self.last_status_copy_targets = None;
|
||||
self.last_agent_markdown = Some(markdown);
|
||||
self.last_agent_markdown =
|
||||
Some(crate::markdown_render::followup_labels(&markdown).into_owned());
|
||||
self.last_agent_source = Some(source);
|
||||
self.saw_copy_source_this_turn = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user