Skip to content

fix(ui): preserve profile avatars under Control UI base paths - #119308

Merged
fuller-stack-dev merged 5 commits into
openclaw:mainfrom
fuller-stack-dev:codex/fix-control-ui-status-layout-20260804
Aug 5, 2026
Merged

fuller-stack-dev merged 5 commits into
openclaw:mainfrom
fuller-stack-dev:codex/fix-control-ui-status-layout-20260804

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • keep /api/users/<id>/avatar canonical for root, /ws, and cross-origin gateways
  • apply an explicit Control UI base path only for same-origin deployments such as /wilfred
  • accept the configured base-path alias at the gateway using exact segment matching
  • preserve authenticated avatar blob sharing across profile and sidebar surfaces

Root cause

The browser-generated avatar URL ignored the Control UI's explicit public mount path. In a same-origin /wilfred deployment it requested host-root /api/users/..., which bypassed the only proxied path and returned 404 before reaching OpenClaw. The earlier attempted repair incorrectly treated arbitrary WebSocket paths such as /ws as HTTP API mounts.

Tests

  • 68 focused Control UI unit tests
  • 4 gateway avatar-path tests
  • 4 Chromium profile-page E2E tests under /wilfred
  • focused oxlint, oxfmt, and git diff --check
  • fresh autoreview: clean

@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review August 4, 2026 18:40
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Aug 4, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 4, 2026
@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 2:16 AM ET / 06:16 UTC.

ClawSweeper review

What this changes

The PR makes profile-avatar requests use an explicit same-origin Control UI base path while retaining canonical root routes for WebSocket and cross-origin gateway setups.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. This focused fix remains necessary on current main, and the exact head resolves the mounted-Control-UI avatar path without reviving the earlier WebSocket-path inference or session-layout changes.

Priority: P2
Reviewed head: ee139f231d9b50c299035323f9366c5462767f88

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The narrowed exact-head patch is coherent and well-covered, with final exact-head validation still pending.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its mocked Chromium and focused tests remain useful supplemental evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its mocked Chromium and focused tests remain useful supplemental evidence.
Evidence reviewed 7 items Current-main gap: Current main computes the Control UI base path but does not pass it to avatar resolution; avatar URLs therefore remain rooted at /api/users/... in a mounted same-origin deployment.
Exact-head client fix: The PR passes the resolved base path through connection setup and applies it only when the browser and gateway origins match.
Exact-head gateway ownership: The gateway accepts only the configured exact base-path alias, converts it back to the canonical avatar route, and retains the existing handler’s authentication, CORS, and method checks.
Findings None None.
Security None None.

How this fits together

The Control UI derives authenticated avatar URLs from its gateway connection, then the gateway authorizes and serves the profile image. When a reverse proxy mounts the UI under a public path, the browser URL and gateway route admission must use the same path contract.

flowchart LR
  A[Profile and sidebar] --> B[Avatar URL resolution]
  C[Control UI base path] --> B
  D[Gateway connection origin] --> B
  B --> E[Avatar HTTP request]
  E --> F[Gateway route admission]
  F --> G[Authenticated profile image]
Loading

Before merge

  • Resolve merge risk (P1) - This adds a compatibility-sensitive avatar alias beneath an existing configured Control UI base path; complete exact-head browser and gateway validation should confirm root, mounted, and cross-origin deployments before merge.
  • Complete next step (P2) - No actionable repair remains; await exact-head validation and normal maintainer merge handling.
Agent review details

Security

None.

PR surface

Source +34, Tests +91. Total +125 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 5 51 17 +34
Tests 4 100 9 +91
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 151 26 +125

Review metrics

Metric Value Why it matters
Production versus test LOC production +51/-17 (net +34); tests +100/-9 (net +91) The production growth implements one client-to-gateway routing contract, with substantially larger regression coverage across its affected boundaries.

Merge-risk options

Maintainer options:

  1. Verify the proxy-routing contract (recommended)
    Finish exact-head validation for root, mounted-path, and cross-origin avatar requests before merging the new public alias.

Technical review

Best possible solution:

Land the explicit same-origin base-path contract after exact-head validation, preserving canonical root avatar routes for WebSocket and cross-origin gateways.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main computes a mounted UI base path but routes profile avatars at host root, while the gateway admits only the root path. No independent live proxy deployment was run in this read-only review.

Is this the best way to solve the issue?

Yes. Carrying the already-resolved Control UI base path to the avatar owner is narrower and safer than inferring an HTTP mount from an arbitrary WebSocket pathname.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 77f7560b4184.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its mocked Chromium and focused tests remain useful supplemental evidence.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove merge-risk: 🚨 other: Current PR review merge-risk labels are merge-risk: 🚨 compatibility.

Label justifications:

  • P2: Mounted Control UI deployments can lose profile avatars, but the affected flow has a bounded workaround and limited blast radius.
  • merge-risk: 🚨 compatibility: Existing reverse-proxy deployments may depend on root-only avatar routing or a configured public UI mount, so the new alias requires upgrade-path validation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its mocked Chromium and focused tests remain useful supplemental evidence.

Evidence

