From b8067876bc5dd425d491863bd5338f325fea35ed Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sat, 3 Jun 2023 14:20:21 -0400 Subject: error handling and step retry --- .../react-app/src/components/StepContainer.tsx | 43 ++++++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) (limited to 'extension/react-app/src/components') diff --git a/extension/react-app/src/components/StepContainer.tsx b/extension/react-app/src/components/StepContainer.tsx index f962cbc9..903f9b94 100644 --- a/extension/react-app/src/components/StepContainer.tsx +++ b/extension/react-app/src/components/StepContainer.tsx @@ -18,6 +18,7 @@ import { ChevronDown, ChevronRight, Backward, + ArrowPath, } from "@styled-icons/heroicons-outline"; import { HistoryNode } from "../../../schema/HistoryNode"; import ReactMarkdown from "react-markdown"; @@ -29,6 +30,7 @@ interface StepContainerProps { inFuture: boolean; onRefinement: (input: string) => void; onUserInput: (input: string) => void; + onRetry: () => void; } const MainDiv = styled.div<{ stepDepth: number; inFuture: boolean }>` @@ -135,19 +137,44 @@ function StepContainer(props: StepContainerProps) { > */} + + {props.historyNode.observation?.error ? ( + { + e.stopPropagation(); + props.onRetry(); + }} + > + + + ) : ( + <> + )} {open && ( -
-              Step Details:
-              
- {JSON.stringify(props.historyNode.step, null, 2)} -
+ <> +
+                Step Details:
+                
+ {JSON.stringify(props.historyNode.step, null, 2)} +
+ )} - - {props.historyNode.step.description as any} - + {props.historyNode.observation?.error ? ( + <> + Error while running step: +
+
+                {props.historyNode.observation.error as string}
+              
+ + ) : ( + + {props.historyNode.step.description as any} + + )} {props.historyNode.step.name === "Waiting for user input" && (