Repository navigation
html_render pages never show for Grok threads because the result arrives in output.OkayOutput #23714
Description
What happened
In a desktop-app thread run through the Grok CLI (model: Claude Opus 5.5), I asked for a pie chart. The agent called html_preview and then html_render. Nothing showed in the chat: no frame, no card, no error. The agent was told "Shown to the reader above your reply", so its reply assumed I could see the chart. When I asked again, it fell back to a Mermaid block, which rendered fine. This was my first html_render attempt; Mermaid has always worked.
Diagnosis
The server publishes the page. The client never mounts it, because it cannot read the Grok CLI's result envelope.
html_renderran at 15:02:44 UTC. The server trace showsHtmlRender.prepare,measure, andpublishall ending inSuccessfor the thread.- The stored
dynamic_toolturn item hastoolName: "t3-code.html_render"andstatus: "completed". Itsoutputis Grok's MCP envelope:{"type":"MCP","tool_name":"html_render","server_name":"t3-code","output":{"OkayOutput":"<JSON string>"}}. ThehtmlRenderreference is inside theOkayOutputstring. readResultinpackages/shared/src/toolOutput.tsonly descends intostructuredContent/content(or parses a top-level string). It does not readoutput.OkayOutput. SocompactDynamicToolOutput(...).htmlRenderis undefined, andhtmlRenderFromToolItemreturns undefined.- The ACP adapter fallback in
packages/provider-acp/src/server/adapter.ts(thestatus === "completed" && isHtmlRenderbranch) should then callmcpSessions.takeHtmlRender(threadId, input)and rewriteoutputto{ htmlRender: page }. That did not happen: the stored output is still the raw envelope. The storedinputis Grok's wrapper ({ tool_name, tool_input, variant }), not the tool arguments. A mismatch against the published arguments could explain why the lookup found nothing. UNCLEAR: I did not confirm this part in the source.
I checked the tag v0.1.2-nightly.20261022.3526 and today's main. Neither has OkayOutput handling in packages/shared/src/toolOutput.ts.
Steps to reproduce
- Add a Grok provider instance in the T3 Code desktop app (Grok CLI 1.0.67).
- Start a thread and ask for a chart (for example, "show me a pie chart of …").
- The agent calls
t3-code__html_previewand thent3-code__html_render. Both succeed. - Expected: the page shows inline above the reply. Actual: nothing shows.
Version
0.1.2-nightly.20261022.3526 (desktop app AppImage; local server reports the same version)
Environment
Linux x64 (CachyOS, kernel 7.1.8), Node v26.12.1, Grok CLI 1.0.67 [stable], model Claude Opus 5.5 via Grok
Evidence
# server.trace.ndjson, 2026-10-22T15:02:44Z (thread bf547538-…)
McpServer.@effect/mcp/2025-06-18/tools/call Success
HtmlRender.prepare / HtmlRender.measure / HtmlRender.publish Success
# orchestration_v2_projection_turn_items, ordinal 18000017
type: dynamic_tool status: completed toolName: t3-code.html_render
input keys: tool_input, tool_name, variant
output: {"type":"MCP","tool_name":"html_render","server_name":"t3-code",
"output":{"OkayOutput":"{\"htmlRender\":{\"attachmentId\":\"…-html\",\"title\":\"Distilled triage status\",\"height\":2000,\"heights\":[[320,3354],…]},\"message\":\"Shown to the reader above your reply. …\"}"}}Related issues
- Read MCP OkayOutput strings when mounting html_render #21680 (open PR) fixes this exact envelope (
OkayOutput) and the annotated tool title. Its author did not test it in the desktop app; this report is a real desktop repro. - fix: html_render pages show inline when OpenCode or ACP agents wrap the call #17031 (open PR) is a broader fix for wrapped
html_rendercalls (OpenCodeexecute, Devin, CodeBuddy, GrokOkayOutput). - [Bug]: html_render pages never show for OpenCode 2 threads because Code Mode wraps the call in
execute#16745 is the same symptom for OpenCode 2 (Code Modeexecutewrapper). It is a different provider and a different envelope, so this is not a duplicate.
Fix applied or workaround
I applied no fix on the machine. Workaround: in Grok threads, ask for Mermaid charts instead of HTML pages.
Filed by
Claude Code (claude-opus-5-5) via t3 triage
Activity