Repository navigation
fix: browser screenshots fail on routed Control UI pages - #126290
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 6:59 AM ET / 10:59 UTC. ClawSweeper reviewWhat this changesSeparates Control UI navigation paths from Gateway resource paths and validates browser-node file envelopes before persisting and rewriting their returned paths. Merge readinessKeep open for maintainer review: the source-backed repair is coherent and no blocking defect was found, but the protected maintainer label and compatibility decision still require explicit owner acceptance. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Control UI derives a navigation base for browser routing and a Gateway resource base for media, icons, avatars, and bootstrap requests. Browser-node proxy results cross from a remote browser host into the Gateway media store before the UI consumes them. flowchart LR
A[Deep Control UI URL] --> B[Route-base resolution]
B --> C[Control UI navigation]
B --> D[Gateway resource mount]
D --> E[Media, icons, and avatars]
F[Browser node result] --> G[Validate and persist files]
G --> E
Decision needed
Why: This is an intentional compatibility contract across all same-origin resource consumers, not a mechanical correctness repair that automation should choose alone. Before merge
Agent review detailsSecurityNone. PR surfaceSource +89, Tests +203. Total +292 across 75 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Adopt the server-declared resource mount as the sole source for Gateway HTTP resources while preserving inferred routing for navigation, then merge after owner confirmation. Do we have a high-confidence way to reproduce the issue? Yes: current-main source shows an empty server mount becomes a pathname-inferred resource base, causing routed pages to request assistant media beneath that route namespace; the PR also supplies real after-fix evidence. Is this the best way to solve the issue? Yes: carrying separate navigation and resource facts from the Gateway bootstrap is the narrowest canonical repair, and is preferable to per-consumer route exceptions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4af09d4961c9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
|
Land-ready verification is complete on exact head Maintainer decision: accept the explicit route-base/resource-base compatibility model. Navigation and Gateway HTTP resources are distinct facts in deployments such as Local proof:
Real behavior proof:
The first CI run exposed three stale test fixtures in the changed contract; those were repaired and their exact files rerun locally. Exact-head CI run 32243011921 is fully green. No known proof gaps remain. |
02cfca2 to
c7e08cb
Compare
|
Merged via squash.
|
…6290) * fix(browser): validate proxied file ownership * fix(ui): separate route and resource base paths * test(ui): align resource base fixtures * test(ui): align route-base fixtures with focus routes * perf(ui): keep profile avatar URLs out of startup
What Problem This Solves
Fixes an issue where users opening the Browser panel from a routed Control UI URL could see
Screenshot fetch failed (404)even though the managed browser loaded the page and captured the screenshot successfully.The same route/resource confusion could also send chat media, icons, avatars, and other Gateway-owned HTTP resources to a router namespace that did not own them. Separately, a browser node could return a successful file-bearing result without transferring every referenced file back to the Gateway.
Why This Change Was Made
The Control UI now carries two explicit paths: the router base remains responsible for application navigation, while a server-declared resource base owns Gateway HTTP resources. This preserves routed pages without prefixing assistant media or other resource requests with the router namespace.
Browser node files now use one fail-closed validate, persist, and rewrite operation. Missing, duplicate, or unreferenced file payloads fail before any files are written, and both Gateway RPC and agent-tool proxy consumers use the same owner.
This PR is AI-assisted. I reviewed the architecture, diff, tests, and live behavior directly.
User Impact
The Browser panel renders captured pages normally from routed Control UI URLs instead of showing a misleading 404. New-session routing continues to work, and local chat media plus other Gateway-served UI resources resolve from the correct mount. Operators do not need a config change or migration.
Evidence
Before
After
browser-focus-after.webm
Isolated Hetzner post-fix proof
browser-focus-hetzner-after.webm
Live diagnosis on
openclaw-teamestablished the original boundary: Chromium and the Gateway were on the same Hetzner host,browser.requestsucceeded, the screenshot existed, the canonical/__openclaw__/assistant-mediaroute returned the complete image, and the inferred/focus/__openclaw__/assistant-mediaroute returned 404.An isolated real-Gateway/real-Chromium before-and-after run then proved both sides of the repair:
Landing integration note: PR #126143 reserved root
/focus/*URLs for the new focused-presentation contract before this PR merged. The final integrated regression uses the default/__openclaw__route namespace for the route/resource split. The original/focus/newlive evidence remains the reproduction that exposed the conflation; team-owned legacy/focus/<app-route>links now need a separate route migration rather than weakening the canonical Focus grammar.Exact merged-head Hetzner proof
Merge commit
1fa82e9795762a87937fd25f847c6ff75e0534f2was built and run in an isolated checkout on the Hetzner host after the Focus-route integration./__openclaw__/newremained the New Session route,/__openclaw__/chat/mainrendered Example Domain in the Browser panel, the resource mount was the empty root, and production health remained HTTP 200.browser-route-resource-merged-after.webm
Focused validation:
node scripts/run-vitest.mjs src/gateway/control-ui.http.test.ts— 144 passednode scripts/run-vitest.mjs extensions/browser/src/browser/proxy-files.test.ts extensions/browser/src/browser-node-proxy.test.ts extensions/browser/src/gateway/browser-request.profile-from-body.test.ts— 65 passednode scripts/run-vitest.mjs ui/src/app/browser.test.ts ui/src/app/bootstrap.test.ts ui/src/components/browser/browser-client.test.ts ui/src/pages/chat/components/chat-message.test.ts ui/src/pages/plugins/icon-loader.test.ts— 241 passed across two shardsnode scripts/run-vitest.mjs src/gateway/control-ui.auto-root.http.test.ts ui/src/pages/plugins/plugins-page.test.ts— 29 passed across two shardsnode scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/login-gate.e2e.test.ts— 12 passednode scripts/check-changed.mjs— passedpnpm build— passedFinal merged production/tooling LOC: +288/-229 (net +59). Tests/support: +375/-165.