html_render pages never show for Grok threads because the result arrives in output.OkayOutput #23714
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#
- #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. - #17031 (open PR) is a broader fix for wrapped
html_rendercalls (OpenCodeexecute, Devin, CodeBuddy, GrokOkayOutput). - #16745 is the same symptom for OpenCode 2 (Code Mode
executewrapper). 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
tanstack-source added labelsbug
juliusmarminge closed this
Sign in to join this conversation.
Still reproduces on
0.1.7-nightly.20261031.4004#Second independent reproduction, same envelope, nine days later on the current nightly. Grok provider instance, model
grok-4.7, Linux x64, web UI.t3-code__html_previewthent3-code__html_renderdirectly (no Code Mode, noexecutewrapper). Both returned success.~/.t3/userdata/attachments/<thread>-a358b523-…-html.html, 10,902 bytes, mtime matching the call.htmlRenderFromToolItemstill finds nothing, becausereadResultinpackages/shared/src/toolOutput.tsonly descends intostructuredContent/contentand never intooutput.OkayOutput.compactDynamicToolOutput(...).htmlRenderisundefined, so nohtml-rendertimeline entry is built.Retry after switching models#
The user then switched this same session to
deepseek-v4.1-flashand asked for the visual again. That attempt hit theexecutepath in #16745 and also showed nothing. Switching models did not change the outcome: the page publishes either way, and neither result becomes anhtml-renderentry.No fix applied locally. Workaround was the same: switch the visual to a non-HTML format.