From 2ac798694727d4f3ae534ae54907dd0cf7a13e86 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sun, 23 Aug 2026 15:20:28 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=AB=82=20fix:=20Route=20Subagent=20Activi?= =?UTF-8?q?ty=20Through=20the=20Chat=20Renderer=20(#15137)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: align subagent activity with chat UI * fix: preserve subagent activity boundaries * fix: preserve subagent panel state semantics * fix: preserve subagent activity metadata * fix: preserve live subagent event metadata * fix: scope subagent phases by message step * fix: retire closed subagent message phases --- .../Messages/Content/AskUserQuestionCall.tsx | 21 +- .../components/Chat/Messages/Content/Part.tsx | 1 + .../Messages/Content/Parts/SubagentCall.tsx | 81 ++++--- .../Parts/__tests__/SubagentCall.test.tsx | 54 +++++ .../__tests__/AskUserQuestionCall.test.tsx | 18 ++ .../SharedSubagentActivityDialog.test.tsx | 16 ++ .../SharedSubagentActivityDialog.tsx | 9 +- .../Chat/Subagents/SubagentActivity.test.tsx | 171 ++++++++++++- .../Chat/Subagents/SubagentActivity.tsx | 224 ++++++------------ .../Chat/Subagents/SubagentThreadPanel.tsx | 1 + .../Chat/Subagents/adapters.test.ts | 220 ++++++++++++++++- .../src/components/Chat/Subagents/adapters.ts | 99 +++++++- client/src/locales/en/translation.json | 1 - client/src/store/subagents.ts | 1 + .../utils/__tests__/subagentContent.test.ts | 124 ++++++++++ client/src/utils/subagentContent.ts | 130 ++++++++-- e2e/specs/mock/subagent-activity.spec.ts | 1 - packages/data-provider/src/types/runs.ts | 1 + 18 files changed, 956 insertions(+), 217 deletions(-) diff --git a/client/src/components/Chat/Messages/Content/AskUserQuestionCall.tsx b/client/src/components/Chat/Messages/Content/AskUserQuestionCall.tsx index 57675883ee..8ff7d55629 100644 --- a/client/src/components/Chat/Messages/Content/AskUserQuestionCall.tsx +++ b/client/src/components/Chat/Messages/Content/AskUserQuestionCall.tsx @@ -1,7 +1,7 @@ import { useState, useEffect, useCallback } from 'react'; import { useRecoilValue } from 'recoil'; import { MessageCircleQuestion, TriangleAlert } from 'lucide-react'; -import type { Agents } from 'librechat-data-provider'; +import type { Agents, PartMetadata } from 'librechat-data-provider'; import { getSubmittedAskAnswer, parseAskUserQuestionArgs, @@ -32,6 +32,7 @@ export default function AskUserQuestionCall({ output, toolCallId, isSubmitting = false, + runStepStatus, failed = false, showCursor = false, onExpand, @@ -40,6 +41,7 @@ export default function AskUserQuestionCall({ output: string; toolCallId?: string; isSubmitting?: boolean; + runStepStatus?: PartMetadata['runStepStatus']; failed?: boolean; showCursor?: boolean; onExpand?: () => void; @@ -87,8 +89,9 @@ export default function AskUserQuestionCall({ return null; } })(); + const terminalFailure = failed || runStepStatus === 'failed'; const answered = - !failed && + !terminalFailure && (batch != null ? batch.questions.every((item) => typeof batchAnswers?.[item.id] === 'string') : effectiveOutput.length > 0); @@ -103,7 +106,7 @@ export default function AskUserQuestionCall({ * immediately; an abandoned pause only shows its "no answer" state after * the turn is no longer submitting. */ - if (!answered && !failed && isSubmitting) { + if (!answered && !terminalFailure && runStepStatus == null && isSubmitting) { return ; } @@ -131,7 +134,7 @@ export default function AskUserQuestionCall({ * question header on `!isSubmitting`. */ const statusLabel = (() => { - if (failed) { + if (terminalFailure) { return localize('com_ui_question_failed'); } return count > 1 @@ -155,7 +158,7 @@ export default function AskUserQuestionCall({ finishedText={statusLabel} subtitle={summary} icon={ - failed ? ( + terminalFailure ? (