fix: prevent subagent confirmation from being hidden in compact mode

hasConfirmingTool only checks ToolCallStatus.Confirming, but subagent
approvals arrive via resultDisplay.pendingConfirmation while the tool
status remains Executing. Add hasSubagentPendingConfirmation to the
showCompact guard so tool groups with pending subagent confirmations
are always force-expanded.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
秦奇 2026-04-10 21:54:14 +08:00
parent e45c9974a4
commit 47ee03c41a

View file

@ -100,11 +100,13 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
const focusedSubagentCallId = focusedSubagentRef.current;
// Compact mode: entire group → single line summary
// Force-expand when: user must interact (Confirming), tool errored,
// shell is focused, or user-initiated
// Force-expand when: user must interact (Confirming or subagent pending
// confirmation), tool errored, shell is focused, or user-initiated
const hasSubagentPendingConfirmation = subagentsAwaitingApproval.length > 0;
const showCompact =
compactMode &&
!hasConfirmingTool &&
!hasSubagentPendingConfirmation &&
!hasErrorTool &&
!isEmbeddedShellFocused &&
!isUserInitiated;