Repository navigation
feat: connect UI development to a Gateway - #143052
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. |
|
Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 8:47 AM ET / 12:47 UTC (Revision 2). ClawSweeper reviewWhat this changesAdds an optional Vite development proxy that connects the Control UI’s WebSocket, capabilities, media, and plugin resources to a selected Gateway while preserving Gateway-scoped credentials. Merge readiness✅ Ready for maintainer review The prior mounted-avatar finding is resolved, and no remaining blocking defect was found. Current main still lacks this development transport; the maintainer-authored PR remains useful for landing. Priority: P2 Review scores
Verification
How this fits togetherVite serves the developing Control UI, while the selected Gateway supplies authenticated connections and resources. The new transport translates browser requests without replacing the Gateway’s authentication or plugin authorization. flowchart LR
A[Developer selects Gateway] --> B[Vite development server]
C[Control UI browser] --> D[Gateway identity and credentials]
D --> B
B --> E[Gateway authentication and route checks]
E --> F[Capabilities and plugin resources]
F --> C
B --> G[UI hot reload]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +182, Tests +353, Docs +27. Total +562 across 22 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one opt-in development transport that preserves upstream identity, existing authentication, mounted resource paths, and unchanged production behavior. Do we have a high-confidence way to reproduce the issue? Not applicable as a new development mode; current-main source and the supplied baseline screenshot establish the existing cross-origin plugin limitation. Is this the best way to solve the issue? Yes. The opt-in transport reuses Gateway authentication and resource owners, and the avatar correction applies the canonical mount before translation without adding a competing plugin API. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9bf06f7cc0f3. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Added: a configurable Gateway transport for the Vite Control UI with normal authentication and hot reload. |
Allow the Vite Control UI to use a configured Gateway for capabilities, WebSocket traffic, and protected HTTP resources while preserving Gateway identity, normal pairing, and hot reload.
Additional instructions
Keep Allow edits from maintainers enabled for this PR.
What Problem This Solves
Fixes an issue where developers could connect
pnpm ui:devto a real Gateway over WebSocket while its enabled capabilities, media, and native plugin UI remained unavailable.Why This Change Was Made
Adds
OPENCLAW_UI_DEV_GATEWAY_URLto route Gateway HTTP and WebSocket traffic through Vite. The browser retains the actual Gateway identity for credentials and settings, while an upstream-specific proxy path and scoped cookie paths prevent a stale page from forwarding credentials to a replacement target. Gateway authentication and browser Origin checks remain in place.User Impact
Developers can use the selected Gateway's capabilities while retaining Vite's normal reload behavior and the Gateway's existing login and owner pairing flows. Selecting another upstream requires restarting the dev server. Unconfigured development and production builds retain their existing behavior.
Evidence
Visual evidence
Native plugin stays connected through Vite HMR and reconnects after a paired reload
ui-dev-gateway-hmr-reload.webm
Visual verification
82699a7c3fcb2462dcf4b4bb4b92e03aa0095a39