Repository navigation
feat: load CDN libraries and fonts in widgets - #147265
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Additional live model proof passed on the first turn: OpenAI GPT-5.5 read the bundled |
|
Codex review: blocked before merge. Reviewed September 13, 2026, 3:35 PM ET / 19:35 UTC (Revision 2). ClawSweeper reviewWhat this changesAllows widgets to load libraries and fonts from seven shared CDN origins across browser, native, and Discord hosts, and adds visualization guidance. Merge readiness⛔ Blocked before merge - 3 items remain The prior registered-renderer defect is addressed, and no new blocking correctness finding was established. This remains useful, maintainer-sponsored work that is absent from fetched main and the latest release. Priority: P2 Review scores
Verification
How this fits togetherThe widget tool turns agent-authored markup into isolated interactive content in chat and dashboards. Document policies and host adapters control resource loading while separate grants govern API connections and host actions. flowchart TD
A[Agent markup] --> B[Widget document wrapper]
C[Shared CDN allowlist] --> B
C --> D[Host resource policies]
B --> D
D --> E[Browser native or Discord renderer]
E --> F[CDN libraries and fonts]
E --> G[Separately granted API and host actions]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +39, Tests +106, Docs +222, Other +71. Total +438 across 24 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one shared static-resource policy, preserve document-specific restrictions and existing grant owners, and retain the explicit guidance about third-party code and stored widgets. Do we have a high-confidence way to reproduce the issue? Not applicable as a new capability request: current main intentionally lacks these CDN permissions, and the supplied browser observations exercise the proposed behavior. Is this the best way to solve the issue? Yes. Sharing the allowlist through the existing widget policy owners avoids competing implementations, and the revised direct-response policy preserves registered renderers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ac59d5e09eb4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review Fixed the direct-host registered-renderer regression in bef6215. The response policy now preserves the local scripts already approved by a document CSP; it does not override ordinary HTML restrictions. The PR body includes actual before/after A2UI rendering, unchanged document hashes, negative controls, and new failing-before/passing-after regressions. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Share public static-resource origins across document, sandbox, and channel policies while keeping API access and native Gateway pins separate. Add visualization guidance for inline code explanations and persistent dashboards.
Keep document-approved same-origin renderer scripts available in the intersecting HTTP CSP. Cover stored and newly wrapped registered documents without granting API connections.
bef6215 to
b3dc74b
Compare
|
Maintainer disposition for the current-head review: the A2UI compatibility finding is fixed, and the re-review reports no actionable correctness or security findings. The requested CDN execution model is approved: library code can access its widget content and granted capabilities, with separate API grants and opaque-origin isolation retained. Native WebView and Discord live-platform coverage remain explicit limitations; the current CI, including Apple and Android jobs, and the focused boundary tests passed. The two images unavailable to the reviewer were inspected locally before upload; the after-render and model-turn evidence is recorded above. Both feature patches are unchanged by the rebase, verified with All current checks are green, including the required |
|
Merged via squash.
|
Ports the android-relevant upstream commits since the last sync: - openclaw#147265 widget CDN library/font loading (ChatInlineWidgetView.kt) - openclaw#147275 control Gateway desktops without paired nodes (GatewayProtocol.kt) - openclaw#144387 settle remote wear chat outcomes / replace stale streamed text (WearProxyController.kt: empty canonical content is a replacement, not absence) - openclaw#147441 rolling session recaps in Activity (GatewayProtocol.kt) ChatInlineWidgetView.kt and WearProxyController.kt are byte-identical to upstream; GatewayProtocol.kt gains the session-scoped computer/activity method and event enum entries. No i18n changes. Dropped wear/ app and test files (not compiled in the phone build). Co-authored-by: openclaw <[email protected]>
* feat: load CDN libraries and fonts in widgets Share public static-resource origins across document, sandbox, and channel policies while keeping API access and native Gateway pins separate. Add visualization guidance for inline code explanations and persistent dashboards. * fix: preserve local widget renderers in direct hosting Keep document-approved same-origin renderer scripts available in the intersecting HTTP CSP. Cover stored and newly wrapped registered documents without granting API connections.

Closes #147261
What Problem This Solves
Widgets fail to render charts or custom typography when their HTML loads external libraries, stylesheets, or fonts.
User Impact
Agents can use public CDN assets for interactive code explanations and dashboard widgets. The new bundled
visualizeskill covers inline visuals, native reports, stable-name dashboard updates, and live data access. Existing inline widgets must be recreated to receive the new document policy.Why This Change Was Made
One shared allowlist now feeds the document, browser sandbox, direct HTTP, and Discord policies. Direct Canvas responses also preserve local renderer scripts already permitted by registered documents; ordinary HTML retains its stricter document policy. Native clients admit HTTPS assets only after receiving an enforcing Gateway document policy; Gateway certificate pins and legacy document restrictions remain intact. The public SDK budget increases by one for the shared policy constant.
CDN assets load without a dashboard grant. Their code can see widget content and use granted widget capabilities, while API connections and host actions remain separately controlled. No unsafe-eval, arbitrary resource origins, or parent-origin access is added. PNG exports may not retain externally loaded styles or fonts.
Evidence
Inspected synthetic live screenshots
Direct-host compatibility proof
The exact source Canvas HTTP handler and actual bundled A2UI renderer were exercised in Chromium. The same persisted pre-CDN document bytes and a newly created
show_widget(kind: "a2ui")document were tested before and after the correction.script-src-elemscript-src-elemAfter correction, both registered cases retained opaque origin (
null), rejected storage access, and blocked API fetches; the test server received zero API requests. The two new regression cases fail before the correction and pass afterward. This was direct source-HTTP/browser proof; no native-device rendering claim is made.A separate actual OpenAI GPT-5.5 model turn also read the bundled skill and authored a working inline CDN widget on its first turn: model proof.
Stored A2UI direct-host before/after
Before correction (renderer blocked):
After correction (same document bytes):