Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions desktop/src/features/channels/ui/BotActivityBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,27 @@ export function BotActivityComposerAction({
workingBotPubkeys.map((pubkey) => pubkey.toLowerCase()),
);

return agents.filter((agent) => workingSet.has(agent.pubkey.toLowerCase()));
}, [agents, workingBotPubkeys]);
const managed = agents.filter((agent) =>
workingSet.has(agent.pubkey.toLowerCase()),
);
if (managed.length > 0 || workingBotPubkeys.length === 0) {
return managed;
}

// This install does not manage the working agents — e.g. a second desktop
// signed in with the same owner identity. The observer stream is scoped to
// the owner, not the managing install, so activity is still renderable;
// derive display entries from the relay profile lookup instead of the
// local managed-agent registry.
return workingBotPubkeys.map((pubkey) => {
const profile = profiles?.[pubkey.toLowerCase()];

return {
pubkey,
name: profile?.displayName || profile?.name || "Agent",
};
});
}, [agents, profiles, workingBotPubkeys]);
const singleWorkingAgent =
workingAgents.length === 1 ? (workingAgents[0] ?? null) : null;
const transcript = useAgentTranscript(
Expand Down