fix(web): subagents sent a follow-up show as running in Lineage #15334
Mergedscratchyone(GitHub profile, opens in a new tab)merged 3 commits into
main fromrefs/pull/15334/headmerged by maria-rcks View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/web/src/components/chat/ThreadRelationshipsControl.tsx line 181Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -162,3 +166,16 @@162166 return formatSubagentDisplayTitle(input.title);163167 }164168169+/**170+ * A delegated task settles with its first run, but the parent can keep sending171+ * the child follow-ups. While the child thread has a live run, the row's timer172+ * and hover card follow that run instead of the settled task.173+ */174+function liveSubagent<Agent extends RuntimeSubagent>(175+ agent: Agent | undefined,176+ childThread: OrchestrationV2ThreadShell | null | undefined,177+): Agent | undefined {178+ const liveStatus = childThread?.activityRunStatus;179+ if (!agent || !liveStatus) return agent;180+ const startedAt = childThread.activityRunStartedAt;181+ return {
- apps/web/src/components/chat/ThreadRelationshipsControl.tsx line 184OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -162,3 +166,19 @@162166 return formatSubagentDisplayTitle(input.title);163167 }164168169+/**170+ * A delegated task settles with its first run, but the parent can keep sending171+ * the child follow-ups. While the child thread has a live run, the row's timer172+ * and hover card follow that run instead of the settled task.173+ */174+function liveSubagent<Agent extends RuntimeSubagent>(175+ agent: Agent | undefined,176+ childThread: OrchestrationV2ThreadShell | null | undefined,177+): Agent | undefined {178+ const liveStatus = childThread?.activityRunStatus;179+ if (!agent || !liveStatus) return agent;180+ const startedAt = childThread.activityRunStartedAt;181+ return {182+ ...agent,183+ status: liveStatus === "running" || liveStatus === "waiting" ? liveStatus : "pending",184+ startedAt: startedAt ? DateTime.formatIso(startedAt) : agent.startedAt,
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
- apps/web/src/components/chat/ThreadRelationshipsControl.tsx line 188Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -164 +168,21 @@164168169+/**170+ * A delegated task settles with its first run, but the parent can keep sending171+ * the child follow-ups. While the child thread has a live run, the row's timer172+ * and hover card follow that run instead of the settled task.173+ */174+function liveSubagent<Agent extends RuntimeSubagent>(175+ agent: Agent | undefined,176+ childThread: OrchestrationV2ThreadShell | null | undefined,177+): Agent | undefined {178+ const liveStatus = childThread?.activityRunStatus;179+ if (!agent || !liveStatus) return agent;180+ const startedAt = childThread.activityRunStartedAt;181+ return {182+ ...agent,183+ status: liveStatus === "running" || liveStatus === "waiting" ? liveStatus : "pending",184+ startedAt: startedAt ? DateTime.formatIso(startedAt) : null,185+ completedAt: null,186+ // The settled task's output belongs to its first run, not this one.187+ progress: null,188+ result: null,
maria-rcks merged thisd307127
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed