From 35f6206e636763b51cf41a3fe2e8bcf3d70c1c56 Mon Sep 17 00:00:00 2001 From: yiling Date: Wed, 29 Jul 2026 10:13:51 +0800 Subject: [PATCH] fix(dashboard): resolve creator avatar URLs using getAvatarUrl --- packages/core/src/agent/agent.ts | 33 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/packages/core/src/agent/agent.ts b/packages/core/src/agent/agent.ts index 25879ed0..bc175b9c 100644 --- a/packages/core/src/agent/agent.ts +++ b/packages/core/src/agent/agent.ts @@ -13,6 +13,7 @@ import { } from '@shumai/core/src/pagination' import '@shumai/db/src/prisma-json-types' import { s3Service } from '@shumai/core/src/s3/s3' +import { getAvatarUrl } from '@shumai/core/src/user/avatar' import AdmZip from 'adm-zip' import * as fs from 'fs' import * as path from 'path' @@ -425,21 +426,23 @@ export class AgentService { }, }) - return sessions.map((s) => ({ - id: s.id, - name: s.name, - type: s.type, - createdAt: s.createdAt.toISOString(), - creator: s.user - ? { - id: s.user.id, - name: s.user.name, - email: s.user.email, - image: s.user.image, - } - : null, - agentId: s.agentId, - })) + return await Promise.all( + sessions.map(async (s) => ({ + id: s.id, + name: s.name, + type: s.type, + createdAt: s.createdAt.toISOString(), + creator: s.user + ? { + id: s.user.id, + name: s.user.name, + email: s.user.email, + image: await getAvatarUrl(s.user.image), + } + : null, + agentId: s.agentId, + })), + ) }, async () => { return this.prismaClient.agentSession.count({ where })