fix(ui): actionable diagnostics for missing widget sandbox origin behind proxies#111909
Merged
Conversation
steipete
marked this pull request as ready for review
July 20, 2026 16:39
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 21, 2026
…ind proxies (openclaw#111909) * fix(ui): actionable error and doctor warning for missing widget sandbox origin * fix(ui): phrase sandbox-origin diagnostics as conditional guidance * test(ui): satisfy deadcode and mock-factory gates for sandbox diagnostics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
On reverse-proxied or tunneled deployments (Control UI on a public origin, gateway on localhost), pinned dashboard widgets fail to render when
mcp.apps.sandboxOriginis not configured: the browser derives the sandbox URL by substituting the sandbox port onto the gateway origin, which such proxies typically do not route. The only surfaced error is "Widget authorization failed after repeated refresh attempts" — operators chase authorization config while the actual gap is a missing sandbox origin route. Hit in production on team.openclaw.ai behind a Cloudflare Tunnel after #111687 moved HTML widgets onto the shared sandbox host; all pinned widgets showed the misleading error untilwidgets.openclaw.aiwas routed to the sandbox listener andmcp.apps.sandboxOriginwas set.Why This Change Was Made
The browser cannot distinguish an unroutable derived sandbox origin from a genuine authorization failure, so the terminal error keeps the authorization fact but adds the deployment hint exactly when it is plausible (origin was derived by port substitution and its host is non-loopback). Server-side,
gateway.auth.mode: "trusted-proxy"is a crisp signal the Control UI sits behind a proxy, so doctor now surfaces a conditional check for the same gap. Both diagnostics are phrased as conditional guidance, not diagnosed failures — a proxy can legitimately route the derived port. The fail-closed sandbox posture is untouched; no legacy same-origin iframe path is resurrected.User Impact
Operators of proxied/tunneled gateways get an actionable pointer (
mcp.apps.sandboxOrigin+ route the sandbox listener, documented in docs/cli/mcp.md) instead of a dead-end authorization error, both in the widget card and inopenclaw doctor. Local and explicitly configured deployments keep the existing message.Evidence
ui/src/components/board/board-widget-frame.test.ts(derived remote origin → hint; explicit origin / loopback / unresolved → unchanged message) andnoteSandboxOriginProxyWarningcases insrc/commands/doctor-config-analysis.test.ts(warns for trusted-proxy without origin; silent with origin or other auth modes). All pass withnode scripts/run-vitest.mjs.board-view.test.tspasses;ui:i18n:verifyclean.