feat(agent): use inlined base64 data URIs for preset avatars

This commit is contained in:
yiling
2026-06-03 23:42:48 +08:00
parent fe51088f2a
commit 2afc6920ab
7 changed files with 20 additions and 35 deletions
+5 -1
View File
@@ -8,7 +8,11 @@ export async function getAvatarUrl(
imageKeyOrUrl: string | null | undefined,
): Promise<string | undefined> {
if (!imageKeyOrUrl) return undefined
if (imageKeyOrUrl.startsWith('http://') || imageKeyOrUrl.startsWith('https://')) {
if (
imageKeyOrUrl.startsWith('data:') ||
imageKeyOrUrl.startsWith('http://') ||
imageKeyOrUrl.startsWith('https://')
) {
return imageKeyOrUrl
}
try {