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(conversation): hide Usage extra for local hetero agents until model arrives (#15501)

Arvin Xub1ada9e5fc37
diff --git a/src/features/Conversation/Messages/Assistant/Extra/index.tsx b/src/features/Conversation/Messages/Assistant/Extra/index.tsx
index 8c8a3194382..f5bd222d664 100644
--- a/src/features/Conversation/Messages/Assistant/Extra/index.tsx
+++ b/src/features/Conversation/Messages/Assistant/Extra/index.tsx
@@ -1,5 +1,5 @@
import { LOADING_FLAT } from '@lobechat/const';
-import { HETEROGENEOUS_TYPE_LABELS } from '@lobechat/heterogeneous-agents';
+import { isRemoteHeterogeneousType } from '@lobechat/heterogeneous-agents';
import { type ModelPerformance, type ModelUsage } from '@lobechat/types';
import { Flexbox } from '@lobehub/ui';
import { memo } from 'react';
@@ -31,10 +31,16 @@ export const AssistantMessageExtra = memo<AssistantMessageExtraProps>(
const isLogin = useUserStore(authSelectors.isLogin);
const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
+ // Local CLI hetero agents (claude-code, codex) only report `model` after
+ // turn_metadata lands mid-stream, so gating on `!!model` alone would skip
+ // showing Usage at all. Remote hetero (openclaw, hermes) never expose a
+ // real model id and rely on the brand label fallback in Usage — only those
+ // should bypass the model check, otherwise local agents render a lone
+ // empty-model ModelIcon while streaming.
const showUsage =
isDevMode &&
content !== LOADING_FLAT &&
- (!!model || !!(provider && HETEROGENEOUS_TYPE_LABELS[provider]));
+ (!!model || (!!provider && isRemoteHeterogeneousType(provider)));
const showTts = isLogin && !!extra?.tts;
const showTranslate = isLogin && !!extra?.translate;