feat: render MCP tool response markdown in chat#1213
Conversation
When an MCP tool response JSON contains a "markdown" key, render its value as markdown in the action details panel instead of raw JSON. Reuses the existing renderMarkdownInContainer pipeline via the comment-content CSS class.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf5c1aac0c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <% if action_md %> | ||
| <div class="comment-content comment-action-markdown"><%= action_md %></div> | ||
| <% else %> |
There was a problem hiding this comment.
Preserve editable JSON source for markdown actions
When comment.action contains a markdown key, this branch removes the .comment-action-json element entirely, but the edit flow still depends on it: openActionEditor in comments/list_controller.js only opens the form when it can read container.querySelector('.comment-action-json') and populate the textarea from json.textContent. In pending-action comments (has_pending_action == true), clicking “edit action” becomes a no-op for markdown-backed actions, so users cannot modify the proposed action before approval.
Useful? React with 👍 / 👎.
Summary
"markdown"키가 있으면, action details 패널에서 raw JSON 대신 마크다운으로 렌더링renderMarkdownInContainer파이프라인을 재사용하여 syntax highlighting, mermaid, table 등 자동 지원"markdown"키가 없으면 기존 JSON pretty-print 동작 유지Changes
comments_helper.rb:comment_action_markdown헬퍼 추가 — JSON에서markdown키 추출_comment.html.erb: markdown이 있으면comment-contentdiv로 렌더링, 없으면 기존<pre>유지Test plan