What I checked:

  • Current-main gap: Current main computes the Control UI base path but does not pass it to avatar resolution; avatar URLs therefore remain rooted at /api/users/... in a mounted same-origin deployment. (ui/src/app/bootstrap.ts:274, 77f7560b4184)
  • Exact-head client fix: The PR passes the resolved base path through connection setup and applies it only when the browser and gateway origins match. (ui/src/lib/identity-avatar.ts:75, ee139f231d9b)
  • Exact-head gateway ownership: The gateway accepts only the configured exact base-path alias, converts it back to the canonical avatar route, and retains the existing handler’s authentication, CORS, and method checks. (src/gateway/server-http.ts:526, ee139f231d9b)
  • Base-path normalization contract: Gateway runtime configuration normalizes the existing Control UI base path before HTTP routing, matching the PR’s segment-bounded alias contract. (src/gateway/server-runtime-config.ts:115, 77f7560b4184)
  • Regression coverage and merge compatibility: The head adds root, mounted, near-miss, WebSocket, cross-origin, and mocked Chromium coverage; a three-way merge of the PR base, current main, and head succeeds without conflict. (ui/src/lib/identity-avatar.test.ts:101, ee139f231d9b)
  • Feature provenance: Avatar upload, the canonical profile route, and subsequent resolver/cache maintenance originate in the avatar feature history led by Peter Steinberger. (ui/src/lib/identity-avatar.ts:73, f8e35afecc67)

Likely related people:

  • steipete: Introduced the profile-avatar HTTP route and later maintained the client resolver/cache and current gateway/UI adjacency. (role: avatar-route feature owner and recent area contributor; confidence: high; commits: f8e35afecc67, a2ff6cb52bc2, 4707934b3062; files: ui/src/lib/identity-avatar.ts, src/gateway/server-http.ts, src/gateway/user-profiles-http-path.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the in-progress exact-head checks complete before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-04T20:09:35.558Z sha ccc6aaec348d171883f98eeee37f149c129800b0 :: found issues before merge. :: [P1] Preserve the canonical leading run indicator | [P2] Render a fork marker only for actual fork lineage
  • reviewed 2026-08-04T22:21:03.883Z sha 6d50f34 :: found issues before merge. :: [P1] Keep the canonical leading run indicator | [P2] Reserve the full state-and-action width
  • reviewed August 4, 2026, 8:23 PM ET / August 5, 2026, 00:23 UTC sha unknown :: found issues before merge. :: [P1] Preserve root avatar routes for WebSocket endpoint paths | [P1] Keep the canonical leading run indicator | [P2] Reserve the full state-and-action width

@fuller-stack-dev fuller-stack-dev self-assigned this Aug 4, 2026
@fuller-stack-dev
fuller-stack-dev force-pushed the codex/fix-control-ui-status-layout-20260804 branch from ccc6aae to 6d50f34 Compare August 4, 2026 22:13
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XL and removed size: L labels Aug 4, 2026
@fuller-stack-dev fuller-stack-dev changed the title fix(ui): preserve active session status layout fix(ui): preserve session status and avatar paths Aug 4, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 4, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head: ee139f231d9b50c299035323f9366c5462767f88.

Applied the prior rank-up moves:

  • removed the trailing session-status redesign and retained current main's leading indicator;
  • removed the duplicate overlap work already landed in fix(ui): chat rail pill status overlaps the headline text #119397;
  • replaced WebSocket-path inference with an explicit same-origin Control UI base path;
  • kept /api/users/... canonical for /ws and cross-origin gateways;
  • added exact-segment gateway alias and root/mounted/negative regression coverage.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@fuller-stack-dev fuller-stack-dev changed the title fix(ui): preserve session status and avatar paths fix(ui): preserve profile avatars under Control UI base paths Aug 5, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 5, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Land-ready maintainer evidence for exact head ee139f231d9b50c299035323f9366c5462767f88:

  • Prepared diff: 9 files, +151/-26; status/sidebar redesign and duplicate overlap work removed.
  • pnpm --dir ui exec vitest run --config vitest.config.ts src/lib/identity-avatar.test.ts src/app/gateway-store.test.ts — 68 passed.
  • pnpm exec vitest run src/gateway/user-profiles-http-path.test.ts --config test/vitest/vitest.gateway-core.config.ts — 4 passed.
  • pnpm exec vitest run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/profile-page.e2e.test.ts — 4 Chromium tests passed under /wilfred.
  • Focused oxlint, oxfmt, and git diff --check passed.
  • Fresh branch autoreview: clean, no accepted/actionable findings.
  • Exact-head hosted CI: 92 successful checks, 0 failures, 0 pending (run).
  • Exact-head ClawSweeper: no actionable findings or security issues (review); its only optional move was to await CI, now complete.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 119308 passed and reused immutable exact-head hosted proof.

Remaining proof gaps: none for the changed routing contract.

@fuller-stack-dev
fuller-stack-dev merged commit 47ce269 into openclaw:main Aug 5, 2026
138 of 149 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the codex/fix-control-ui-status-layout-20260804 branch August 5, 2026 06:31
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
…aw#119308)

* fix(ui): preserve active session status layout

* fix(ui): preserve avatar paths and fork lineage

* fix(ui): preserve avatars under control UI base paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant