diff --git a/desktop/src/features/channels/ui/ChannelPane.tsx b/desktop/src/features/channels/ui/ChannelPane.tsx index 8e32d5c7da..5296707ac2 100644 --- a/desktop/src/features/channels/ui/ChannelPane.tsx +++ b/desktop/src/features/channels/ui/ChannelPane.tsx @@ -285,9 +285,7 @@ export const ChannelPane = React.memo(function ChannelPane({ [activeChannel, agentPubkeys, currentPubkey], ); const huddleMemberPubkeysPending = - agentPubkeysPending && - huddleMemberPubkeys.length === 0 && - hasOtherDmParticipant(activeChannel, currentPubkey); + agentPubkeysPending && hasOtherDmParticipant(activeChannel, currentPubkey); const isActiveWelcomeChannel = activeChannel !== null && isWelcomeChannel(activeChannel); useComposerHeightPadding( diff --git a/desktop/src/features/messages/ui/SystemMessageRow.tsx b/desktop/src/features/messages/ui/SystemMessageRow.tsx index 4be6dd1e8d..df4dafe451 100644 --- a/desktop/src/features/messages/ui/SystemMessageRow.tsx +++ b/desktop/src/features/messages/ui/SystemMessageRow.tsx @@ -67,6 +67,24 @@ function resolveDisplayLabel( return resolveLabel(pubkey, currentPubkey, profiles); } +function isKnownAgentPubkey( + pubkey: string | undefined, + profiles: UserProfileLookup | undefined, + personaLookup?: Map, + agentPubkeys?: ReadonlySet, +) { + if (!pubkey) { + return false; + } + + const normalizedPubkey = normalizePubkey(pubkey); + return ( + agentPubkeys?.has(normalizedPubkey) === true || + profiles?.[normalizedPubkey]?.isAgent === true || + personaLookup?.has(normalizedPubkey) === true + ); +} + function ProfileName({ children, highlight = false, @@ -118,12 +136,16 @@ function ProfileName({ function SystemMessageAvatar({ actorPubkey, + agentPubkeys, currentPubkey, + personaLookup, profiles, targetPubkey, }: { actorPubkey: string | undefined; + agentPubkeys?: ReadonlySet; currentPubkey: string | undefined; + personaLookup?: Map; profiles: UserProfileLookup | undefined; targetPubkey: string | undefined; }) { @@ -141,6 +163,12 @@ function SystemMessageAvatar({ const singlePubkey = actorPubkey ?? targetPubkey; if (!hasActorAndTarget) { + const isSingleAgent = isKnownAgentPubkey( + singlePubkey, + profiles, + personaLookup, + agentPubkeys, + ); const avatar = ( +