From e61c9d46d325c9c0b8491cae7e61341f5068f1f2 Mon Sep 17 00:00:00 2001 From: matevip Date: Thu, 21 May 2026 14:43:46 +0800 Subject: [PATCH] fix(goal,ui): load active goal on conversation switch --- mateclaw-ui/src/views/ChatConsole.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mateclaw-ui/src/views/ChatConsole.vue b/mateclaw-ui/src/views/ChatConsole.vue index 9b325eb8..7862a220 100644 --- a/mateclaw-ui/src/views/ChatConsole.vue +++ b/mateclaw-ui/src/views/ChatConsole.vue @@ -258,6 +258,7 @@ import ModelSelector from '@/components/chat/ModelSelector.vue' import { useEChartsRenderer } from '@/composables/useEChartsRenderer' import { useKatexRenderer } from '@/composables/useKatexRenderer' import { useMermaidRenderer, handleMermaidDownload } from '@/composables/useMermaidRenderer' +import { useGoalStore } from '@/stores/useGoalStore' // ============ Talk Mode ============ const showTalkMode = ref(false) @@ -1008,6 +1009,16 @@ watch([selectedAgentId, currentConversationId], () => { syncRouteState() }) +// RFC 48 — load the active goal whenever the user switches conversation. +// The avatar ring listens on goalStore.activeGoalByConv[cid]; without this +// fetch the ring would only appear after an SSE event mutated the store. +const goalStore = useGoalStore() +watch(currentConversationId, async (cid) => { + if (cid) { + await goalStore.loadActiveForConversation(cid) + } +}, { immediate: true }) + // Refetch agent capabilities (modalities + sidecar config) on agent change so // the multimodal routing hint above the input box can react synchronously when // the user attaches an image / video.