[BUG] Desktop: MCP widget spinner never resolves when the tool result is large enough to be persisted to disk
What happens
In Claude Code Desktop, when an MCP tool returns a widget-bearing result that is large, the harness persists the oversized result to disk and hands the model a file pointer instead of the payload:
Error: result (183,422 characters) exceeds maximum allowed tokens. Output has been saved to
~/.claude/projects/<project>/<session>/tool-results/mcp-...-validate_and_render_mermaid_diagram-....txt
<img width="2736" height="1286" alt="Image" src="https://github.com/user-attachments/assets/aa0c7ac3-2118-4ef8-8c4f-c1b2a22e5782" />
The agent side works fine (it can read the persisted JSON, which contains valid, renderedSVG, etc.). But the widget card in the desktop transcript shows a loading spinner forever - it apparently waits for a payload that was redirected to disk and never falls back.
Reproduced consistently with the Mermaid Chart connector's validate_and_render_mermaid_diagram, whose result JSON embeds both a base64 SVG and a base64 PNG (~150-180KB), so it always trips the size limit and the widget never renders. Other sessions show the same spinner-forever card for this tool.
Expected
Either render the widget from the persisted payload, or fall back to the standard collapsible tool-result view. Never an indefinite spinner. Mainly for this mermaid flows, which the competing Codex app has gotten down better, eg:
<img width="2770" height="2156" alt="Image" src="https://github.com/user-attachments/assets/e5a4cfb9-551c-4b65-9b3f-d60643906d01" />
Steps to reproduce
- Claude Code Desktop, with the Mermaid Chart MCP connector enabled.
- Ask the agent to validate/render any non-trivial Mermaid diagram via
validate_and_render_mermaid_diagram. - Tool result exceeds the max tool-result size and is saved to
tool-results/*.txt; the transcript'sWidget from Mermaid Chart validate_and_render_mermaid_diagramcard spins indefinitely.
Notes
- Likely the same family as #65653 (empty widget boxes), but the trigger here is specifically the oversized-result-persisted-to-file path, and the symptom is a perpetual spinner rather than an empty box.
- Workaround that works today: have the agent
jqtherenderedSVGdata URI out of the persisted file, base64-decode it, and share the SVG as a file.
Environment
- Claude Code 2.1.212, Desktop app, macOS 26.5.2 (25F84)
- MCP server: Mermaid Chart connector
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