Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: slove the recentTopicLinkError (#11896)

Shinji-Lib358413d1f4b
diff --git a/src/server/routers/lambda/topic.ts b/src/server/routers/lambda/topic.ts
index 8a69a0d8a5c..c507550c8fa 100644
--- a/src/server/routers/lambda/topic.ts
+++ b/src/server/routers/lambda/topic.ts
@@ -417,11 +417,9 @@ export const topicRouter = router({
const agentId = topicAgentIdMap.get(topic.id);
const agentInfo = agentId ? agentInfoMap.get(agentId) : null;
- // Clean agent info - if avatar/title are all null, return null
- const cleanedAgent = agentInfo ? cleanObject(agentInfo) : null;
- // Only return agent if it has meaningful display info (avatar or title)
- const validAgent =
- cleanedAgent && (cleanedAgent.avatar || cleanedAgent.title) ? cleanedAgent : null;
+ // Always return agent with id if agentId exists (even if avatar/title are null)
+ // Frontend needs agent.id to generate links
+ const validAgent = agentInfo ? cleanObject(agentInfo) : null;
return {
agent: validAgent,