openclaw - 💡(How to fix) Fix canvas.a2ui.push / canvas.a2ui.pushJSONL: returns ok but payload never reaches WKWebView renderer (macOS)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

On macOS, calling canvas.a2ui.push (or canvas.a2ui.pushJSONL) via the agent tool returns {"ok": true} but the A2UI surface is never rendered. The openclaw-a2ui-host custom element remains empty.

Root Cause

Root Cause (suspected)

Fix Action

Workaround

Use canvas action=eval to call applyMessages directly:

(function(){
  document.documentElement.style.setProperty("--openclaw-a2ui-inset-left","16px");
  document.documentElement.style.setProperty("--openclaw-a2ui-inset-right","16px");
  return window.openclawA2UI.applyMessages([...]);
})()

Note: eval must use IIFE or var — not const/let at top level (WKWebView evaluateJavaScript constraint).

Code Example

{"surfaceUpdate":{"surfaceId":"main","components":[{"id":"root","component":{"Column":{"children":{"explicitList":["t1"]}}}},{"id":"t1","component":{"Text":{"text":{"literalString":"Hello"},"usageHint":"h1"}}}]}}
{"beginRendering":{"surfaceId":"main","root":"root"}}

---

(function(){
  document.documentElement.style.setProperty("--openclaw-a2ui-inset-left","16px");
  document.documentElement.style.setProperty("--openclaw-a2ui-inset-right","16px");
  return window.openclawA2UI.applyMessages([...]);
})()
RAW_BUFFERClick to expand / collapse

Summary

On macOS, calling canvas.a2ui.push (or canvas.a2ui.pushJSONL) via the agent tool returns {"ok": true} but the A2UI surface is never rendered. The openclaw-a2ui-host custom element remains empty.

Environment

  • Platform: macOS 26.4.1 (Mac Studio, arm64)
  • OpenClaw node version: 2026.5.7
  • Gateway: LaunchAgent, port 18789
  • Node ID: 26894461... (Mac Studio)

Steps to Reproduce

  1. Have a connected macOS node with canvas.a2ui.push in its commands list
  2. Send a valid A2UI v0.8 JSONL payload via canvas action=a2ui_push:
{"surfaceUpdate":{"surfaceId":"main","components":[{"id":"root","component":{"Column":{"children":{"explicitList":["t1"]}}}},{"id":"t1","component":{"Text":{"text":{"literalString":"Hello"},"usageHint":"h1"}}}]}}
{"beginRendering":{"surfaceId":"main","root":"root"}}
  1. Observe: tool returns {"ok": true}
  2. Canvas panel opens but remains blank ("Waiting for agent" status card stays visible)

Diagnosis

Verified via canvas eval:

  • window.openclawA2UI exists and is object
  • window.openclawA2UI.applyMessages([...]) works correctly when called directly via canvas action=eval — returns {"ok": true, "surfaces": ["main"]} and renders correctly
  • window.__openclaw_ws is null / undefined — no WebSocket connection from the A2UI page to the gateway
  • window.openclawPostMessage exists but only sends messages TO the native side (outbound bridge), not inbound

Root Cause (suspected)

The Mac app receives the canvas.a2ui.push node command but does not call evaluateJavaScript on the WKWebView to pass the payload to window.openclawA2UI.applyMessages(). The inbound message delivery path from the native Mac app to the WKWebView JS context appears to be broken or unimplemented.

Workaround

Use canvas action=eval to call applyMessages directly:

(function(){
  document.documentElement.style.setProperty("--openclaw-a2ui-inset-left","16px");
  document.documentElement.style.setProperty("--openclaw-a2ui-inset-right","16px");
  return window.openclawA2UI.applyMessages([...]);
})()

Note: eval must use IIFE or var — not const/let at top level (WKWebView evaluateJavaScript constraint).

Expected

canvas.a2ui.push delivers the JSONL payload to the WKWebView and applyMessages renders it.

Actual

Payload is acknowledged by the gateway/node but never reaches the renderer.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix canvas.a2ui.push / canvas.a2ui.pushJSONL: returns ok but payload never reaches WKWebView renderer (macOS)