SIGN IN SIGN UP

feat(console): transcript overhaul - ordered content blocks, markdown, tool UX (#2640)

## Summary

Reworks the managed-session chat transcript around **one bubble per user
question**, with text and tool calls rendered as ordered content blocks
in chronological order.

**ChatPanel.tsx**
- Block-based message model (`ContentBlock[]`): `agent.message` /
`agent.tool_use` / `agent.tool_result` append ordered blocks into the
current turn bubble; `user.message` / `session.error` close it
- Turn bubbles stay open across `session.status_*` events — the backend
emits `status_idle` between model iterations of one user question, which
previously split one answer into multiple bubbles
- Auto-expand the latest assistant turn bubble (even when a follow-up
user message sits after it)
- Renders `session.error` as a red bubble (fixes #2596)
- Fixed the send path: optimistic user bubble + SSE reconciliation now
correctly closes the previous turn (the `seen-id` pre-dedupe was eating
the streamed `user.message`, so the next reply appended to the old
bubble)
- Removed vestigial `replyMsgIdRef` (it crashed sends after the block
refactor)

**managedSessions.ts**
- SSE auto-reconnect with exponential backoff (2s → 30s cap, resets on
progress), resuming from the last seen sequence via `getAfter` so no
events are lost across plane restarts

**MessageBlock.tsx**
- Renders ordered content blocks; assistant text via `react-markdown`
with `.md-text` styles (headings, lists, code blocks, tables,
blockquote, images)

**ToolCallBlock.tsx**
- Input / Result sections with labels
- JSON pretty-printing + residual escape unescaping (`\\n` from
double-encoded tool output)
- Grep-style `file:line:content` rows highlighted (relative-path prefix
stripped)
- Line numbers for plain/file dumps; `prism-react-renderer` syntax
highlighting for XML/JSON/Java/Bash/JS
- Tool card opens while the tool is running and collapses once the
result lands

Dependencies added: `react-markdown`, `prism-react-renderer`
(package.json only; `package-lock.json` was not regenerated locally — CI
may want to run `npm install --package-lock`).
A
aias00 committed
9da8bbfa0dd4bfb5ca11af7b18efb0ebfc7f930f
Parent: 01056bf
Committed by GitHub <noreply@github.com> on 8/11/2026, 4:09:51 AM