Skip to content

fix(ui): preserve initials for missing user avatars - #115976

Merged
steipete merged 4 commits into
mainfrom
codex/fix-missing-user-avatar-fallback
Jul 29, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/fix-missing-user-avatar-fallback

Conversation

@steipete

@steipete steipete commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Attributed Control UI messages can show a broken image glyph instead of readable initials when a user has neither an uploaded avatar nor a Gravatar.

Why This Change Was Made

The canonical user-avatar endpoint correctly returns 404 for that state. Connected same-origin avatar routes previously bypassed the shared loader and rendered directly as <img> URLs. The image error briefly selected the initials fallback, but a later Lit render reconciled the wrapper back to its non-fallback class and exposed the broken image again.

Route connected same-origin user avatars through the existing bounded, origin-pinned loader too. A missing avatar now resolves to no image source before rendering, while the loader retains the existing authorization, cross-origin, cache, upload-retry, MIME, size, and credential-boundary behavior.

User Impact

People without profile images keep deterministic initials in attributed chat messages. Uploaded avatars and Gateway-proxied Gravatars continue to load through the same shared cache.

Evidence

  • Authenticated production Chrome reproduction on team.openclaw.ai: the affected /api/users/<profile-id>/avatar request returned 404 application/json with {"ok":false,"error":{"type":"not_found"}}; comparison user-avatar requests returned 200 image/png.
  • Production DOM inspection showed the initials sibling was present but hidden because a transcript rerender had restored class="chat-avatar-slot" after the image failure.
  • Unit regression covers a same-origin Gateway without a bearer header, a 404 avatar response, removal of the image src, visible initials fallback state, and a subsequent rerender. Focused Testbox proof: 2 files, 44 tests passed.
  • Real Chromium proof on Blacksmith Testbox: ui/src/e2e/chat-attributed-identity.e2e.test.ts passed both cases. The missing-avatar case observes the initial 404, holds the uncached retry open, clicks the real Reply action to rerender the chat pane, proves H remains visible with no image source and no third request, then settles the retried 404 and rechecks the fallback. Run 30471844830.
  • Blacksmith Testbox changed gate passed: UI/core test types, targeted lint with 0 warnings/errors, formatting, Control UI i18n, changelog attribution, dependency guards, dead-code scans, and boundary guards.
  • Final Codex autoreview on the tested browser-proof diff: clean, no accepted/actionable findings. TruffleHog: clean.

The production screenshot contains private team-user identities, so it is intentionally not uploaded to this public PR. The Chromium proof uses synthetic identities and its terminal result is public above; a source-blind production hard-reload check will follow deployment.

AI-assisted; root cause, production request/DOM behavior, regression coverage, security boundary, and final branch diff were independently reviewed.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Jul 29, 2026
@steipete steipete self-assigned this Jul 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 29, 2026
@clawsweeper

clawsweeper Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 1:20 PM ET / 17:20 UTC.

ClawSweeper review

What this changes

Routes connected same-origin user-avatar URLs through the existing trusted loader so a missing avatar leaves readable initials visible after Control UI chat rerenders.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The patch remains a focused, well-proven Control UI bug fix with no newly identified correctness or security defect. It should stay open for the assigned maintainer’s normal merge decision because it carries the protected maintainer label and has in-progress required checks.

Priority: P2
Reviewed head: 6d06ddd21287a8fdfec7c9bc7ed13b1a6485d1c5

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Strong real browser proof and focused regression coverage support a clean, bounded repair; remaining work is normal protected-label merge handling rather than patch quality remediation.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR provides a public after-fix Chromium/Testbox transcript that exercises the actual missing-avatar response and a user-driven chat rerender; private production identities were appropriately withheld.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR provides a public after-fix Chromium/Testbox transcript that exercises the actual missing-avatar response and a user-driven chat rerender; private production identities were appropriately withheld.
Evidence reviewed 4 items Patch scope: The supplied diff changes the avatar resolver plus focused unit and browser E2E coverage; it routes connected same-origin gateway avatar URLs through the existing loader rather than adding a parallel fetch or fallback implementation.
Rerender regression coverage: The supplied unit test verifies a same-origin 404 removes the image source, exposes the sender initial, and preserves that fallback after a second render.
Real browser proof: The PR body and follow-up comment document a Blacksmith Testbox Chromium run that receives the 404, triggers a real Reply-driven rerender, and confirms initials remain visible with no image source; the PR is labeled proof: sufficient.
Findings None None.
Security None None.

