fix(ui): Agent 面板信息不随对话更新 — 事件时序 + clones 刷新
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- streamStore: zclaw:agent-profile-updated 事件从记忆提取前改为 .then() 后触发
- RightPanel: profile 更新事件中新增 loadClones() 刷新 selectedClone 数据
This commit is contained in:
iven
2026-04-16 22:57:32 +08:00
parent 0d79993691
commit 1309101a94
2 changed files with 16 additions and 11 deletions

View File

@@ -179,7 +179,7 @@ export function RightPanel({ simpleMode = false }: RightPanelProps) {
.catch(() => setUserProfile(null));
}, [currentAgent?.id]);
// Listen for profile updates after conversations
// Listen for profile updates after conversations (fired after memory extraction completes)
useEffect(() => {
const handler = (e: Event) => {
const detail = (e as CustomEvent).detail;
@@ -187,6 +187,8 @@ export function RightPanel({ simpleMode = false }: RightPanelProps) {
invoke<AgentInfo | null>('agent_get', { agentId: currentAgent.id })
.then(data => setUserProfile(data?.userProfile ?? null))
.catch(() => {});
// Refresh clones data so selectedClone (name, role, nickname, etc.) stays current
loadClones();
}
};
window.addEventListener('zclaw:agent-profile-updated', handler);