@devries-cameron20 / t3code-1 / commits / 0343c83aa6
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web,mobile): lineage and agent rows show which account a subagent runs on (#24833)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>

Vitaly Iegorov committed Nov 1, 2026 at 03:05 UTC 0343c83aa6d033d0e55f2b74cfcb7c583bb24407
5 files changed +85 -14
apps/mobile/src/components/ProviderIcon.tsx
+3 -2
@@ -10,6 +10,7 @@ import { useId, useState } from "react";
10 import { resolveOfficialAcpRegistryIconUrl } from "@t3tools/contracts";
11 import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
12 import { AppText as Text } from "./ui/AppText";
13 +import { cn } from "../lib/cn";
14 import { getProviderClient } from "@t3tools/client-runtime/provider-clients";
15
16 type ProviderIconProps = {
@@ -158,7 +159,7 @@ export function ProviderInstanceIcon(props: {
159 readonly displayName: string;
160 readonly accentColor?: string;
161 readonly showBadge?: boolean;
161 - readonly surfaceColor: string;
162 + readonly surfaceColor?: string;
163 }) {
164 const accentColor = normalizeProviderAccentColor(props.accentColor);
165 return (
@@ -173,7 +174,7 @@ export function ProviderInstanceIcon(props: {
174 style={{ position: "absolute", right: -3, bottom: -3, width: 32, alignItems: "flex-end" }}
175 >
176 <View
176 - className={accentColor ? undefined : "bg-card"}
177 + className={cn(!accentColor && "bg-card", !props.surfaceColor && "border-screen")}
178 style={{
179 height: 12,
180 minWidth: 12,
apps/mobile/src/features/threads/SubagentRow.tsx
+38 -8
@@ -1,5 +1,9 @@
1 import { scopeProjectRef, scopeThreadRef } from "@t3tools/client-runtime/environment";
2 -import { resolveProviderInstanceDisplayName } from "@t3tools/client-runtime/state/provider-instance-display";
2 +import {
3 + normalizeProviderAccentColor,
4 + resolveProviderInstanceDisplayName,
5 + shouldShowInstanceBadge,
6 +} from "@t3tools/client-runtime/state/provider-instance-display";
7 import { resolveSubagentMetadata } from "@t3tools/client-runtime/state/subagent-display";
8 import type { EnvironmentId, OrchestrationV2Subagent } from "@t3tools/contracts";
9 import type { ReactNode } from "react";
@@ -7,7 +11,7 @@ import { View } from "react-native";
11
12 import { AppText as Text } from "../../components/ui/AppText";
13 import { SymbolView } from "../../components/ui/AppSymbol";
10 -import { ProviderIcon } from "../../components/ProviderIcon";
14 +import { ProviderIcon, ProviderInstanceIcon } from "../../components/ProviderIcon";
15 import { cn } from "../../lib/cn";
16 import { useEnvironmentServerConfig, useProject, useThreadShell } from "../../state/entities";
17 import { subagentCardDetail } from "./subagent-card-presentation";
@@ -102,9 +106,24 @@ function SubagentMetadata(props: {
106 const { environmentId, subagent } = props;
107 // A task in a linked environment runs a provider instance of that environment.
108 const config = useEnvironmentServerConfig(subagent.remoteChild?.environmentId ?? environmentId);
105 - const provider = config?.providers.find(
109 + const providers = (config?.providers ?? []).map((candidate) => {
110 + const rawConfig = config?.settings.providerInstances[candidate.instanceId]?.config;
111 + const instanceConfig =
112 + rawConfig !== null && typeof rawConfig === "object"
113 + ? (rawConfig as Readonly<Record<string, unknown>>)
114 + : null;
115 + const agentId = instanceConfig?.source === "local" ? undefined : instanceConfig?.agentId;
116 + return {
117 + ...candidate,
118 + driverKind: candidate.driver,
119 + accentColor: normalizeProviderAccentColor(candidate.accentColor),
120 + acpRegistryAgentId: typeof agentId === "string" ? agentId.trim() || undefined : undefined,
121 + };
122 + });
123 + const provider = providers.find(
124 (candidate) => candidate.instanceId === subagent.providerInstanceId,
125 );
126 + const showBadge = provider !== undefined && shouldShowInstanceBadge(provider, providers);
127 const parent = useThreadShell(scopeThreadRef(environmentId, subagent.threadId))?.source;
128 const child = useThreadShell(
129 subagent.childThreadId === null ? null : scopeThreadRef(environmentId, subagent.childThreadId),
@@ -123,11 +142,22 @@ function SubagentMetadata(props: {
142 });
143 return (
144 <View className="min-w-0 flex-row items-center gap-1.5">
126 - <ProviderIcon
127 - provider={provider?.driver ?? subagent.driver}
128 - iconUrl={provider?.iconUrl}
129 - size={12}
130 - />
145 + {showBadge ? (
146 + <ProviderInstanceIcon
147 + provider={provider.driver}
148 + iconUrl={provider.iconUrl}
149 + size={12}
150 + displayName={resolveProviderInstanceDisplayName(provider)}
151 + accentColor={provider.accentColor}
152 + showBadge
153 + />
154 + ) : (
155 + <ProviderIcon
156 + provider={provider?.driver ?? subagent.driver}
157 + iconUrl={provider?.iconUrl}
158 + size={12}
159 + />
160 + )}
161 <Text className="min-w-0 shrink text-xs text-foreground-muted" numberOfLines={1}>
162 {provider ? `${resolveProviderInstanceDisplayName(provider)} · ` : ""}
163 {modelLabel}
apps/web/src/components/chat/ThreadLineageWorkflowRow.tsx
+13 -1
@@ -10,6 +10,7 @@ import { AgentElapsed } from "./AgentElapsed";
10 import { SubagentTooltipContent } from "./SubagentTooltipContent";
11 import { ThreadHoverCardPopup } from "../ThreadHoverCard";
12 import { ThreadRelationshipIcon } from "./ThreadRelationshipIcon";
13 +import type { ProviderInstanceEntry } from "../../providerInstances";
14 import { cn } from "../../lib/utils";
15 import { ThreadDetailsControl } from "./ThreadDetailsControl";
16 import { CollapsibleSectionHeader, SectionHeaderStatus } from "../ui/collapsible-section-header";
@@ -52,6 +53,7 @@ function WorkflowMemberRow({
53 providerInstanceId,
54 provider,
55 providers,
56 + providerEntries,
57 driver,
58 onOpen,
59 }: {
@@ -59,6 +61,7 @@ function WorkflowMemberRow({
61 providerInstanceId: ProviderInstanceId;
62 provider: ServerProvider | undefined;
63 providers: ReadonlyArray<ServerProvider> | undefined;
64 + providerEntries: ReadonlyArray<ProviderInstanceEntry>;
65 driver: ProviderDriverKind | undefined;
66 onOpen: (threadId: string) => void;
67 }) {
@@ -78,7 +81,12 @@ function WorkflowMemberRow({
81 />
82 }
83 >
81 - <ThreadRelationshipIcon driver={driver} provider={provider} status={member.status} />
84 + <ThreadRelationshipIcon
85 + driver={driver}
86 + provider={provider}
87 + providerEntries={providerEntries}
88 + status={member.status}
89 + />
90 <span className="min-w-0 flex-1 truncate">{member.title}</span>
91 <span className="sr-only">{member.status}</span>
92 {member.startedAt ? (
@@ -113,6 +121,7 @@ export function ThreadLineageWorkflowRow({
121 providerInstanceId,
122 provider,
123 providers,
124 + providerEntries,
125 driver,
126 onOpenThread,
127 onStop,
@@ -124,6 +133,7 @@ export function ThreadLineageWorkflowRow({
133 readonly providerInstanceId: ProviderInstanceId;
134 readonly provider: ServerProvider | undefined;
135 readonly providers: ReadonlyArray<ServerProvider> | undefined;
136 + readonly providerEntries: ReadonlyArray<ProviderInstanceEntry>;
137 readonly driver: ProviderDriverKind | undefined;
138 readonly onOpenThread: (threadId: string) => void;
139 readonly onStop?: (() => void) | undefined;
@@ -221,6 +231,7 @@ export function ThreadLineageWorkflowRow({
231 providerInstanceId={providerInstanceId}
232 provider={provider}
233 providers={providers}
234 + providerEntries={providerEntries}
235 driver={driver}
236 onOpen={onOpenThread}
237 />
@@ -237,6 +248,7 @@ export function ThreadLineageWorkflowRow({
248 providerInstanceId={providerInstanceId}
249 provider={provider}
250 providers={providers}
251 + providerEntries={providerEntries}
252 driver={driver}
253 onOpen={onOpenThread}
254 />
apps/web/src/components/chat/ThreadRelationshipIcon.tsx
+15 -3
@@ -1,6 +1,7 @@
1 import type { ProviderDriverKind, ServerProvider } from "@t3tools/contracts";
2 import { BotIcon, type LucideIcon } from "lucide-react";
3 import { cn } from "../../lib/utils";
4 +import { shouldShowInstanceBadge, type ProviderInstanceEntry } from "../../providerInstances";
5 import { ProviderInstanceIcon } from "./ProviderInstanceIcon";
6
7 export function threadRelationshipStatusLabel(status: string | null): string {
@@ -45,22 +46,32 @@ export function threadRelationshipStatusLabel(status: string | null): string {
46 export function ThreadRelationshipIcon({
47 driver,
48 provider,
49 + providerEntries = [],
50 status,
51 fallbackIcon: FallbackIcon = BotIcon,
52 }: {
53 driver?: ProviderDriverKind | undefined;
54 provider?: ServerProvider | undefined;
55 + providerEntries?: ReadonlyArray<ProviderInstanceEntry>;
56 status: string | null;
57 fallbackIcon?: LucideIcon;
58 }) {
59 const iconClassName = "size-4 shrink-0 text-muted-foreground";
60 + const entry = driver
61 + ? providerEntries.find((candidate) => candidate.instanceId === provider?.instanceId)
62 + : undefined;
63 + const showInstanceBadge = entry !== undefined && shouldShowInstanceBadge(entry, providerEntries);
64 return (
65 <span className="relative inline-flex size-4 shrink-0 items-center justify-center">
66 {driver ? (
67 <ProviderInstanceIcon
68 driverKind={driver}
62 - displayName={provider?.displayName ?? driver}
63 - acpRegistryIconUrl={provider?.iconUrl}
69 + displayName={entry?.displayName ?? provider?.displayName ?? driver}
70 + accentColor={entry?.accentColor}
71 + acpRegistryAgentId={entry?.acpRegistryAgentId}
72 + acpRegistryIconUrl={entry?.acpRegistryIconUrl ?? provider?.iconUrl}
73 + showBadge={showInstanceBadge}
74 + size="compact"
75 iconClassName={iconClassName}
76 className="z-auto"
77 />
@@ -69,7 +80,8 @@ export function ThreadRelationshipIcon({
80 )}
81 <span
82 className={cn(
72 - "absolute -bottom-1 -right-1 size-2 rounded-full border-2 border-card",
83 + "absolute size-2 rounded-full border-2 border-card",
84 + showInstanceBadge ? "-left-1 -top-1" : "-bottom-1 -right-1",
85 status === "running" ||
86 status === "in_progress" ||
87 status === "pending" ||
apps/web/src/components/chat/ThreadRelationshipsControl.tsx
+16
@@ -66,6 +66,11 @@ import {
66 useThreadRelationshipShells,
67 } from "../../state/entities";
68 import { useEnvironment, useEnvironmentProviders } from "../../state/environments";
69 +import { serverEnvironment } from "../../state/server";
70 +import {
71 + applyProviderInstanceSettings,
72 + deriveProviderInstanceEntries,
73 +} from "../../providerInstances";
74 import { threadEnvironment } from "../../state/threads";
75 import { orchestrationEnvironment } from "../../state/orchestration";
76 import { useAtomCommand } from "../../state/use-atom-command";
@@ -357,6 +362,7 @@ export function ThreadRelationshipsPanel(props: {
362 const ref = scopeThreadRef(props.environmentId, props.threadId);
363 const projection = useThreadProjection(ref)?.projection ?? null;
364 const providersByEnvironment = useEnvironmentProviders();
365 + const settings = useAtomValue(serverEnvironment.settingsValueAtom(props.environmentId));
366 const relationshipShells = useThreadRelationshipShells(ref);
367 const allProjects = useProjects();
368 const archived = useArchivedThreadSnapshots([props.environmentId]);
@@ -394,6 +400,14 @@ export function ThreadRelationshipsPanel(props: {
400 const [stoppingId, setStoppingId] = useState<string | null>(null);
401 // Derive graphs after hooks to preserve their compiler cache.
402 const providers = providersByEnvironment.get(props.environmentId);
403 + const derivedProviderEntries = deriveProviderInstanceEntries(providers ?? []);
404 + const providerEntries = settings
405 + ? applyProviderInstanceSettings(
406 + derivedProviderEntries,
407 + settings,
408 + currentThread?.projectId ?? null,
409 + )
410 + : derivedProviderEntries;
411 const projects = allProjects.filter((project) => project.environmentId === props.environmentId);
412 const parentNativeStatus = parentProjection
413 ? deriveProviderSubagentStatus(parentProjection)?.status
@@ -673,6 +687,7 @@ export function ThreadRelationshipsPanel(props: {
687 <ThreadRelationshipIcon
688 driver={isSubagent && !isParent ? providerDriver : undefined}
689 provider={provider}
690 + providerEntries={providerEntries}
691 fallbackIcon={RelationshipIcon}
692 status={rowStatus}
693 />
@@ -729,6 +744,7 @@ export function ThreadRelationshipsPanel(props: {
744 providerInstanceId={agent.providerInstanceId}
745 provider={provider}
746 providers={providers}
747 + providerEntries={providerEntries}
748 driver={providerDriver}
749 onOpenThread={(memberThreadId) => openThread(memberThreadId as ThreadId)}
750 onStop={canStopWorkflow ? () => void stopWorkflow(agent.id) : undefined}