fix(FN-1992): show resolved agent names in chat avatars
- Resolve assistant avatar labels from the active session agent map with fallback handling - Keep the built-in KB agent label as Fusion and fall back to a truncated agent ID when needed - Apply resolved labels to both stored assistant messages and streaming assistant avatars - Add ChatView tests for resolved labels, KB-agent fallback, and streaming avatar rendering - Document the @fusion/engine prebuild prerequisite in .fusion/memory.md
This commit is contained in:
@@ -412,6 +412,12 @@ export function ChatView({ projectId, addToast }: ChatViewProps) {
|
||||
);
|
||||
};
|
||||
|
||||
const agentName =
|
||||
agentsMap.get(activeSession?.agentId ?? "")?.name ||
|
||||
(activeSession?.agentId === KB_AGENT_ID
|
||||
? "Fusion"
|
||||
: (activeSession?.agentId?.slice(0, 30) ?? "Fusion"));
|
||||
|
||||
return (
|
||||
<div className="chat-view">
|
||||
{/* Sidebar */}
|
||||
@@ -566,7 +572,7 @@ export function ChatView({ projectId, addToast }: ChatViewProps) {
|
||||
{message.role === "assistant" && (
|
||||
<div className="chat-message-avatar">
|
||||
<Bot size={14} />
|
||||
<span>Fusion</span>
|
||||
<span>{agentName}</span>
|
||||
{activeSession && (() => {
|
||||
const modelTag = formatModelTag(activeSession.modelProvider, activeSession.modelId);
|
||||
return modelTag ? <span className="chat-model-tag">{modelTag}</span> : null;
|
||||
@@ -587,7 +593,7 @@ export function ChatView({ projectId, addToast }: ChatViewProps) {
|
||||
<div className="chat-message chat-message--assistant chat-message--streaming">
|
||||
<div className="chat-message-avatar">
|
||||
<Bot size={14} />
|
||||
<span>Fusion</span>
|
||||
<span>{agentName}</span>
|
||||
{activeSession && (() => {
|
||||
const modelTag = formatModelTag(activeSession.modelProvider, activeSession.modelId);
|
||||
return modelTag ? <span className="chat-model-tag">{modelTag}</span> : null;
|
||||
|
||||
Reference in New Issue
Block a user