Render agent responses as Markdown - #639
Open
Dinah Xiaoman G (DinahK-2SO) wants to merge 22 commits into
Open
Conversation
Copilot started reviewing on behalf of
Dinah Xiaoman G (DinahK-2SO)
August 20, 2026 08:32
View session
This comment has been minimized.
This comment has been minimized.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds incremental Markdown rendering for AI agent responses in the WTA helper pane, backed by a vendored tui-markdown renderer and a new renderAgentMarkdown setting surfaced through Terminal’s settings model and Settings UI.
Changes:
- Vendor
tui-markdown(with source→rendered-line mapping support) and wire WTA chat rendering to optionally render agent output as Markdown. - Introduce
renderAgentMarkdownas a global setting (model + editor UI + localized strings) and plumb it to WTA helper startup + hot-reload. - Improve streaming “typewriter reveal” behavior by switching from char counts to grapheme-cluster counts, plus add validation tests (unit + e2e).
Reviewed changes
Copilot reviewed 43 out of 80 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| build/scripts/Generate-WtaThirdPartyNotices.ps1 | Adjusts third-party notice generation to include vendored path deps. |
| doc/cascadia/profiles.schema.json | (No changes shown in diff; not part of this PR’s file list.) |
| src/cascadia/TerminalApp/TerminalPage.cpp | Sends render_agent_markdown in hot-reload params and passes --no-agent-markdown to helpers when disabled. |
| src/cascadia/TerminalApp/TerminalPage.h | Extends agent runtime config snapshot to include renderAgentMarkdown. |
| src/cascadia/TerminalSettingsEditor/AIAgents.xaml | Adds Settings > Agents toggle UI for Markdown rendering. |
| src/cascadia/TerminalSettingsEditor/AIAgentsViewModel.h | Projects RenderAgentMarkdown setting into the view model. |
| src/cascadia/TerminalSettingsEditor/AIAgentsViewModel.idl | Adds projected setting definition for RenderAgentMarkdown. |
| src/cascadia/TerminalSettingsEditor/Resources/de-DE/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw | Base strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/es-ES/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/fr-FR/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/it-IT/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/ja-JP/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/ko-KR/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/pt-BR/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/qps-ploc/Resources.resw | Pseudo-locale strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/qps-ploca/Resources.resw | Pseudo-locale strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/qps-plocm/Resources.resw | Pseudo-locale strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/ru-RU/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/sr-Cyrl-RS/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/uk-UA/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/zh-CN/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsEditor/Resources/zh-TW/Resources.resw | Localized strings for the new Markdown toggle. |
| src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl | Adds the RenderAgentMarkdown inheritable setting. |
| src/cascadia/TerminalSettingsModel/MTSMSettings.h | Defines the new JSON key renderAgentMarkdown with default true. |
| src/cascadia/UnitTests_SettingsModel/CustomAgentAndPolicyTests.cpp | Adds unit coverage for roundtrip + default behavior of the new setting. |
| test/e2e/tests/Feature.MarkdownBootstrap.Tests.ps1 | New e2e coverage for helper bootstrap flag + hot-reload without restart. |
| test/e2e/tests/Feature.SettingsUi.Tests.ps1 | Adds e2e coverage for Settings UI toggle persistence and default state. |
| tools/wta/Cargo.lock | Updates lockfile for new dependencies (markdown + grapheme segmentation). |
| tools/wta/Cargo.toml | Adds tui-markdown (vendored path dep) and unicode-segmentation. |
| tools/wta/cgmanifest.json | Updates CG manifest to account for additional Rust crate dependencies. |
| tools/wta/src/app.rs | Adds render_agent_markdown runtime switch; changes reveal logic to grapheme clusters; refactors completed-turn mutations behind helpers. |
| tools/wta/src/app_events.rs | Adds hot-reload handling for render_agent_markdown; uses tab helpers for completed turn expansion state updates. |
| tools/wta/src/app_turn.rs | Switches reveal cursor reset to grapheme units; uses tab helpers for trailing marker updates. |
| tools/wta/src/cli/args.rs | Adds hidden --no-agent-markdown helper flag. |
| tools/wta/src/cli_tests.rs | Adds CLI parsing test for Markdown default-on and helper disable behavior. |
| tools/wta/src/helper/config.rs | Adds render_agent_markdown to helper config. |
| tools/wta/src/helper/runtime.rs | Applies Markdown rendering mode to the running helper app state. |
| tools/wta/src/main.rs | Plumbs --no-agent-markdown into helper config as render_agent_markdown. |
| tools/wta/src/theme.rs | Introduces Markdown styling constants used by the renderer. |
| tools/wta/src/ui/layout.rs | Precomputes chat layout once per frame (prepare + render reuse) for consistent sizing. |
| tools/wta/vendor/tui-markdown/.gitignore | Vendored project housekeeping. |
| tools/wta/vendor/tui-markdown/CHANGELOG.md | Vendored upstream changelog for traceability. |
| tools/wta/vendor/tui-markdown/Cargo.toml | Vendored crate manifest used by the build. |
| tools/wta/vendor/tui-markdown/Cargo.toml.orig | Vendored “original” manifest for reference. |
| tools/wta/vendor/tui-markdown/LICENSE-APACHE | Vendored upstream license. |
| tools/wta/vendor/tui-markdown/LICENSE-MIT | Vendored upstream license. |
| tools/wta/vendor/tui-markdown/README.md | Vendored upstream README. |
| tools/wta/vendor/tui-markdown/VENDORING.md | Documents vendoring source and local modifications. |
| tools/wta/vendor/tui-markdown/src/code_theme.rs | Vendored syntax theme support + tests. |
| tools/wta/vendor/tui-markdown/src/code_theme/fixtures/custom.tmTheme | Test fixture for theme loading. |
| tools/wta/vendor/tui-markdown/src/code_theme/fixtures/invalid.tmTheme | Test fixture for invalid theme loading. |
| tools/wta/vendor/tui-markdown/src/lib.rs | Vendored crate public API surface (includes source-map API). |
| tools/wta/vendor/tui-markdown/src/options.rs | Vendored renderer configuration (style sheet, image fallback, themes). |
| tools/wta/vendor/tui-markdown/src/renderer/blockquote.rs | Vendored blockquote + GFM alert rendering. |
| tools/wta/vendor/tui-markdown/src/renderer/code.rs | Vendored inline/fenced code rendering + highlight support. |
| tools/wta/vendor/tui-markdown/src/renderer/definition_list.rs | Vendored definition list support. |
| tools/wta/vendor/tui-markdown/src/renderer/footnote.rs | Vendored footnote rendering. |
| tools/wta/vendor/tui-markdown/src/renderer/formatting.rs | Vendored inline formatting style stacking. |
| tools/wta/vendor/tui-markdown/src/renderer/heading.rs | Vendored heading rendering + attribute suffix output. |
| tools/wta/vendor/tui-markdown/src/renderer/html.rs | Vendored literal HTML rendering. |
| tools/wta/vendor/tui-markdown/src/renderer/image.rs | Vendored image fallback rendering with nested description support. |
| tools/wta/vendor/tui-markdown/src/renderer/link.rs | Vendored link rendering with destination append. |
| tools/wta/vendor/tui-markdown/src/renderer/list.rs | Vendored list/task list rendering and layout tracking. |
| tools/wta/vendor/tui-markdown/src/renderer/math.rs | Vendored inline/display math rendering. |
| tools/wta/vendor/tui-markdown/src/renderer/test_support.rs | Vendored renderer test harness (tracing + rstest fixture). |
| tools/wta/vendor/tui-markdown/src/renderer/snapshots/tui_markdown__renderer__code__tests__highlighted_code.snap | Vendored snapshot for highlighted code output. |
| tools/wta/vendor/tui-markdown/src/renderer/snapshots/tui_markdown__renderer__code__tests__highlighted_code-2.snap | Vendored debug snapshot for highlighted code output. |
| tools/wta/vendor/tui-markdown/src/renderer/snapshots/tui_markdown__renderer__code__tests__highlighted_code_with_indentation.snap | Vendored snapshot for highlighted code (indented) output. |
| tools/wta/vendor/tui-markdown/src/renderer/snapshots/tui_markdown__renderer__code__tests__highlighted_code_with_indentation-2.snap | Vendored debug snapshot for highlighted code (indented) output. |
| tools/wta/vendor/tui-markdown/src/renderer/snapshots/tui_markdown__renderer__code__tests__inline_code.snap | Vendored snapshot for inline code rendering. |
| tools/wta/vendor/tui-markdown/src/renderer/snapshots/tui_markdown__renderer__code__tests__unhighlighted_code.snap | Vendored snapshot for unhighlighted fenced code. |
| tools/wta/vendor/tui-markdown/src/renderer/snapshots/tui_markdown__renderer__code__tests__unhighlighted_code-2.snap | Vendored debug snapshot for unhighlighted fenced code. |
| tools/wta/vendor/tui-markdown/src/renderer/snapshots/tui_markdown__renderer__table__tests__table_snapshot.snap | Vendored snapshot for table rendering. |
| tools/wta/vendor/tui-markdown/src/style_sheet.rs | Vendored style sheet abstraction (styles + symbols + alert labels). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot started reviewing on behalf of
Dinah Xiaoman G (DinahK-2SO)
August 20, 2026 08:58
View session
This comment has been minimized.
This comment has been minimized.
Copilot started reviewing on behalf of
Dinah Xiaoman G (DinahK-2SO)
August 20, 2026 10:29
View session
Copilot started reviewing on behalf of
Dinah Xiaoman G (DinahK-2SO)
August 21, 2026 03:42
View session
Source: crates.io tui-markdown-0.3.9.crate Archive SHA-256: A0C95AFC7B66008823DEA2614A800D944E18990690DB47517EFC66CD01FF9CEE Manifest SHA-256: FCA45F363927F0A8A30809D5448FB6FA03A2594B9368846E18842EDA48CF2139 All 34 imported files match the release archive byte-for-byte. The archive's four pre-existing trailing-whitespace findings are intentionally preserved.
Extend the canonical tui-markdown event pass to return top-level source and rendered-line ranges without a second parser. The preceding commit preserves the crates.io 0.3.9 payload byte-for-byte.
# Conflicts: # tools/wta/src/theme.rs
# Conflicts: # tools/wta/src/app/tab_state.rs
Dinah Xiaoman G (DinahK-2SO)
force-pushed
the
user/DinahK-2SO/markdown-renderer2-publish
branch
from
August 21, 2026 09:04
305d6e7 to
c7f27c1
Compare
Copilot started reviewing on behalf of
Dinah Xiaoman G (DinahK-2SO)
August 21, 2026 09:06
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
incremental markdown rendering of agent response.
References and Relevant Issues
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
PR Checklist