diff --git a/desktop/src/features/channels/ui/ChannelScreen.tsx b/desktop/src/features/channels/ui/ChannelScreen.tsx index 1e5cef9323..ab830f11bb 100644 --- a/desktop/src/features/channels/ui/ChannelScreen.tsx +++ b/desktop/src/features/channels/ui/ChannelScreen.tsx @@ -310,6 +310,7 @@ export function ChannelScreen({ ...new Set([ ...messageAuthorPubkeys, ...messageMentionPubkeys, + ...(channelMembers ?? []).map((member) => member.pubkey), ...activeDmParticipantPubkeys, ...knownAgentPubkeys, ...typingEntries.map((entry) => entry.pubkey), @@ -317,6 +318,7 @@ export function ChannelScreen({ ], [ activeDmParticipantPubkeys, + channelMembers, knownAgentPubkeys, messageAuthorPubkeys, messageMentionPubkeys, @@ -603,9 +605,7 @@ export function ChannelScreen({ } = useChannelAgentSessions({ activeChannel, activeChannelId, - // Loaded only once none of the three agent queries are in their initial - // fetch, so a channel with genuinely zero agents still auto-closes a stale - // agentSession param (a disabled query reports isLoading=false — fine). + // Wait until agent queries leave initial load before resolving stale agentSession params. agentsLoaded: !channelMembersQuery.isLoading && !managedAgentsQuery.isLoading &&