How this fits together

Control UI chat receives attributed sender identity data from the Gateway and renders each sender’s avatar or initials beside transcript messages. The avatar resolver turns a trusted avatar URL into a safe image source or a missing result, which controls whether the chat avatar slot displays an image or deterministic initials.

flowchart LR
  A[Gateway sender identity] --> B[Chat transcript]
  B --> C[Avatar URL resolver]
  C --> D[Trusted avatar loader]
  D --> E[Image source or missing result]
  E --> F[Chat avatar slot]
  F --> G[Visible sender initials]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind the current base and several normal merge checks remain in progress; merge preparation must bind validation to the resulting current-base merge commit.
  • Resolve merge risk (P1) - The avatar resolver is shared UI infrastructure, so the maintainer should retain the focused browser regression proof when merging to ensure the same-origin loader path does not alter successful-avatar behavior.
Agent review details

Security

None.

PR surface

Source +4, Tests +145. Total +149 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 6 2 +4
Tests 2 145 0 +145
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 151 2 +149

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: ui/src/e2e/chat-attributed-identity.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Merge the focused loader-path repair after the current-base merge gate succeeds, retaining the unit and Chromium rerender regression coverage as the contract for missing same-origin avatars.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Merge the focused loader-path repair after the current-base merge gate succeeds, retaining the unit and Chromium rerender regression coverage as the contract for missing same-origin avatars.

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

Yes. The PR documents a real authenticated production 404 and a public Chromium regression path that triggers a live Reply rerender after the missing-avatar response, then verifies that initials remain visible without an image source.

Is this the best way to solve the issue?

Yes. Routing the connected same-origin route through the existing bounded trusted-avatar loader centralizes the missing-image result at the existing ownership boundary instead of relying on transient <img> error state that Lit can overwrite on rerender.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded UI readability regression in attributed chat messages, with a narrow repair and no evidence of broader message-delivery or availability impact.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR provides a public after-fix Chromium/Testbox transcript that exercises the actual missing-avatar response and a user-driven chat rerender; private production identities were appropriately withheld.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR provides a public after-fix Chromium/Testbox transcript that exercises the actual missing-avatar response and a user-driven chat rerender; private production identities were appropriately withheld.

Evidence

What I checked:

  • Patch scope: The supplied diff changes the avatar resolver plus focused unit and browser E2E coverage; it routes connected same-origin gateway avatar URLs through the existing loader rather than adding a parallel fetch or fallback implementation. (ui/src/lib/identity-avatar.ts:171, 6d06ddd21287)
  • Rerender regression coverage: The supplied unit test verifies a same-origin 404 removes the image source, exposes the sender initial, and preserves that fallback after a second render. (ui/src/pages/chat/chat-avatar.test.ts:410, 6d06ddd21287)
  • Real browser proof: The PR body and follow-up comment document a Blacksmith Testbox Chromium run that receives the 404, triggers a real Reply-driven rerender, and confirms initials remain visible with no image source; the PR is labeled proof: sufficient. (ui/src/e2e/chat-attributed-identity.e2e.test.ts:145, 6d06ddd21287)
  • Prior review continuity: The latest completed ClawSweeper cycle reviewed the earlier head dbf001d9d92b6a007a8e27b976c5b06753785c1d with no findings; the supplied current-head follow-up adds proof stabilization rather than a new functional direction. (ui/src/e2e/chat-attributed-identity.e2e.test.ts:145, 6d06ddd21287)

