diff --git a/frontend/src/components/NormalizedConversation/PendingApprovalEntry.tsx b/frontend/src/components/NormalizedConversation/PendingApprovalEntry.tsx index a3b45ce8..78816d96 100644 --- a/frontend/src/components/NormalizedConversation/PendingApprovalEntry.tsx +++ b/frontend/src/components/NormalizedConversation/PendingApprovalEntry.tsx @@ -147,20 +147,18 @@ function DenyReasonForm({ disabled={isResponding} className="text-sm" /> -
-
- - -
+
+ +
); diff --git a/frontend/src/hooks/useConversationHistory.ts b/frontend/src/hooks/useConversationHistory.ts index e090b689..f049584f 100644 --- a/frontend/src/hooks/useConversationHistory.ts +++ b/frontend/src/hooks/useConversationHistory.ts @@ -255,10 +255,22 @@ export const useConversationHistory = ({ e.type !== 'NORMALIZED_ENTRY' || e.content.entry_type.type !== 'user_message' ); + + const hasPendingApprovalEntry = entriesExcludingUser.some((entry) => { + if (entry.type !== 'NORMALIZED_ENTRY') return false; + const entryType = entry.content.entry_type; + return ( + entryType.type === 'tool_use' && + entryType.status.status === 'pending_approval' + ); + }); + entries.push(...entriesExcludingUser); - if ( - getLiveExecutionProcess(p.executionProcess.id)?.status === 'running' - ) { + const isProcessRunning = + getLiveExecutionProcess(p.executionProcess.id)?.status === + 'running'; + + if (isProcessRunning && !hasPendingApprovalEntry) { entries.push(loadingPatch); } } else if (