feat(web): add <AgentMessage> so event summaries render as markdown #1164

Closed
opened 2026-05-14 22:05:20 +00:00 by claude-desktop · 3 comments
Collaborator

As a dashboard operator, I want agent-produced text to render with consistent markdown formatting whether I'm reading the event timeline or the planner transcript, so that I don't lose structure (code blocks, lists, links) when viewing the event log.

Acceptance criteria

Component

  • <AgentMessage content={string} compact={boolean} /> in components/agent-message.tsx
  • Default mode: renders via <Markdown> (GFM + Shiki) — same renderer used in transcript
  • compact mode: strips block-level formatting (lists → inline, code blocks → <code>) for narrow-width contexts (task-list summary preview)

Adoption

  • event-log.tsx EventRow replaces whitespace-pre-wrap span with <AgentMessage> for assistant event summaries
  • planner/transcript.tsx assistant message bubbles use <AgentMessage> (removes parallel render path)

Security

  • No XSS: markdown renderer already sanitizes; verify no unguarded dangerouslySetInnerHTML without sanitizer wrapper

Visual

  • Event log assistant rows look visually comparable to transcript bubbles (same font size/weight, same code block style)
  • No regression on non-markdown event summaries (plain text still renders correctly)
  • just qa passes

Out of scope

  • Rendering tool_call summaries or error event text as markdown (plain text correct for those)
  • Syntax-highlighting theme configuration

References

  • agent-output-unification audit 2026-05-15
  • Inconsistency: "Markdown Rendering" (HIGH)
As a dashboard operator, I want agent-produced text to render with consistent markdown formatting whether I'm reading the event timeline or the planner transcript, so that I don't lose structure (code blocks, lists, links) when viewing the event log. ### Acceptance criteria #### Component - [ ] `<AgentMessage content={string} compact={boolean} />` in `components/agent-message.tsx` - [ ] Default mode: renders via `<Markdown>` (GFM + Shiki) — same renderer used in transcript - [ ] `compact` mode: strips block-level formatting (lists → inline, code blocks → `<code>`) for narrow-width contexts (task-list summary preview) #### Adoption - [ ] `event-log.tsx` `EventRow` replaces `whitespace-pre-wrap` span with `<AgentMessage>` for `assistant` event summaries - [ ] `planner/transcript.tsx` assistant message bubbles use `<AgentMessage>` (removes parallel render path) #### Security - [ ] No XSS: markdown renderer already sanitizes; verify no unguarded `dangerouslySetInnerHTML` without sanitizer wrapper #### Visual - [ ] Event log assistant rows look visually comparable to transcript bubbles (same font size/weight, same code block style) - [ ] No regression on non-markdown event summaries (plain text still renders correctly) - [ ] `just qa` passes ### Out of scope - Rendering `tool_call` summaries or `error` event text as markdown (plain text correct for those) - Syntax-highlighting theme configuration ### References - agent-output-unification audit 2026-05-15 - Inconsistency: "Markdown Rendering" (HIGH)
Collaborator

🧹 janitor: this ticket has been idle-assigned since 2026-05-14T23:51:11.000Z. Re-dispatching.

🧹 janitor: this ticket has been idle-assigned since 2026-05-14T23:51:11.000Z. Re-dispatching.
Collaborator

🧹 janitor: this ticket has been idle-assigned since 2026-05-15T04:22:21.000Z. Re-dispatching.

🧹 janitor: this ticket has been idle-assigned since 2026-05-15T04:22:21.000Z. Re-dispatching.
Collaborator

All acceptance criteria for this issue were delivered by PR #1186 (merged as 17cae85 on main 2026-05-14T23:51:09Z). The PR body used Refs #1164 rather than Closes #1164, so the issue stayed open and the janitor kept redispatching it.

Verified on origin/main:

  • apps/web/src/components/agent-message.tsx exports <AgentMessage content compact streaming /> — default mode delegates to <Markdown> (GFM + Shiki, the same renderer the transcript already used); compact mode flattens lists → inline bullet runs and fenced code → inline <code>.
  • apps/web/src/components/agent-message.test.tsx covers default-mode markdown structure, compact-mode flattening, and inline-emphasis preservation on both paths.
  • apps/web/src/components/event-log.tsx EventRow swaps the renderer to <AgentMessage> for assistant events only; other event types stay on whitespace-pre-wrap (tool summaries / errors / progress are plain status output, per the "Out of scope" note).
  • apps/web/src/components/planner/transcript.tsx renders both persisted bubbles and the in-flight streaming bubble through <AgentMessage> (forwarding streaming so partial code fences progressively render) — the parallel <Markdown> render path is removed.
  • Security: <AgentMessage> does not introduce any new dangerouslySetInnerHTML; the only such usage in this path is the pre-existing one inside <CodeBlock> fed by Shiki's escape-safe HTML.

Closing — nothing left to implement.

All acceptance criteria for this issue were delivered by PR #1186 (merged as `17cae85` on `main` 2026-05-14T23:51:09Z). The PR body used `Refs #1164` rather than `Closes #1164`, so the issue stayed open and the janitor kept redispatching it. Verified on `origin/main`: - `apps/web/src/components/agent-message.tsx` exports `<AgentMessage content compact streaming />` — default mode delegates to `<Markdown>` (GFM + Shiki, the same renderer the transcript already used); compact mode flattens lists → inline bullet runs and fenced code → inline `<code>`. - `apps/web/src/components/agent-message.test.tsx` covers default-mode markdown structure, compact-mode flattening, and inline-emphasis preservation on both paths. - `apps/web/src/components/event-log.tsx` `EventRow` swaps the renderer to `<AgentMessage>` for `assistant` events only; other event types stay on `whitespace-pre-wrap` (tool summaries / errors / progress are plain status output, per the "Out of scope" note). - `apps/web/src/components/planner/transcript.tsx` renders both persisted bubbles and the in-flight streaming bubble through `<AgentMessage>` (forwarding `streaming` so partial code fences progressively render) — the parallel `<Markdown>` render path is removed. - Security: `<AgentMessage>` does not introduce any new `dangerouslySetInnerHTML`; the only such usage in this path is the pre-existing one inside `<CodeBlock>` fed by Shiki's escape-safe HTML. Closing — nothing left to implement.
Sign in to join this conversation.
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
charles/agent-hooks#1164
No description provided.