Likely related people:

  • steipete: Authored the focused resolver and regression-proof commits for this exact Control UI behavior and is assigned on the PR; current-main feature-history provenance could not be independently expanded in this read-only review environment. (role: recent UI contributor and assigned reviewer; confidence: medium; commits: bd8ea8417fdb, 795fdd0ea025, 6d06ddd21287; files: ui/src/lib/identity-avatar.ts, ui/src/pages/chat/chat-avatar.test.ts, ui/src/e2e/chat-attributed-identity.e2e.test.ts)

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-07-29T15:42:14.930Z sha 3c3df77 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-29T16:03:39.982Z sha 19d262333b870ce081237b764e55f76e48c0ecd5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-29T16:51:21.834Z sha dbf001d9d92b6a007a8e27b976c5b06753785c1d :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/fix-missing-user-avatar-fallback branch from 3c3df77 to c978624 Compare July 29, 2026 15:55
@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer disposition of the current ClawSweeper moves for head dbf001d9d92:

✓ uses one avatar placement and keeps shared-thread authors readable
✓ keeps missing same-origin avatar initials through a live rerender

Test Files  1 passed (1)
Tests       2 passed (2)
provider=blacksmith-testbox exitCode=0

The missing-avatar case receives the canonical 404, holds the intentional uncached retry pending, clicks the real Reply action to rerender the chat pane, verifies the synthetic H initials remain visible with no image source and no third request, then settles the retried 404 and verifies the fallback again. The companion existing case covers the successful avatar/identity surface.

  • Current-main refresh: the branch was rebased onto current main before the browser-proof commits and remains conflict-free. Newer behind-main drift is advisory under the repository landing policy; scripts/pr prepare-run and merge-run will bind the merge to the current base through the strict App-owned test-merge check.
  • Independent review: final Codex autoreview and TruffleHog are clean with no accepted/actionable findings.

The supplied production screenshot is not uploaded because it contains private team-user identities. The browser proof above is synthetic and safe for the public PR.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 29, 2026
@steipete
steipete force-pushed the codex/fix-missing-user-avatar-fallback branch from dbf001d to 6d06ddd Compare July 29, 2026 17:16
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 29, 2026
@steipete
steipete merged commit b930ee0 into main Jul 29, 2026
101 of 103 checks passed
@steipete
steipete deleted the codex/fix-missing-user-avatar-fallback branch July 29, 2026 17:34
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to nvtoroy/openclaw that referenced this pull request Jul 29, 2026
* origin/main: (683 commits)
  fix(discord): bound webhook send body reads (openclaw#109076)
  fix(ui): preserve initials for missing user avatars (openclaw#115976)
  feat(ui): add provider icons to coding catalogs (openclaw#115956)
  fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285)
  fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927)
  fix(test): isolate plugin install fixtures (openclaw#116008)
  fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729)
  fix(sms): isolate validated webhook quotas per sender (openclaw#104862)
  fix(sessions): recover deleted chats without endless retries (openclaw#115974)
  fix(restart): log errors from restart hook callbacks instead of swallowing (openclaw#108847)
  feat(ui): enable tool-loop detection from Labs (openclaw#115983)
  fix(telegram): catch unhandled rejections in webhook and ingress worker shutdown (openclaw#100998)
  fix(memory): keep rollbacks compatible after recall metadata upgrade (openclaw#116003)
  fix(ui): derive cron timezone suggestions (openclaw#115973)
  fix(scripts): bound dependency pin git lookups (openclaw#110570)
  fix(skills): preserve configless workshop apply upgrades (openclaw#115982)
  fix(gateway): cancel unread cron webhook bodies before SSRF release (openclaw#111236)
  fix(voice-call): pin Twilio webhook verification to the configured public path (openclaw#112800)
  fix(memory): make legacy session backfill rollback re-applicable (openclaw#116004)
  fix(security): fence external hook job name in isolated-agent prompts (openclaw#112501)
  ...

# Conflicts:
#	CHANGELOG.md
#	src/agents/tool-search-catalog.ts
#	src/agents/tool-search.test-support.ts
#	src/agents/tool-search.ts
vincentkoc added a commit to ryanrhughes/openclaw that referenced this pull request Jul 29, 2026
* commit 'e80fe942c8dae4b264acb2b501466224e842aa61':
  fix(gateway): stop start-time repair from retargeting managed services (openclaw#115935)
  fix(plugins): scope Codex relay with tool matchers (openclaw#109603)
  fix(discord): bound webhook send body reads (openclaw#109076)
  fix(ui): preserve initials for missing user avatars (openclaw#115976)
  feat(ui): add provider icons to coding catalogs (openclaw#115956)
  fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285)
  fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927)
  fix(test): isolate plugin install fixtures (openclaw#116008)
  fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729)
  fix(sms): isolate validated webhook quotas per sender (openclaw#104862)
  fix(sessions): recover deleted chats without endless retries (openclaw#115974)
  fix(restart): log errors from restart hook callbacks instead of swallowing (openclaw#108847)
  feat(ui): enable tool-loop detection from Labs (openclaw#115983)
  fix(telegram): catch unhandled rejections in webhook and ingress worker shutdown (openclaw#100998)
  fix(memory): keep rollbacks compatible after recall metadata upgrade (openclaw#116003)
vincentkoc added a commit to sunlit-deng/openclaw that referenced this pull request Jul 29, 2026
* origin/main: (823 commits)
  fix(memory): return early for blank searches (openclaw#116034)
  fix(tool-search): long-lived gateways leak heap from finished embedded runs (openclaw#114767)
  feat(harness): report copilot code-mode engagement on the attempt result (openclaw#115913)
  fix(ui): compact the macOS gateway picker menu (openclaw#115977)
  perf(codex): stream large CLI session JSONL scans (openclaw#115997)
  cron: reject webhook URLs with embedded credentials (openclaw#51822)
  refactor(agents): remove retired Codex CLI parser (openclaw#116017)
  feat(mac): hand off gateway-owned settings panes to the dashboard (openclaw#115999)
  fix(gateway): declare viewer presence explicitly instead of deriving it from subscriptions (openclaw#116001)
  test(plugins): include dreaming sidecar in startup expectation (openclaw#116018)
  fix(openai): prevent GPT-Live errors from stalling (openclaw#115582)
  fix(gateway): stop start-time repair from retargeting managed services (openclaw#115935)
  fix(plugins): scope Codex relay with tool matchers (openclaw#109603)
  fix(discord): bound webhook send body reads (openclaw#109076)
  fix(ui): preserve initials for missing user avatars (openclaw#115976)
  feat(ui): add provider icons to coding catalogs (openclaw#115956)
  fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285)
  fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927)
  fix(test): isolate plugin install fixtures (openclaw#116008)
  fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729)
  ...
SunnyShu0925 added a commit to SunnyShu0925/openclaw that referenced this pull request Jul 30, 2026
…nclaw#115833)

The gateway avatar endpoint (/api/users/<id>/avatar) always requires
authentication. The old code returned the plain URL for same-origin
requests without an auth header, causing the browser's <img> fetch to
get a 401 and never display the avatar.

Always route through loadIdentityAvatar() which sends available
credentials (Bearer token or session cookie) and produces a same-origin
blob URL. When no credential is available the fetch itself fails with
401, and the caller gracefully shows the initials fallback instead of a
broken-image icon.

Also fixes:
- Update test expectations from direct avatar URLs to blob URLs
- Add missing fetch/createObjectURL mocks in sidebar viewer presence test
- Resolve merge conflict with openclaw#115976 (preserve initials for missing avatars)
  which partially addressed same issue but kept a fallback path

Co-Authored-By: Claude <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
* fix(ui): preserve initials for missing user avatars

* test(ui): prove missing avatar fallback in browser

* chore: defer avatar note to release workflow

* test(ui): stabilize avatar fallback browser proof
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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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