Skip to content

Render agent responses as Markdown - #639

Open
Dinah Xiaoman G (DinahK-2SO) wants to merge 22 commits into
mainfrom
user/DinahK-2SO/markdown-renderer2-publish
Open

Render agent responses as Markdown#639
Dinah Xiaoman G (DinahK-2SO) wants to merge 22 commits into
mainfrom
user/DinahK-2SO/markdown-renderer2-publish

Conversation

@DinahK-2SO

Copy link
Copy Markdown
Contributor

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

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)

Copilot AI lite review requested due to automatic review settings August 20, 2026 08:31
Comment thread tools/wta/src/app_tests.rs Fixed
Comment thread tools/wta/src/app_tests.rs Fixed
Comment thread tools/wta/src/ui/chat.rs Fixed
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 renderAgentMarkdown as 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.

Comment thread build/scripts/Generate-WtaThirdPartyNotices.ps1 Outdated
Copilot AI review requested due to automatic review settings August 20, 2026 08:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 43 out of 80 changed files in this pull request and generated no new comments.

@github-actions

This comment has been minimized.

Copilot AI review requested due to automatic review settings August 20, 2026 10:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 43 out of 80 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 21, 2026 03:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 43 out of 80 changed files in this pull request and generated no new comments.

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/app/tab_state.rs
@DinahK-2SO
Dinah Xiaoman G (DinahK-2SO) force-pushed the user/DinahK-2SO/markdown-renderer2-publish branch from 305d6e7 to c7f27c1 Compare August 21, 2026 09:04
Copilot AI review requested due to automatic review settings August 21, 2026 09:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 43 out of 82 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants