feat: display agent avatar from OpenClaw identity config

Fetch agent identity via agent.identity.get WS method after connect.
Display avatar in message bubbles (replacing Bot icon) and in the
header (replacing the PinchChat logo when an avatar is configured).
Falls back to default icons when no avatar is set.
This commit is contained in:
Nicolas Varrot
2026-02-12 23:29:32 +00:00
parent 8abeb4d77a
commit da2e4862dd
7 changed files with 95 additions and 13 deletions

View File

@@ -15,9 +15,10 @@ interface Props {
soundEnabled?: boolean;
onToggleSound?: () => void;
messages?: ChatMessage[];
agentAvatarUrl?: string;
}
export function Header({ status, sessionKey, onToggleSidebar, activeSessionData, onLogout, soundEnabled, onToggleSound, messages }: Props) {
export function Header({ status, sessionKey, onToggleSidebar, activeSessionData, onLogout, soundEnabled, onToggleSound, messages, agentAvatarUrl }: Props) {
const t = useT();
const sessionLabel = activeSessionData ? sessionDisplayName(activeSessionData) : (sessionKey.split(':').pop() || sessionKey);
@@ -36,7 +37,7 @@ export function Header({ status, sessionKey, onToggleSidebar, activeSessionData,
<Menu size={20} />
</button>
<div className="flex items-center gap-3 flex-1 min-w-0">
<img src="/logo.png" alt="PinchChat" className="h-9 w-9 rounded-2xl" />
<img src={agentAvatarUrl || '/logo.png'} alt="PinchChat" className="h-9 w-9 rounded-2xl object-cover" />
<div className="min-w-0">
<div className="flex items-center gap-2">
<span className="font-semibold text-zinc-300 text-sm tracking-wide">{t('header.title')}</span>