Skip to content
Source
Sign inSign up
pingdotgg/t3code

html_render pages never show for Grok threads because the result arrives in output.OkayOutput #23714

ClosedMkassabov(GitHub profile, opens in a new tab) opened this issue 1 comment

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.

  1. html_render ran at 15:02:44 UTC. The server trace shows HtmlRender.prepare, measure, and publish all ending in Success for the thread.
  2. The stored dynamic_tool turn item has toolName: "t3-code.html_render" and status: "completed". Its output is Grok's MCP envelope: {"type":"MCP","tool_name":"html_render","server_name":"t3-code","output":{"OkayOutput":"<JSON string>"}}. The htmlRender reference is inside the OkayOutput string.
  3. readResult in packages/shared/src/toolOutput.ts only descends into structuredContent / content (or parses a top-level string). It does not read output.OkayOutput. So compactDynamicToolOutput(...).htmlRender is undefined, and htmlRenderFromToolItem returns undefined.
  4. The ACP adapter fallback in packages/provider-acp/src/server/adapter.ts (the status === "completed" && isHtmlRender branch) should then call mcpSessions.takeHtmlRender(threadId, input) and rewrite output to { htmlRender: page }. That did not happen: the stored output is still the raw envelope. The stored input is 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

  1. Add a Grok provider instance in the T3 Code desktop app (Grok CLI 1.0.67).
  2. Start a thread and ask for a chart (for example, "show me a pie chart of …").
  3. The agent calls t3-code__html_preview and then t3-code__html_render. Both succeed.
  4. 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. …\"}"}}
  • #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_render calls (OpenCode execute, Devin, CodeBuddy, Grok OkayOutput).
  • #16745 is the same symptom for OpenCode 2 (Code Mode execute wrapper). 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

  1. seankoji(GitHub profile, opens in a new tab)commented

    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.

    1. Agent called t3-code__html_preview then t3-code__html_render directly (no Code Mode, no execute wrapper). Both returned success.
    2. The tool told the model "Shown to the reader above your reply". Nothing appeared in the thread: no frame, no card, no error.
    3. The published page exists on disk: ~/.t3/userdata/attachments/<thread>-a358b523-…-html.html, 10,902 bytes, mtime matching the call.
    4. The stored item is still the Grok envelope:
    ordinal: 36000065   type: dynamic_tool   status: completed
    toolName: t3-code.html_render
    input:  { tool_name, tool_input, variant }
    output: {"type":"MCP","tool_name":"html_render","server_name":"t3-code",
             "output":{"OkayOutput":"{\"htmlRender\":{\"attachmentId\":\"…-html\",\"title\":\"…\",\"height\":1375,\"heights\":[[320,2545],…]},\"message\":\"Shown to the reader above your reply. …\"}"}}

    htmlRenderFromToolItem still finds nothing, because readResult in packages/shared/src/toolOutput.ts only descends into structuredContent / content and never into output.OkayOutput. compactDynamicToolOutput(...).htmlRender is undefined, so no html-render timeline entry is built.

    Retry after switching models

    The user then switched this same session to deepseek-v4.1-flash and asked for the visual again. That attempt hit the execute path in #16745 and also showed nothing. Switching models did not change the outcome: the page publishes either way, and neither result becomes an html-render entry.

    No fix applied locally. Workaround was the same: switch the visual to a non-HTML format.

  2. tanstack-source added labelsbug

  3. juliusmarminge closed this

Sign in to join this conversation.