Skip to content

Automate browser based workflows with AI

fix(SKY-8897): detect context-window failures in max-retries failure analysis (#5507)

LawyZheng4742bf81993d
diff --git a/skyvern-frontend/src/components/AutoResizingTextarea/AutoResizingTextarea.tsx b/skyvern-frontend/src/components/AutoResizingTextarea/AutoResizingTextarea.tsx
index 9313bae8d..83ffce6b2 100644
--- a/skyvern-frontend/src/components/AutoResizingTextarea/AutoResizingTextarea.tsx
+++ b/skyvern-frontend/src/components/AutoResizingTextarea/AutoResizingTextarea.tsx
@@ -1,6 +1,12 @@
import { Textarea } from "@/components/ui/textarea";
-import type { ChangeEventHandler, HTMLAttributes } from "react";
-import { forwardRef, useRef, useCallback, useLayoutEffect } from "react";
+import {
+ type ChangeEventHandler,
+ type HTMLAttributes,
+ forwardRef,
+ useRef,
+ useCallback,
+ useLayoutEffect,
+} from "react";
import { cn } from "@/util/utils";
type Props = {
diff --git a/skyvern-frontend/src/components/BrowserStream.tsx b/skyvern-frontend/src/components/BrowserStream.tsx
index 107ab30b8..7f12e5ae0 100644
--- a/skyvern-frontend/src/components/BrowserStream.tsx
+++ b/skyvern-frontend/src/components/BrowserStream.tsx
@@ -9,10 +9,10 @@ import { useEffect, useState, useRef, useCallback } from "react";
import { useQuery } from "@tanstack/react-query";
import { getClient } from "@/api/AxiosClient";
-import { Status } from "@/api/types";
-import type {
- TaskApiResponse,
- WorkflowRunStatusApiResponse,
+import {
+ Status,
+ type TaskApiResponse,
+ type WorkflowRunStatusApiResponse,
} from "@/api/types";
import { Tip } from "@/components/Tip";
import { Button } from "@/components/ui/button";
diff --git a/skyvern-frontend/src/components/FloatingWindow.tsx b/skyvern-frontend/src/components/FloatingWindow.tsx
index 042c5b0f7..accad32ed 100644
--- a/skyvern-frontend/src/components/FloatingWindow.tsx
+++ b/skyvern-frontend/src/components/FloatingWindow.tsx
@@ -6,8 +6,7 @@
* and `re-resizable`; but I don't want to do that until it's worth the effort.)
*/
-import { OpenInNewWindowIcon } from "@radix-ui/react-icons";
-import { ReloadIcon } from "@radix-ui/react-icons";
+import { OpenInNewWindowIcon, ReloadIcon } from "@radix-ui/react-icons";
import { Resizable } from "re-resizable";
import {
useCallback,
diff --git a/skyvern-frontend/src/components/WorkflowBlockInputSet.tsx b/skyvern-frontend/src/components/WorkflowBlockInputSet.tsx
index bf758497a..5396cce17 100644
--- a/skyvern-frontend/src/components/WorkflowBlockInputSet.tsx
+++ b/skyvern-frontend/src/components/WorkflowBlockInputSet.tsx
@@ -1,9 +1,8 @@
-import { PlusIcon } from "@radix-ui/react-icons";
+import { PlusIcon, Cross2Icon } from "@radix-ui/react-icons";
import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
import { WorkflowBlockParameterSelect } from "@/routes/workflows/editor/nodes/WorkflowBlockParameterSelect";
import { useWorkflowParametersStore } from "@/store/WorkflowParametersStore";
import { useState, useEffect } from "react";
-import { Cross2Icon } from "@radix-ui/react-icons";
import "./workflow-block-input-set.css";
type Props = {
onChange: (parameterKeys: Set<string>) => void;
diff --git a/skyvern-frontend/src/routes/browserSessions/hooks/useCreateBrowserSessionMutation.ts b/skyvern-frontend/src/routes/browserSessions/hooks/useCreateBrowserSessionMutation.ts
index 6fe5f4a22..bb94c6a4b 100644
--- a/skyvern-frontend/src/routes/browserSessions/hooks/useCreateBrowserSessionMutation.ts
+++ b/skyvern-frontend/src/routes/browserSessions/hooks/useCreateBrowserSessionMutation.ts
@@ -1,6 +1,5 @@
import { useNavigate } from "react-router-dom";
-import { useQueryClient } from "@tanstack/react-query";
-import { useMutation } from "@tanstack/react-query";
+import { useQueryClient, useMutation } from "@tanstack/react-query";
import { getClient } from "@/api/AxiosClient";
import { toast } from "@/components/ui/use-toast";
diff --git a/skyvern-frontend/src/routes/browserSessions/hooks/useProcessRecordingMutation.ts b/skyvern-frontend/src/routes/browserSessions/hooks/useProcessRecordingMutation.ts
index 517fda222..f7e76eddb 100644
--- a/skyvern-frontend/src/routes/browserSessions/hooks/useProcessRecordingMutation.ts
+++ b/skyvern-frontend/src/routes/browserSessions/hooks/useProcessRecordingMutation.ts
@@ -5,8 +5,10 @@ import { getClient } from "@/api/AxiosClient";
import { toast } from "@/components/ui/use-toast";
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
import { useRecordingStore } from "@/store/useRecordingStore";
-import { type WorkflowBlock } from "@/routes/workflows/types/workflowTypes";
-import { type WorkflowParameter } from "@/routes/workflows/types/workflowTypes";
+import {
+ type WorkflowBlock,
+ type WorkflowParameter,
+} from "@/routes/workflows/types/workflowTypes";
const FAIL_QUIET_NO_EVENTS = "FAIL-QUIET:NO-EVENTS" as const;
diff --git a/skyvern-frontend/src/routes/credentials/CredentialsModal.tsx b/skyvern-frontend/src/routes/credentials/CredentialsModal.tsx
index 5f14321f8..dff26fdfe 100644
--- a/skyvern-frontend/src/routes/credentials/CredentialsModal.tsx
+++ b/skyvern-frontend/src/routes/credentials/CredentialsModal.tsx
@@ -8,8 +8,8 @@ import {
import {
useCredentialModalState,
CredentialModalTypes,
+ type CredentialModalType,
} from "./useCredentialModalState";
-import type { CredentialModalType } from "./useCredentialModalState";
import { PasswordCredentialContent } from "./PasswordCredentialContent";
import { SecretCredentialContent } from "./SecretCredentialContent";
import { useState, useEffect, useCallback, useRef } from "react";
@@ -33,6 +33,7 @@ import {
CheckCircledIcon,
CrossCircledIcon,
ExclamationTriangleIcon,
+ ExternalLinkIcon,
ReloadIcon,
} from "@radix-ui/react-icons";
import { Alert, AlertDescription } from "@/components/ui/alert";
@@ -42,7 +43,6 @@ import { HelpTooltip } from "@/components/HelpTooltip";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
import { getHostname } from "@/util/getHostname";
-import { ExternalLinkIcon } from "@radix-ui/react-icons";
import { useCustomCredentialServiceConfig } from "@/hooks/useCustomCredentialServiceConfig";
const PASSWORD_CREDENTIAL_INITIAL_VALUES = {
diff --git a/skyvern-frontend/src/routes/credentials/DeleteCredentialButton.tsx b/skyvern-frontend/src/routes/credentials/DeleteCredentialButton.tsx
index 19b90d0ae..1bbc9aa04 100644
--- a/skyvern-frontend/src/routes/credentials/DeleteCredentialButton.tsx
+++ b/skyvern-frontend/src/routes/credentials/DeleteCredentialButton.tsx
@@ -1,12 +1,14 @@
-import { DialogClose } from "@/components/ui/dialog";
import {
+ Dialog,
+ DialogClose,
+ DialogContent,
DialogFooter,
DialogHeader,
DialogTitle,
+ DialogTrigger,
} from "@/components/ui/dialog";
import { getClient } from "@/api/AxiosClient";
import { Button } from "@/components/ui/button";
-import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
import {
Tooltip,
TooltipContent,
diff --git a/skyvern-frontend/src/routes/history/RunHistory.tsx b/skyvern-frontend/src/routes/history/RunHistory.tsx
index a67e85e93..6003bbb08 100644
--- a/skyvern-frontend/src/routes/history/RunHistory.tsx
+++ b/skyvern-frontend/src/routes/history/RunHistory.tsx
@@ -329,9 +329,9 @@ function RunHistory() {
</TableHeader>
<TableBody>{displayTableBody()}</TableBody>
</Table>
- <div className="flex items-center justify-between px-3 py-3">
- <div className="flex items-center gap-2">
- <span className="text-sm text-slate-400">Items per page</span>
+ <div className="relative px-3 py-3">
+ <div className="absolute left-3 top-1/2 flex -translate-y-1/2 items-center gap-2 text-sm">
+ <span className="text-slate-400">Items per page</span>
<Select
value={String(itemsPerPage)}
onValueChange={(size) => {
@@ -352,7 +352,7 @@ function RunHistory() {
</SelectContent>
</Select>
</div>
- <Pagination className="mx-0 w-auto pt-0">
+ <Pagination className="pt-0">
<PaginationContent>
<PaginationItem>
<PaginationPrevious
diff --git a/skyvern-frontend/src/routes/tasks/detail/TaskDetails.tsx b/skyvern-frontend/src/routes/tasks/detail/TaskDetails.tsx
index 538b933e6..e60d71f22 100644
--- a/skyvern-frontend/src/routes/tasks/detail/TaskDetails.tsx
+++ b/skyvern-frontend/src/routes/tasks/detail/TaskDetails.tsx
@@ -28,7 +28,6 @@ import { useApiCredential } from "@/hooks/useApiCredential";
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
import { CodeEditor } from "@/routes/workflows/components/CodeEditor";
import { WorkflowApiResponse } from "@/routes/workflows/types/workflowTypes";
-import { runsApiBaseUrl } from "@/util/env";
import { ApiWebhookActionsMenu } from "@/components/ApiWebhookActionsMenu";
import { WebhookReplayDialog } from "@/components/WebhookReplayDialog";
import { type ApiCommandOptions } from "@/util/apiCommands";
@@ -243,7 +242,7 @@ function TaskDetails() {
return {
method: "POST",
- url: `${runsApiBaseUrl}/run/tasks`,
+ url: `${env.runsApiBaseUrl}/run/tasks`,
body: buildTaskRunPayload(
createTaskRequestObject(task),
RunEngine.SkyvernV1,
diff --git a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
index 3ae5eaee8..dac552fe8 100644
--- a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
+++ b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
@@ -47,7 +47,6 @@ import { useBlockScriptsQuery } from "@/routes/workflows/hooks/useBlockScriptsQu
import { constructCacheKeyValueFromParameters } from "@/routes/workflows/editor/utils";
import { useWorkflowQuery } from "@/routes/workflows/hooks/useWorkflowQuery";
import { type ApiCommandOptions } from "@/util/apiCommands";
-import { runsApiBaseUrl } from "@/util/env";
import { MAX_SCREENSHOT_SCROLLS_DEFAULT } from "./editor/nodes/Taskv2Node/types";
import { getLabelForWorkflowParameterType } from "./editor/workflowEditorUtils";
@@ -552,7 +551,7 @@ function RunWorkflowForm({
return {
method: "POST",
- url: `${runsApiBaseUrl}/run/workflows`,
+ url: `${env.runsApiBaseUrl}/run/workflows`,
body: transformedBody,
headers,
} satisfies ApiCommandOptions;
diff --git a/skyvern-frontend/src/routes/workflows/WorkflowPage.tsx b/skyvern-frontend/src/routes/workflows/WorkflowPage.tsx
index 390effe15..e4ec1265a 100644
--- a/skyvern-frontend/src/routes/workflows/WorkflowPage.tsx
+++ b/skyvern-frontend/src/routes/workflows/WorkflowPage.tsx
@@ -1,7 +1,13 @@
-import { LightningBoltIcon } from "@radix-ui/react-icons";
+import {
+ LightningBoltIcon,
+ CodeIcon,
+ MixerHorizontalIcon,
+ Pencil2Icon,
+ PlayIcon,
+} from "@radix-ui/react-icons";
import { Tip } from "@/components/Tip";
-import { Status } from "@/api/types";
+import { Status, WorkflowRunStatusApiResponse } from "@/api/types";
import { StatusBadge } from "@/components/StatusBadge";
import { StatusFilterDropdown } from "@/components/StatusFilterDropdown";
import { Button } from "@/components/ui/button";
@@ -35,12 +41,6 @@ import {
formatExecutionTime,
} from "@/util/timeFormat";
import { cn } from "@/util/utils";
-import {
- CodeIcon,
- MixerHorizontalIcon,
- Pencil2Icon,
- PlayIcon,
-} from "@radix-ui/react-icons";
import React, { useEffect, useState } from "react";
import {
Link,
@@ -61,7 +61,6 @@ import {
import { RunParametersDialog } from "./workflowRun/RunParametersDialog";
import * as env from "@/util/env";
import { getClient } from "@/api/AxiosClient";
-import { WorkflowRunStatusApiResponse } from "@/api/types";
import { useQuery } from "@tanstack/react-query";
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
import { useGlobalWorkflowsQuery } from "./hooks/useGlobalWorkflowsQuery";
@@ -331,9 +330,9 @@ function WorkflowPage() {
workflowPermanentId={workflowPermanentId}
workflowRunId={openRunParams}
/>
- <div className="flex items-center justify-between px-3 py-3">
- <div className="flex items-center gap-2">
- <span className="text-sm text-slate-400">Items per page</span>
+ <div className="relative px-3 py-3">
+ <div className="absolute left-3 top-1/2 flex -translate-y-1/2 items-center gap-2 text-sm">
+ <span className="text-slate-400">Items per page</span>
<Select
value={String(pageSize)}
onValueChange={(size) => {
@@ -355,7 +354,7 @@ function WorkflowPage() {
</SelectContent>
</Select>
</div>
- <Pagination className="ml-auto w-auto">
+ <Pagination className="pt-0">
<PaginationContent>
<PaginationItem>
<PaginationPrevious
diff --git a/skyvern-frontend/src/routes/workflows/components/BlockCodeEditor.tsx b/skyvern-frontend/src/routes/workflows/components/BlockCodeEditor.tsx
index abc06b8c1..4a4cc1d19 100644
--- a/skyvern-frontend/src/routes/workflows/components/BlockCodeEditor.tsx
+++ b/skyvern-frontend/src/routes/workflows/components/BlockCodeEditor.tsx
@@ -1,7 +1,6 @@
import { ExitIcon } from "@radix-ui/react-icons";
import { useSearchParams } from "react-router-dom";
-import { Handle } from "@xyflow/react";
-import { Position } from "@xyflow/react";
+import { Handle, Position } from "@xyflow/react";
import { KeyIcon } from "@/components/icons/KeyIcon";
import { WorkflowBlockType } from "@/routes/workflows/types/workflowTypes";
diff --git a/skyvern-frontend/src/routes/workflows/components/WorkflowFolderSelector.tsx b/skyvern-frontend/src/routes/workflows/components/WorkflowFolderSelector.tsx
index d35344cd4..e9bcdeb3c 100644
--- a/skyvern-frontend/src/routes/workflows/components/WorkflowFolderSelector.tsx
+++ b/skyvern-frontend/src/routes/workflows/components/WorkflowFolderSelector.tsx
@@ -13,10 +13,9 @@ import {
PopoverTrigger,
} from "@/components/ui/popover";
import { Input } from "@/components/ui/input";
-import { cn } from "@/util/utils";
+import { cn, handleInfiniteScroll } from "@/util/utils";
import { useInfiniteFoldersQuery } from "../hooks/useInfiniteFoldersQuery";
import { useUpdateWorkflowFolderMutation } from "../hooks/useFolderMutations";
-import { handleInfiniteScroll } from "@/util/utils";
import { useDebounce } from "use-debounce";
import { Skeleton } from "@/components/ui/skeleton";
diff --git a/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx b/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx
index 11d21faa2..389328338 100644
--- a/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx
@@ -95,8 +95,8 @@ import {
removeJinjaReferenceFromNodes,
removeKeyFromNodesParameterKeys,
upgradeWorkflowDefinitionToVersionTwo,
+ getWorkflowErrors,
} from "./workflowEditorUtils";
-import { getWorkflowErrors } from "./workflowEditorUtils";
import { toast } from "@/components/ui/use-toast";
import { useAutoPan } from "./useAutoPan";
import { useAutoGenerateWorkflowTitle } from "../hooks/useAutoGenerateWorkflowTitle";
diff --git a/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx b/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx
index 919839312..259c63ed2 100644
--- a/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx
@@ -29,7 +29,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
import { usePostHog } from "posthog-js/react";
import { getClient } from "@/api/AxiosClient";
-import { DebugSessionApiResponse } from "@/api/types";
+import { DebugSessionApiResponse, ProxyLocation } from "@/api/types";
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
import { useMountEffect } from "@/hooks/useMountEffect";
import { useBrowserSessionRateLimit } from "../hooks/useBrowserSessionRateLimit";
@@ -90,20 +90,15 @@ import { ConditionalNodeData } from "./nodes/ConditionalNode/types";
import { WorkflowNodeLibraryPanel } from "./panels/WorkflowNodeLibraryPanel";
import { WorkflowParametersPanel } from "./panels/WorkflowParametersPanel";
import { WorkflowCacheKeyValuesPanel } from "./panels/WorkflowCacheKeyValuesPanel";
-import { WorkflowComparisonPanel } from "./panels/WorkflowComparisonPanel";
+import {
+ WorkflowComparisonPanel,
+ type CopilotReviewStatus,
+} from "./panels/WorkflowComparisonPanel";
import {
getWorkflowErrors,
getElements,
getAffectedBlocks,
getOutputParameterKey,
-} from "./workflowEditorUtils";
-import { WorkflowHeader } from "./WorkflowHeader";
-import { WorkflowHistoryPanel } from "./panels/WorkflowHistoryPanel";
-import { WorkflowSchedulePanel } from "./panels/schedulePanel/WorkflowSchedulePanel";
-import { WorkflowVersion } from "../hooks/useWorkflowVersionsQuery";
-import { WorkflowSettings } from "../types/workflowTypes";
-import { ProxyLocation } from "@/api/types";
-import {
nodeAdderNode,
createNode,
defaultEdge,
@@ -111,10 +106,16 @@ import {
layout,
startNode,
} from "./workflowEditorUtils";
+import { WorkflowHeader } from "./WorkflowHeader";
+import { WorkflowHistoryPanel } from "./panels/WorkflowHistoryPanel";
+import { WorkflowSchedulePanel } from "./panels/schedulePanel/WorkflowSchedulePanel";
+import { WorkflowVersion } from "../hooks/useWorkflowVersionsQuery";
+import { WorkflowSettings } from "../types/workflowTypes";
+
import { constructCacheKeyValue, getInitialParameters } from "./utils";
import { WorkflowCopilotChat } from "../copilot/WorkflowCopilotChat";
import { WorkflowCopilotButton } from "../copilot/WorkflowCopilotButton";
-import type { CopilotReviewStatus } from "./panels/WorkflowComparisonPanel";
+
import type { WorkflowYAMLConversionResponse } from "../copilot/workflowCopilotTypes";
import "./workspace-styles.css";
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/ActionNode/ActionNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/ActionNode/ActionNode.tsx
index 2d844e01c..ce1b6aea9 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/ActionNode/ActionNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/ActionNode/ActionNode.tsx
@@ -1,4 +1,4 @@
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
import { Flippable } from "@/components/Flippable";
import {
Accordion,
@@ -9,7 +9,6 @@ import {
import { Label } from "@/components/ui/label";
import { Separator } from "@/components/ui/separator";
import { Handle, NodeProps, Position, useEdges, useNodes } from "@xyflow/react";
-import { useState } from "react";
import type { ActionNode } from "./types";
import { HelpTooltip } from "@/components/HelpTooltip";
import { errorMappingExampleValue } from "../types";
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/ConditionalNode/ConditionalNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/ConditionalNode/ConditionalNode.tsx
index ddb0c2ac8..a657a4c05 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/ConditionalNode/ConditionalNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/ConditionalNode/ConditionalNode.tsx
@@ -5,13 +5,13 @@ import {
Position,
useNodes,
useReactFlow,
+ type Node,
} from "@xyflow/react";
import {
PlusIcon,
ChevronDownIcon,
DotsVerticalIcon,
} from "@radix-ui/react-icons";
-import type { Node } from "@xyflow/react";
import { Button } from "@/components/ui/button";
import { Label } from "@/components/ui/label";
@@ -31,8 +31,8 @@ import {
getLoopNodeWidth,
updateNodeAndDescendantsVisibility,
} from "../../workflowEditorUtils";
-import type { ConditionalNode } from "./types";
import {
+ type ConditionalNode,
ConditionalNodeData,
createBranchCondition,
defaultBranchCriteria,
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/ExtractionNode/ExtractionNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/ExtractionNode/ExtractionNode.tsx
index 6b00354a2..f45b3df1c 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/ExtractionNode/ExtractionNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/ExtractionNode/ExtractionNode.tsx
@@ -1,4 +1,4 @@
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
import { Flippable } from "@/components/Flippable";
import { HelpTooltip } from "@/components/HelpTooltip";
import {
@@ -11,7 +11,6 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Separator } from "@/components/ui/separator";
import { Handle, NodeProps, Position, useEdges, useNodes } from "@xyflow/react";
-import { useState } from "react";
import { dataSchemaExampleValue } from "../types";
import type { ExtractionNode } from "./types";
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/FileDownloadNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/FileDownloadNode.tsx
index f891f20d1..9d4b75bbf 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/FileDownloadNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/FileDownloadNode.tsx
@@ -1,4 +1,4 @@
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
import { Flippable } from "@/components/Flippable";
import { HelpTooltip } from "@/components/HelpTooltip";
import {
@@ -16,7 +16,6 @@ import { BlockCodeEditor } from "@/routes/workflows/components/BlockCodeEditor";
import { ErrorCodeMappingEditor } from "@/routes/workflows/editor/ErrorCodeMappingEditor";
import { useBlockScriptStore } from "@/store/BlockScriptStore";
import { Handle, NodeProps, Position, useEdges, useNodes } from "@xyflow/react";
-import { useState } from "react";
import { helpTooltips, placeholders } from "../../helpContent";
import { errorMappingExampleValue } from "../types";
import type { FileDownloadNode } from "./types";
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/LoopNode/LoopNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/LoopNode/LoopNode.tsx
index 1d1b4a97f..237a26298 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/LoopNode/LoopNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/LoopNode/LoopNode.tsx
@@ -3,13 +3,13 @@ import { HelpTooltip } from "@/components/HelpTooltip";
import { Label } from "@/components/ui/label";
import { WorkflowBlockInput } from "@/components/WorkflowBlockInput";
import { WorkflowDataSchemaInputGroup } from "@/components/DataSchemaInputGroup/WorkflowDataSchemaInputGroup";
-import type { Node } from "@xyflow/react";
import {
Handle,
NodeProps,
Position,
useNodes,
useReactFlow,
+ type Node,
} from "@xyflow/react";
import { AppNode } from "..";
import { helpTooltips } from "../../helpContent";
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/NavigationNode/NavigationNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/NavigationNode/NavigationNode.tsx
index 9c8fb19a0..3c6997168 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/NavigationNode/NavigationNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/NavigationNode/NavigationNode.tsx
@@ -1,4 +1,4 @@
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
import { Flippable } from "@/components/Flippable";
import { HelpTooltip } from "@/components/HelpTooltip";
import {
@@ -18,11 +18,9 @@ import { BlockCodeEditor } from "@/routes/workflows/components/BlockCodeEditor";
import { ErrorCodeMappingEditor } from "@/routes/workflows/editor/ErrorCodeMappingEditor";
import { useBlockScriptStore } from "@/store/BlockScriptStore";
import { Handle, NodeProps, Position, useEdges, useNodes } from "@xyflow/react";
-import { useState } from "react";
import { helpTooltips, placeholders } from "../../helpContent";
import { errorMappingExampleValue } from "../types";
-import type { NavigationNode } from "./types";
-import { MAX_STEPS_DEFAULT } from "./types";
+import { type NavigationNode, MAX_STEPS_DEFAULT } from "./types";
import { ParametersMultiSelect } from "../TaskNode/ParametersMultiSelect";
import { AppNode } from "..";
import {
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx
index 9524cb596..51e246f1e 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx
@@ -32,16 +32,16 @@ import { ProxySelector } from "@/components/ProxySelector";
import { Switch } from "@/components/ui/switch";
import { Separator } from "@/components/ui/separator";
import { ModelSelector } from "@/components/ModelSelector";
-import { WorkflowModel } from "@/routes/workflows/types/workflowTypes";
+import {
+ WorkflowModel,
+ scriptableWorkflowBlockTypes,
+ type WorkflowBlockType,
+} from "@/routes/workflows/types/workflowTypes";
import { MAX_SCREENSHOT_SCROLLS_DEFAULT } from "../Taskv2Node/types";
import { KeyValueInput } from "@/components/KeyValueInput";
import { placeholders } from "@/routes/workflows/editor/helpContent";
import { useToggleScriptForNodeCallback } from "@/routes/workflows/hooks/useToggleScriptForNodeCallback";
import { useWorkflowSettingsStore } from "@/store/WorkflowSettingsStore";
-import {
- scriptableWorkflowBlockTypes,
- type WorkflowBlockType,
-} from "@/routes/workflows/types/workflowTypes";
import { Flippable } from "@/components/Flippable";
import { useRerender } from "@/hooks/useRerender";
import { useBlockScriptStore } from "@/store/BlockScriptStore";
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/TaskNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/TaskNode.tsx
index 8d8f39c63..85ac49597 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/TaskNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/TaskNode.tsx
@@ -1,4 +1,4 @@
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
import { Flippable } from "@/components/Flippable";
import { HelpTooltip } from "@/components/HelpTooltip";
import {
@@ -17,7 +17,6 @@ import { BlockCodeEditor } from "@/routes/workflows/components/BlockCodeEditor";
import { ErrorCodeMappingEditor } from "@/routes/workflows/editor/ErrorCodeMappingEditor";
import { useBlockScriptStore } from "@/store/BlockScriptStore";
import { Handle, NodeProps, Position, useEdges, useNodes } from "@xyflow/react";
-import { useState } from "react";
import { AppNode } from "..";
import { helpTooltips, placeholders } from "../../helpContent";
import { AI_IMPROVE_CONFIGS } from "../../constants";
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/URLNode/URLNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/URLNode/URLNode.tsx
index de368bbe7..3f0303f21 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/URLNode/URLNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/URLNode/URLNode.tsx
@@ -1,9 +1,8 @@
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
import { Flippable } from "@/components/Flippable";
import { Handle, NodeProps, Position } from "@xyflow/react";
import type { URLNode } from "./types";
import { useIsFirstBlockInWorkflow } from "../../hooks/useIsFirstNodeInWorkflow";
-import { useState } from "react";
import { Label } from "@/components/ui/label";
import { WorkflowBlockInputTextarea } from "@/components/WorkflowBlockInputTextarea";
import { BlockCodeEditor } from "@/routes/workflows/components/BlockCodeEditor";
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/ValidationNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/ValidationNode.tsx
index 51a482a31..bd67d497c 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/ValidationNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/ValidationNode.tsx
@@ -1,4 +1,4 @@
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
import { Flippable } from "@/components/Flippable";
import { HelpTooltip } from "@/components/HelpTooltip";
import {
@@ -15,7 +15,6 @@ import { BlockCodeEditor } from "@/routes/workflows/components/BlockCodeEditor";
import { ErrorCodeMappingEditor } from "@/routes/workflows/editor/ErrorCodeMappingEditor";
import { useBlockScriptStore } from "@/store/BlockScriptStore";
import { Handle, NodeProps, Position, useEdges, useNodes } from "@xyflow/react";
-import { useState } from "react";
import { helpTooltips } from "../../helpContent";
import { errorMappingExampleValue } from "../types";
import type { ValidationNode } from "./types";
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/WorkflowTriggerNode/WorkflowTriggerNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/WorkflowTriggerNode/WorkflowTriggerNode.tsx
index 37c933f86..10df329a6 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/WorkflowTriggerNode/WorkflowTriggerNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/WorkflowTriggerNode/WorkflowTriggerNode.tsx
@@ -10,8 +10,10 @@ import { Separator } from "@/components/ui/separator";
import { Handle, NodeProps, Position, useEdges, useNodes } from "@xyflow/react";
import { NodeHeader } from "../components/NodeHeader";
import { WorkflowBlockTypes } from "@/routes/workflows/types/workflowTypes";
-import type { WorkflowTriggerNode as WorkflowTriggerNodeType } from "./types";
-import { isConcreteWpid } from "./types";
+import {
+ type WorkflowTriggerNode as WorkflowTriggerNodeType,
+ isConcreteWpid,
+} from "./types";
import { HelpTooltip } from "@/components/HelpTooltip";
import { Switch } from "@/components/ui/switch";
import { WorkflowBlockInputTextarea } from "@/components/WorkflowBlockInputTextarea";
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/types.ts b/skyvern-frontend/src/routes/workflows/editor/nodes/types.ts
index 1508c98a1..d3d21a72c 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/types.ts
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/types.ts
@@ -1,5 +1,7 @@
-import { WorkflowBlockType } from "../../types/workflowTypes";
-import type { WorkflowModel } from "../../types/workflowTypes";
+import {
+ WorkflowBlockType,
+ type WorkflowModel,
+} from "../../types/workflowTypes";
export type NodeBaseData = {
debuggable: boolean;
diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
index aea84d55c..787211070 100644
--- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
+++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
@@ -1,6 +1,5 @@
import Dagre from "@dagrejs/dagre";
-import type { Node } from "@xyflow/react";
-import { Edge } from "@xyflow/react";
+import { type Node, Edge } from "@xyflow/react";
import { nanoid } from "nanoid";
import { TSON } from "@/util/tson";
diff --git a/skyvern-frontend/src/routes/workflows/hooks/useCacheKeyValuesQuery.ts b/skyvern-frontend/src/routes/workflows/hooks/useCacheKeyValuesQuery.ts
index bd3f13132..baa60b72c 100644
--- a/skyvern-frontend/src/routes/workflows/hooks/useCacheKeyValuesQuery.ts
+++ b/skyvern-frontend/src/routes/workflows/hooks/useCacheKeyValuesQuery.ts
@@ -1,7 +1,6 @@
import { getClient } from "@/api/AxiosClient";
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
-import { useQuery } from "@tanstack/react-query";
-import { keepPreviousData } from "@tanstack/react-query";
+import { useQuery, keepPreviousData } from "@tanstack/react-query";
import { useEffect, useState } from "react";
import { CacheKeyValuesResponse } from "../types/scriptTypes";
diff --git a/skyvern-frontend/src/routes/workflows/hooks/useCreateWorkflowMutation.ts b/skyvern-frontend/src/routes/workflows/hooks/useCreateWorkflowMutation.ts
index bfc395852..2df72575d 100644
--- a/skyvern-frontend/src/routes/workflows/hooks/useCreateWorkflowMutation.ts
+++ b/skyvern-frontend/src/routes/workflows/hooks/useCreateWorkflowMutation.ts
@@ -1,5 +1,4 @@
-import { useQueryClient } from "@tanstack/react-query";
-import { useMutation } from "@tanstack/react-query";
+import { useQueryClient, useMutation } from "@tanstack/react-query";
import { WorkflowCreateYAMLRequest } from "../types/workflowYamlTypes";
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
import { getClient } from "@/api/AxiosClient";
diff --git a/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
index 9f33c21ea..b4e816d9b 100644
--- a/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
+++ b/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
@@ -1,6 +1,5 @@
import { ProxyLocation, RunEngine } from "@/api/types";
-import { WorkflowBlockType } from "./workflowTypes";
-import { WorkflowModel } from "./workflowTypes";
+import { WorkflowBlockType, WorkflowModel } from "./workflowTypes";
export type WorkflowCreateYAMLRequest = {
title: string;
diff --git a/skyvern-frontend/src/store/RecordedBlocksStore.ts b/skyvern-frontend/src/store/RecordedBlocksStore.ts
index 336fb667e..dd405328e 100644
--- a/skyvern-frontend/src/store/RecordedBlocksStore.ts
+++ b/skyvern-frontend/src/store/RecordedBlocksStore.ts
@@ -1,6 +1,8 @@
import { create } from "zustand";
-import type { WorkflowBlock } from "@/routes/workflows/types/workflowTypes";
-import type { WorkflowParameter } from "@/routes/workflows/types/workflowTypes";
+import type {
+ WorkflowBlock,
+ WorkflowParameter,
+} from "@/routes/workflows/types/workflowTypes";
type InsertionPoint = {
previous: string | null;
diff --git a/skyvern-frontend/src/store/WorkflowHasChangesStore.ts b/skyvern-frontend/src/store/WorkflowHasChangesStore.ts
index d67f6f4d1..d344e7651 100644
--- a/skyvern-frontend/src/store/WorkflowHasChangesStore.ts
+++ b/skyvern-frontend/src/store/WorkflowHasChangesStore.ts
@@ -8,15 +8,15 @@ import { usePostHog } from "posthog-js/react";
import { getClient } from "@/api/AxiosClient";
import { toast } from "@/components/ui/use-toast";
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
-import type {
- BlockYAML,
- ParameterYAML,
+import {
+ type BlockYAML,
+ type ParameterYAML,
+ WorkflowCreateYAMLRequest,
} from "@/routes/workflows/types/workflowYamlTypes";
import type {
WorkflowApiResponse,
WorkflowSettings,
} from "@/routes/workflows/types/workflowTypes";
-import { WorkflowCreateYAMLRequest } from "@/routes/workflows/types/workflowYamlTypes";
type SaveData = {
parameters: Array<ParameterYAML>;
blocks: Array<BlockYAML>;
diff --git a/skyvern/forge/agent.py b/skyvern/forge/agent.py
index c4b7e14d9..b1b6ed22c 100644
--- a/skyvern/forge/agent.py
+++ b/skyvern/forge/agent.py
@@ -164,6 +164,20 @@ class _PromptCeilingExceeded(Exception):
EXTRACT_ACTION_PROMPT_NAME = "extract-actions"
EXTRACT_ACTION_CACHE_KEY_PREFIX = f"{EXTRACT_ACTION_TEMPLATE}-static"
+# Exception types that indicate an LLM-specific step failure (context window, provider errors).
+# Used by summary_failure_reason_for_max_retries to distinguish LLM failures from browser/runtime crashes.
+_LLM_STEP_EXCEPTIONS = frozenset(
+ {
+ "SkyvernContextWindowExceededError",
+ "LLMProviderError",
+ "LLMProviderErrorRetryableTask",
+ }
+)
+
+
+def _llm_error_category(reasoning: str) -> list[dict]:
+ return [{"category": "LLM_ERROR", "confidence_float": 0.9, "reasoning": reasoning}]
+
@dataclass
class SpeculativePlan:
@@ -4431,7 +4445,10 @@ class ForgeAgent:
task_status="failed",
failure_category=failure_category,
primary_failure_category=failure_category[0].get("category") if failure_category else None,
- failure_category_source="llm" if failure_response.failure_categories else "code_level",
+ failure_category_source=(
+ failure_response.failure_category_source
+ or ("llm" if failure_response.failure_categories else "code_level")
+ ),
failure_category_path="max_retries",
)
await self.update_task(
@@ -4592,10 +4609,14 @@ class ForgeAgent:
# Check for LLM provider errors in the failed steps
for step_cnt, cur_step in enumerate(steps[-max_retries:]):
if cur_step.status == StepStatus.failed:
- # Only count steps where the LLM call itself failed (no output at all).
- # Steps with output but empty actions mean the LLM worked fine but found
- # nothing to interact with — those fall through to normal summarization.
- if not cur_step.output:
+ # Count steps that failed without producing actions due to LLM issues:
+ # - No output at all (catastrophic failure before any result persisted)
+ # - Output exists but no actions AND step_exception confirms an
+ # LLM-specific failure (e.g. context window exceeded)
+ if not cur_step.output or (
+ not cur_step.output.actions_and_results
+ and cur_step.output.step_exception in _LLM_STEP_EXCEPTIONS
+ ):
steps_without_actions += 1
if cur_step.output and cur_step.output.actions_and_results:
@@ -4636,6 +4657,10 @@ class ForgeAgent:
f"Error details: {llm_error_details}"
),
errors=[],
+ failure_categories=_llm_error_category(
+ f"LLM provider errors detected across retry steps: {llm_error_details}"
+ ),
+ failure_category_source="code_level",
)
# If multiple steps failed without producing any actions, it's likely an LLM error during action extraction
@@ -4644,10 +4669,16 @@ class ForgeAgent:
page_info="",
reasoning=(
f"The task failed because all {max_retries} retry attempts failed to generate actions. "
- f"This is typically caused by LLM service errors during action extraction, such as rate limiting, "
- f"service outages, or resource exhaustion from the LLM provider. Please check the LLM service status and try again."
+ f"This is typically caused by the page content exceeding the LLM context window, "
+ f"LLM service errors during action extraction (rate limiting, service outages), "
+ f"or oversized input data. Please reduce the page content or input data size and try again."
),
errors=[],
+ failure_categories=_llm_error_category(
+ "All retry steps failed without producing actions — "
+ "LLM context window exceeded or provider error during action extraction."
+ ),
+ failure_category_source="code_level",
)
if page is not None:
@@ -4684,6 +4715,10 @@ class ForgeAgent:
f"Error details: {llm_error_details}"
),
errors=[],
+ failure_categories=_llm_error_category(
+ f"LLM provider errors detected across retry steps: {llm_error_details}"
+ ),
+ failure_category_source="code_level",
)
# If multiple steps failed without actions during summarization failure, still report it
if steps_without_actions >= max_retries:
@@ -4694,6 +4729,11 @@ class ForgeAgent:
f"This is typically caused by LLM service errors during action extraction."
),
errors=[],
+ failure_categories=_llm_error_category(
+ "All retry steps failed without producing actions — "
+ "LLM context window exceeded or provider error during action extraction."
+ ),
+ failure_category_source="code_level",
)
if steps_results:
last_step_result = steps_results[-1]
diff --git a/skyvern/schemas/steps.py b/skyvern/schemas/steps.py
index 1e51f4e2c..c9f8cd97b 100644
--- a/skyvern/schemas/steps.py
+++ b/skyvern/schemas/steps.py
@@ -22,6 +22,7 @@ class AgentStepOutput(BaseModel):
actions_and_results: list[tuple[Action, list[ActionResult]]] | None = None
errors: list[UserDefinedError] = []
browser_metadata: BrowserMetadata | None = None
+ step_exception: str | None = None
def __repr__(self) -> str:
return f"AgentStepOutput({self.model_dump()})"
diff --git a/skyvern/utils/prompt_engine.py b/skyvern/utils/prompt_engine.py
index 209cff7ce..650581101 100644
--- a/skyvern/utils/prompt_engine.py
+++ b/skyvern/utils/prompt_engine.py
@@ -36,6 +36,9 @@ class MaxStepsReasonResponse(BaseModel):
reasoning: str
errors: list[UserDefinedError] = []
failure_categories: list[dict] = []
+ # Explicit provenance for failure_categories. Set by short-circuit paths
+ # to avoid the caller inferring "llm" from the presence of categories.
+ failure_category_source: str | None = None
PROMPT_HARD_CEILING_TOKENS = 180_000
diff --git a/skyvern/webeye/actions/models.py b/skyvern/webeye/actions/models.py
index 99a40384c..4e1281189 100644
--- a/skyvern/webeye/actions/models.py
+++ b/skyvern/webeye/actions/models.py
@@ -72,4 +72,5 @@ class DetailedAgentStepOutput(BaseModel):
actions_and_results=(clean_output.actions_and_results if clean_output.actions_and_results else []),
errors=clean_output.extract_errors(),
browser_metadata=browser_metadata,
+ step_exception=clean_output.step_exception,
)