Skip to content

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

Open

Description

@Mkassabov

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. …\"}"}}

Related issues

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions