Repository navigation
Description
Control UI: Personal card avatar 401 due to inconsistent avatar resolution between agents.list and agent.identity.get
Summary
The Personal card in Control UI shows a broken avatar image because agent.identity.get returns /avatar/<agentId> (a path requiring Bearer auth), while agents.list correctly resolves workspace-relative avatars to base64 data URIs. Since <img> tags cannot carry Authorization headers, the Personal card always gets 401.
Environment
- OpenClaw: 2026.6.10 (aa69b12)
Root Cause
Two RPC handlers resolve agent avatars differently:
agents.list RPC — works correctly
File: dist/session-utils-B4hOl7Zv.js:626-640
listAgentsForGateway() calls resolveIdentityAvatarUrl(cfg, agentId, avatar) which:
- Detects workspace-relative paths (e.g.,
avatar/photo.jpg) - Reads the file from disk
- Encodes it as
data:image/jpeg;base64,... - Returns the data URI as
identity.avatarUrl
The chat page reads identity.avatarUrl from the agents.list response → avatar displays correctly.
agent.identity.get RPC — broken
File: dist/agent-CnYmTiHt.js:2096-2100
resolveAssistantAvatarUrl() converts the configured avatar path to /avatar/<agentId> — a server endpoint that requires Bearer token authentication.
The Personal card uses this value in <img src="/avatar/main">. Since <img> tags cannot send Authorization headers, the request fails with 401 Unauthorized.
Frontend behavior
File: dist/control-ui/assets/index-BEWaPr0D.js:818
function xN(e) {
return to(e.assistantAvatarUrl, {
identity: {
avatar: e.assistantAvatar ?? void 0,
avatarUrl: e.assistantAvatarUrl ?? void 0
}
})
}- Chat page: uses
assistantAvatarUrl(data URI fromagents.list) → ✅ works - Personal card: uses
assistantAvatar(/avatar/mainfromagent.identity.get) → ❌ 401
Expected Behavior
agent.identity.get should resolve workspace-relative avatars to base64 data URIs the same way agents.list does (via resolveIdentityAvatarUrl), so the Personal card receives a data URI instead of an auth-gated URL path.
Alternatively, the /avatar/<agentId> endpoint could support cookie/session-based authentication so <img> tags can load it without headers.
Steps to Reproduce
- Configure an agent with
identity.avatar = "avatar/photo.jpg"(workspace-relative path) - Open Control UI, observe chat page — avatar displays correctly (data URI)
- Navigate to Personal/Identity card — avatar shows broken image (401 on
/avatar/<agentId>)
Suggested Fix
Align agent.identity.get's avatar resolution with agents.list by using resolveIdentityAvatarUrl() instead of resolveAssistantAvatarUrl() when the avatar is a workspace-relative path.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 29, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 28, 2026, 8:49 PM ET / 00:49 UTC.
Summary
Keep open: current main and v2026.6.10 still route local assistant identity avatars from
agent.identity.getthrough an auth-gated/avatar/<agentId>URL while theagents.listpath can inline workspace avatars, so the reported Personal card 401 remains actionable.Reproducibility: yes. by source inspection: configure a workspace-relative agent avatar, then
agent.identity.getreturns/avatar/<agentId>while authenticated avatar HTTP requests are required by the gateway. The same avatar source is inlined as a data URI byagents.list.Next step
This is a narrow, source-reproducible Control UI/Gateway bug with clear implementation and regression-test targets.
Review details
Best possible solution:
Share or extract the existing workspace-safe avatar data-URI resolution so
agent.identity.getandagents.listagree for local workspace avatars, without weakening/avatar/<agentId>auth or adding new config.Do we have a high-confidence way to reproduce the issue?
Yes by source inspection: configure a workspace-relative agent avatar, then
agent.identity.getreturns/avatar/<agentId>while authenticated avatar HTTP requests are required by the gateway. The same avatar source is inlined as a data URI byagents.list.Is this the best way to solve the issue?
Yes, the narrowest maintainable fix is to align the identity RPC with the existing workspace-safe data-URI resolver. Changing
/avatar/<agentId>to cookie/session auth would be broader and security-sensitive.AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 87db23e5432b.
Label changes
Label changes:
P2: The report describes a normal-priority Control UI rendering bug with limited blast radius and clear likely files.impact:other: The concrete impact is a broken Control UI Personal/Identity card avatar preview, which is maintainer-visible UI behavior outside the specific owned impact taxonomy.maturity:stable: The issue affects the M4 Stablegateway-runtimehosted web surface and Gateway RPC/API behavior.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P2: The report describes a normal-priority Control UI rendering bug with limited blast radius and clear likely files.impact:other: The concrete impact is a broken Control UI Personal/Identity card avatar preview, which is maintainer-visible UI behavior outside the specific owned impact taxonomy.maturity:stable: The issue affects the M4 Stablegateway-runtimehosted web surface and Gateway RPC/API behavior.Evidence reviewed
Acceptance criteria:
What I checked:
agent.identity.getresolves the assistant identity, passesidentity.avatarthroughresolveAssistantAvatarUrl, and returns the resultingavatarvalue to the UI. (src/gateway/server-methods/agent.ts:2851, 87db23e5432b)/avatar/<agentId>: For local filesystem-looking avatar values,resolveAssistantAvatarUrlbuilds the Control UI avatar route instead of a data URI. (src/gateway/control-ui-shared.ts:67, 87db23e5432b)handleControlUiAvatarRequestauthorizes read requests before serving avatar bytes; the existing HTTP test covers a 401 for/avatar/mainwithout a valid token when auth is enabled. (src/gateway/control-ui.ts:700, 87db23e5432b)listAgentsForGatewayusesresolveIdentityAvatarUrl, which bounds the workspace path, reads the file, and returnsdata:<mime>;base64,...asidentity.avatarUrl. (src/gateway/session-utils.ts:167, 87db23e5432b)resolveChatAvatarRenderUrlforprops.assistantAvatarUrl, withprops.assistantAvataronly as fallback identity data, so an auth-gated route can become an<img src>URL. (ui/src/ui/views/config-quick.ts:191, 87db23e5432b)v2026.6.10still hasagent.identity.getcallingresolveAssistantAvatarUrland returningavatarValue, so the shipped release named by the reporter is affected rather than already fixed. (src/gateway/server-methods/agent.ts:2898, aa69b12d0086)Likely related people:
src/gateway/control-ui-shared.ts,src/gateway/server-methods/agent.ts,src/gateway/session-utils.ts)src/gateway/control-ui.ts,ui/src/ui/app-render.ts,ui/src/ui/views/agents-utils.ts)src/gateway/control-ui-shared.ts,ui/src/ui/views/agents-utils.ts,src/gateway/session-utils.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.fix(agent): return data URIs for workspace-relative identity card ava…
steipete commentedon Jul 10, 2026
Resolved on
main: #102892 fixed the workspace-relative Personal-card projection, and #103657 hardened the final implementation at 505f8ae6.Exact-head CI passed. A real token-authenticated Gateway + Chromium run loaded the Control UI at
/openclaw, rendered the configured inline avatar, and observed zero/avatar/retries, zero 401s, and zero browser errors.fix(agent): return data URIs for workspace-relative identity card ava…