From 0e2b7c86a301c3f0622e43164d73582d96ade00a Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Fri, 7 Nov 2025 12:38:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=8A=E6=AC=A1=20e?= =?UTF-8?q?xamples=20=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/AgentChatComponent.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/components/AgentChatComponent.vue b/web/src/components/AgentChatComponent.vue index f5ec1b31..2acdca44 100644 --- a/web/src/components/AgentChatComponent.vue +++ b/web/src/components/AgentChatComponent.vue @@ -247,7 +247,10 @@ const currentAgentName = computed(() => { return '智能体'; }); -const currentAgent = computed(() => agents.value[currentAgentId.value] || null); +const currentAgent = computed(() => { + if (!currentAgentId.value || !agents.value || !agents.value.length) return null; + return agents.value.find(a => a.id === currentAgentId.value) || null; +}); const chatsList = computed(() => threads.value || []); const currentChatId = computed(() => chatState.currentThreadId); const currentThread = computed(() => {