Repository navigation
fix: load chat widgets behind authenticated gateways - #138074
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
ab7982e to
93c5344
Compare
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: blocked before merge. Reviewed September 4, 2026, 9:48 AM ET / 13:48 UTC. ClawSweeper reviewWhat this changesThis PR loads managed scripted Canvas chat widgets through the authenticated Gateway and renders them in the isolated sandbox while preserving declared public renderer assets. Merge readiness⛔ Blocked before merge - 3 items remain Keep open: the authenticated widget-loading repair remains necessary, and the reviewed gateway, sandbox, UI, and browser-proof paths contain no concrete introduced defect. Priority: P2 Review scores
Verification
How this fits togetherCanvas documents are persisted by OpenClaw and shown in the Control UI as chat widgets. This change routes protected document bytes through an authenticated Gateway request before passing them to the existing isolated browser sandbox. flowchart LR
A[Persisted Canvas document] --> B[Authenticated Gateway request]
B --> C[Size and liveness checks]
C --> D[Isolated sandbox host]
D --> E[Chat widget frame]
E --> F[Widget prompt bridge]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +698, Tests +1372, Docs +58, Config +1, Other +41. Total +2170 across 57 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one authenticated document-read path and one restricted public-renderer seam; the new owner boundaries are required to avoid re-exposing protected document URLs through direct iframe navigation. Do we have a high-confidence way to reproduce the issue? Yes—an isolated real-Gateway browser scenario is defined in source and exercises persisted Canvas and A2UI documents through the authenticated Control UI path, although this read-only review did not execute it. Is this the best way to solve the issue? Yes—the authenticated RPC preserves the existing widget capability without granting the iframe direct access to protected Gateway document URLs, and the isolated sandbox retains the required prompt boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 068ef71bd20e. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
Addressing the remaining ClawSweeper items:
|
d928782 to
dc9e8ad
Compare
|
Rebased onto the interchangeable task panels after resolving the dashboard test's import conflict. The widget runtime patch is unchanged; the final test extension adds two toolbar swaps and verifies that inline/sidebar frame identities and unsaved inputs survive. Fresh The prior CI attempt was superseded by this necessary rebase. Final-head hosted CI must pass before native prepare/merge. The image below is newly captured synthetic proof and has been fully inspected. |
6a6719b to
8b5e682
Compare
|
Review closeout for The latest ClawSweeper review finds no introduced defect and judges the authenticated RPC plus restricted renderer seam to be the best solution. I accept the documented growth for those missing boundaries: production +698, generated native DTOs +41. Chat and dashboard use one shared sandbox lifecycle; there is no parallel document-loading fallback. The stored-data flag does not represent a schema or serialization change. The diff in Review confidence is supported by direct owner/sibling inspection, clean independent reviews, the canonical build, 598 integration tests, 66 final boundary tests, the complete protocol check, and 14 passing Chromium cases. The final commit only synchronizes generated Android ordering; web/Gateway sources match the live-tested build. The public-path and method-order regressions demonstrably failed before repair. CI is still completing its iOS jobs. All executed test jobs have passed so far; one Node shard never acquired a runner and will be retried through the normal workflow recovery after the current run finishes. Native prepare/merge remains gated on completed green CI. No Team deployment was performed. |
|
Merged via squash.
|
…9-prep * commit '407a8f453c0f0306af1ddc0aafa8697c1d49a9e7': (312 commits) perf(ui): coalesce automation event refreshes (#138065) fix: reject incomplete Skill Workshop directory reads (#138082) test(ui): decouple rendering checks from generated wording (#138283) perf: avoid temporary entries in bounded JSON traversal (#138017) fix(irc): render complete messages before splitting (#138328) perf: prepare worker trajectory payloads only for recorded events (#138086) fix(mcp): paginated listings no longer time out after a forward clock step (#137206) fix(codex): page native transcripts and bound UI previews (#136282) feat(gateway): apply more settings without restarting (#138112) fix(docs): preserve mirrored ClawHub maturity links (#138241) fix(test): own UI animation and legacy database setup (#138296) fix(tts): preserve literal directives in Markdown code (#138319) fix: load chat widgets behind authenticated gateways (#138074) chore(ui): cover native approval finalization (#137259) fix(cron): cancel conditions before main-session handoff (#138313) fix(backup): preserve text after embedded NUL characters (#138327) fix(android): align composer control sheets (#137442) fix(ci): wait for replacement PR runs instead of stale failures (#138307) fix(sessions): keep Gateway responsive with long transcripts (#138094) fix(computer): map window inputs to delivered image coordinates (#138271) ... # Conflicts: # scripts/release-check.ts # test/release-check.test.ts
* fix: load chat widgets behind authenticated gateways Read managed scripted Canvas documents through the authenticated Gateway connection and share the isolated document loader with dashboard widgets. Keep inline prompt authority separate from dashboard grants, reject stale connection results, and preserve mounted input and theme state. Serve only declared public renderer assets on the sandbox origin so saved A2UI documents retain their existing source contract. Bound Canvas source reads and reject filesystem aliases at the common document reader. Verified the original Chrome auth-redirect failure, then passed the full production build and 11 Chromium regressions including a real isolated Gateway with persisted HTML and A2UI. Add regression coverage for source lifecycle, private prompts, auth boundaries, exports, sizing and theme. * fix: complete widget protocol and CI registration * fix: use supported normalization export in widget loader * test: register Canvas document reads in the release train * test: preserve widget state across task panel swaps * fix: cover default widgets and renderer path ownership Resolve effective sandbox policy once for authenticated loading and pinning, including default shortcode embeds. Reject any cross-kind renderer path collision involving a public reader while retaining private capability-scoped sharing. Document the namespace contract and exercise actual shortcode messages in both browser fixtures. Default-loader and mixed-order registration regressions failed before the repair. Focused UI and plugin/sandbox suites pass141 tests; targeted lint and independent review pass. * test: align widget assertions with authenticated rendering Assert the authenticated widget host, forwarded document identity, placement, and strict-policy transitions. Keep URL-only prompt bridge coverage without an accidental matching document ID, and make renderer fixture identities explicit for checked indexing. The full failing UI shard now passes all 5,149 tests across 301 files. Registrar tests, both original core test-type stripes, targeted lint, and independent review pass. * fix: preserve widget discovery and resource contracts * chore(android): regenerate gateway method ordering

What Problem This Solves
Interactive chat widgets showed Chrome’s blocked-page error behind an authentication proxy even when the same widget rendered in the dashboard sidebar. Direct iframe navigation was reaching an unframeable login page.
Why This Change Was Made
Chat now reads managed scripted Canvas HTML through its authenticated Gateway connection and uses the same sandbox loader as dashboards. Loading and pinning share the effective sandbox policy, including documented
[embed ref="…" /]messages with no explicit sandbox field. Strict previews stay script-free. The loader overlaps source retrieval with sandbox startup, deduplicates concurrent inline reads within a connection generation, preserves mounted state, and exposes retry after a failed load.The dedicated sandbox keeps widget content in an opaque-origin inner frame. Inline views receive only their prompt channel; dashboard tickets and grants remain with the dashboard. Saved A2UI widgets load declared public static renderer assets from the sandbox origin. Public asset paths are globally exclusive across all registered content kinds, including private registrations; existing private/private capability-scoped paths retain their contract. Public reader paths must match their URL pathname exactly and cannot claim the sandbox endpoint; private capability URL encoding remains unchanged. The additive Canvas RPC is appended to preserve existing advertised method indices. Canvas reads are bounded and reject filesystem aliases.
Production grows by 698 lines for the missing authenticated renderer/RPC and explicit public asset boundary; the shared board host removes 86 lines. Tests/support grow by 1,372 lines. No dependency, configuration option, stored-data schema, or protocol version is added.
User Impact
Default shortcode and explicitly scripted widgets load behind authentication proxies and retain input, size, and theme during streaming updates and Chat/Dashboard swaps. Dashboard source retrieval no longer waits for sandbox readiness, and ticket renewal keeps its existing behavior.
Evidence
pnpm build:ci-artifactspassed on8b5e682f081in 2m11.7s: runtime, all 90 local plugins, public SDK declarations/exports, and paired UI. Startup JavaScript is 349,348 bytes gzip, within the 350,141-byte limit.[embed ref]input, authenticated reads, persisted HTML/A2UI, opaque isolation, separate prompt/dashboard authority, tall sizing, theme/streaming retention, both Chat/Dashboard swaps, and history reload without duplicate previews.696f166efdbfollow-up only regenerates Android method ordering; all web/Gateway sources are byte-identical to the live-tested build.pnpm protocol:checkpasses, including Swift/Kotlin generation, registry coverage, and release-train checks.696f166efdb(attempt 2). One test shard never acquired its self-hosted runner; that shard alone was retried on a GitHub-hosted runner and passed, along with the aggregate gate. All other executing jobs passed on the first attempt. The preceding run caught the stale generated Android enum after the advertised-order correction; regeneration and the complete protocol check resolve it. The real-Gateway regression is registered once in the existing CI group.The stored document manifest, writer, paths, and serialization are unchanged. Existing-style persisted HTML and A2UI are covered by real isolated-Gateway browser proof. This is live local testing; no Team deployment was performed.
Follow-ups
The successful CI-artifact build covers runtime and public SDK declarations. An earlier full-profile build’s global non-SDK declaration pass exited 1 without a compiler diagnostic; that separate profile was not rerun. Follow-up: preserve raw child exit status, signal, and process-group state in the declaration runner.
An earlier CI attempt exposed a timing-sensitive Codex app-inventory diagnostic: a swallowed RPC timeout can be reported as unavailable scheduled apps before the total startup deadline classifies it. The operation still rejects, and the unchanged full test file passed all 31 cases locally and subsequently passed hosted CI. Follow-up: preserve timeout provenance and add deterministic timer-order coverage, retaining the denial and binding assertions.
Before/after captures below contain synthetic data and were fully inspected.