Skip to content

Commit aafc777

Browse files
fix(web): subagent avatar badge keeps project-enabled sibling instances
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent b1db993 commit aafc777

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎apps/web/src/components/chat/V2LifecycleRow.tsx‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import {
4444
import { Tooltip, TooltipTrigger, TooltipPopup } from "../ui/tooltip";
4545
import {
4646
applyProviderInstanceSettings,
47+
deriveProviderEntriesByEnvironment,
4748
deriveProviderInstanceEntries,
4849
normalizeProviderAccentColor,
4950
shouldShowInstanceBadge,
@@ -337,10 +338,12 @@ export function EnvironmentSubagentAvatar({
337338
);
338339
const settings = useAtomValue(serverEnvironment.settingsValueAtom(environmentId));
339340
const badgeLabel = useAtomValue(providersAtom, (providers) => {
340-
const derived = deriveProviderInstanceEntries(providers ?? EMPTY_SERVER_PROVIDERS);
341-
const entries = settings ? applyProviderInstanceSettings(derived, settings, null) : derived;
342-
const entry = entries.find((candidate) => candidate.instanceId === providerInstanceId);
343-
return entry !== undefined && shouldShowInstanceBadge(entry, entries)
341+
const scopedProviders = providers ?? EMPTY_SERVER_PROVIDERS;
342+
const entries = deriveProviderEntriesByEnvironment([
343+
settings ? [environmentId, scopedProviders, settings] : [environmentId, scopedProviders],
344+
]).get(environmentId);
345+
const entry = entries?.get(providerInstanceId);
346+
return entry !== undefined && shouldShowInstanceBadge(entry, entries?.values() ?? [])
344347
? entry.displayName
345348
: undefined;
346349
});

0 commit comments

Comments
 (0)