Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
Fix: Diagnostics button always visible for completed task blocks (SKY-8398) (#5120)
Shuchang Zhengdb66b6627f09
diff --git a/alembic/versions/2026_03_17_2254-def7c03f425d_add_idx_workflow_scripts_org_script_id_.py b/alembic/versions/2026_03_17_2254-def7c03f425d_add_idx_workflow_scripts_org_script_id_.pynew file mode 100644index 000000000..f089ac600--- /dev/null+++ b/alembic/versions/2026_03_17_2254-def7c03f425d_add_idx_workflow_scripts_org_script_id_.py@@ -0,0 +1,31 @@+"""add idx_workflow_scripts_org_script_id index++Revision ID: def7c03f425d+Revises: 7dc73e5b2fe4+Create Date: 2026-03-17 22:54:15.239784+00:00++"""++from typing import Sequence, Union++from alembic import op++# revision identifiers, used by Alembic.+revision: str = "def7c03f425d"+down_revision: Union[str, None] = "7dc73e5b2fe4"+branch_labels: Union[str, Sequence[str], None] = None+depends_on: Union[str, Sequence[str], None] = None+++def upgrade() -> None:+ # ### commands auto generated by Alembic - please adjust! ###+ op.create_index(+ "idx_workflow_scripts_org_script_id", "workflow_scripts", ["organization_id", "script_id"], unique=False+ )+ # ### end Alembic commands ###+++def downgrade() -> None:+ # ### commands auto generated by Alembic - please adjust! ###+ op.drop_index("idx_workflow_scripts_org_script_id", table_name="workflow_scripts")+ # ### end Alembic commands ###diff --git a/pyproject.toml b/pyproject.tomlindex 6d28c2b83..a37875cfe 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -121,6 +121,7 @@ dev = ["curlify>=3.0.0","openpyxl>=3.1.0","gspread>=6",+ "python-pptx>=1.0.2",][tool.hatch.build]diff --git a/skyvern-frontend/src/api/types.ts b/skyvern-frontend/src/api/types.tsindex 9b6448522..1171bbb85 100644--- a/skyvern-frontend/src/api/types.ts+++ b/skyvern-frontend/src/api/types.ts@@ -409,6 +409,7 @@ export type WorkflowRunStatusApiResponse = {webhook_callback_url: string | null;extra_http_headers: Record<string, string> | null;created_at: string;+ started_at: string | null;finished_at: string;modified_at: string;parameters: Record<string, unknown>;@@ -438,6 +439,7 @@ export type WorkflowRunStatusApiResponseWithWorkflow = {webhook_callback_url: string | null;extra_http_headers: Record<string, string> | null;created_at: string;+ started_at: string | null;finished_at: string;modified_at: string;parameters: Record<string, unknown>;diff --git a/skyvern-frontend/src/components/WorkflowBlockInput.tsx b/skyvern-frontend/src/components/WorkflowBlockInput.tsxindex f5c1a895e..3e98037b2 100644--- a/skyvern-frontend/src/components/WorkflowBlockInput.tsx+++ b/skyvern-frontend/src/components/WorkflowBlockInput.tsx@@ -73,7 +73,7 @@ function WorkflowBlockInput(props: Props) {<PlusIcon className="size-4" /></div></PopoverTrigger>- <PopoverContent className="w-[19rem]">+ <PopoverContent className="w-fit max-w-sm"><WorkflowBlockParameterSelectnodeId={nodeId}onAdd={(parameterKey) => {diff --git a/skyvern-frontend/src/components/WorkflowBlockInputSet.tsx b/skyvern-frontend/src/components/WorkflowBlockInputSet.tsxindex af0894335..bf758497a 100644--- a/skyvern-frontend/src/components/WorkflowBlockInputSet.tsx+++ b/skyvern-frontend/src/components/WorkflowBlockInputSet.tsx@@ -77,7 +77,7 @@ function WorkflowBlockInputSet(props: Props) {<PlusIcon className="size-4" /></div></PopoverTrigger>- <PopoverContent className="w-[19rem]">+ <PopoverContent className="w-fit max-w-sm"><WorkflowBlockParameterSelectnodeId={nodeId}onAdd={(parameterKey) => {diff --git a/skyvern-frontend/src/components/WorkflowBlockInputTextarea.tsx b/skyvern-frontend/src/components/WorkflowBlockInputTextarea.tsxindex 06f8682b9..a69af17b7 100644--- a/skyvern-frontend/src/components/WorkflowBlockInputTextarea.tsx+++ b/skyvern-frontend/src/components/WorkflowBlockInputTextarea.tsx@@ -114,7 +114,7 @@ function WorkflowBlockInputTextarea(props: Props) {<PlusIcon className="size-4" /></div></PopoverTrigger>- <PopoverContent className="w-[19rem]">+ <PopoverContent className="w-fit max-w-sm"><WorkflowBlockParameterSelectnodeId={nodeId}onAdd={insertParameterAtCursor}diff --git a/skyvern-frontend/src/router.tsx b/skyvern-frontend/src/router.tsxindex b593d7e3a..c217f28ea 100644--- a/skyvern-frontend/src/router.tsx+++ b/skyvern-frontend/src/router.tsx@@ -17,6 +17,7 @@ import { TaskRecording } from "./routes/tasks/detail/TaskRecording";import { TasksPage } from "./routes/tasks/list/TasksPage";import { Debugger } from "@/routes/workflows/debugger/Debugger";import { WorkflowPage } from "./routes/workflows/WorkflowPage";+import { WorkflowScriptDetailPage } from "./routes/workflows/WorkflowScriptDetailPage";import { WorkflowScriptsPage } from "./routes/workflows/WorkflowScriptsPage";import { WorkflowRun } from "./routes/workflows/WorkflowRun";import { WorkflowRunParameters } from "./routes/workflows/WorkflowRunParameters";@@ -169,7 +170,17 @@ const router = createBrowserRouter([},{path: "scripts",- element: <WorkflowScriptsPage />,+ element: <Outlet />,+ children: [+ {+ index: true,+ element: <WorkflowScriptsPage />,+ },+ {+ path: ":scriptId",+ element: <WorkflowScriptDetailPage />,+ },+ ],},{path: ":workflowRunId",diff --git a/skyvern-frontend/src/routes/workflows/WorkflowPage.tsx b/skyvern-frontend/src/routes/workflows/WorkflowPage.tsxindex 4d28d8bda..bd30d278e 100644--- a/skyvern-frontend/src/routes/workflows/WorkflowPage.tsx+++ b/skyvern-frontend/src/routes/workflows/WorkflowPage.tsx@@ -25,6 +25,7 @@ import {import { basicLocalTimeFormat, basicTimeFormat } from "@/util/timeFormat";import { cn } from "@/util/utils";import {+ CodeIcon,MixerHorizontalIcon,Pencil2Icon,PlayIcon,@@ -138,9 +139,12 @@ function WorkflowPage() {onSuccessfullyDeleted={() => navigate("/workflows")}/>)}- {/* Scripts button intentionally hidden — page is reachable via- /workflows/:wpid/scripts but not linked from the UI until the- design is finalized and ready for user-facing release. */}+ <Button asChild variant="secondary">+ <Link to={`/workflows/${workflowPermanentId}/scripts`}>+ <CodeIcon className="mr-2 size-4" />+ Scripts+ </Link>+ </Button><Button asChild variant="secondary"><Link to={`/workflows/${workflowPermanentId}/build`}><Pencil2Icon className="mr-2 size-4" />diff --git a/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx b/skyvern-frontend/src/routes/workflows/WorkflowRun.tsxindex e475cba8e..8f2c6e293 100644--- a/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx+++ b/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx@@ -24,6 +24,7 @@ import { toast } from "@/components/ui/use-toast";import { useApiCredential } from "@/hooks/useApiCredential";import { useCredentialGetter } from "@/hooks/useCredentialGetter";import { runsApiBaseUrl } from "@/util/env";+import { basicLocalTimeFormat, basicTimeFormat } from "@/util/timeFormat";import {CodeIcon,FileIcon,@@ -355,6 +356,21 @@ function WorkflowRun() {) : null}</div><h2 className="text-2xl text-slate-400">{workflowRunId}</h2>+ {workflowRun &&+ (workflowRun.started_at || workflowRun.finished_at) && (+ <div className="flex gap-4 text-sm text-slate-400">+ {workflowRun.started_at && (+ <span title={basicTimeFormat(workflowRun.started_at)}>+ Started: {basicLocalTimeFormat(workflowRun.started_at)}+ </span>+ )}+ {workflowRun.finished_at && (+ <span title={basicTimeFormat(workflowRun.finished_at)}>+ Finished: {basicLocalTimeFormat(workflowRun.finished_at)}+ </span>+ )}+ </div>+ )}{workflowRun?.browser_session_id && (<LinkclassName="font-mono text-sm text-slate-400 hover:text-slate-200 hover:underline hover:underline-offset-2"diff --git a/skyvern-frontend/src/routes/workflows/WorkflowScriptDetailPage.tsx b/skyvern-frontend/src/routes/workflows/WorkflowScriptDetailPage.tsxnew file mode 100644index 000000000..acf93e732--- /dev/null+++ b/skyvern-frontend/src/routes/workflows/WorkflowScriptDetailPage.tsx@@ -0,0 +1,363 @@+import { Badge } from "@/components/ui/badge";+import { Button } from "@/components/ui/button";+import { Skeleton } from "@/components/ui/skeleton";+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from "@/components/ui/table";+import {+ Tooltip,+ TooltipContent,+ TooltipProvider,+ TooltipTrigger,+} from "@/components/ui/tooltip";+import { basicLocalTimeFormat, basicTimeFormat } from "@/util/timeFormat";+import {+ ArrowLeftIcon,+ DrawingPinFilledIcon,+ DrawingPinIcon,+} from "@radix-ui/react-icons";+import { Link, useParams } from "react-router-dom";+import { CodeEditor } from "./components/CodeEditor";+import { usePinScriptMutation } from "./hooks/usePinScriptMutation";+import { useScriptRunsQuery } from "./hooks/useScriptRunsQuery";+import { useScriptVersionCodeQuery } from "./hooks/useScriptVersionCodeQuery";+import { useScriptVersionsQuery } from "./hooks/useScriptVersionsQuery";+import { useWorkflowScriptsQuery } from "./hooks/useWorkflowScriptsQuery";++const statusVariant: Record<string, "default" | "secondary" | "destructive"> = {+ completed: "default",+ running: "secondary",+ created: "secondary",+ queued: "secondary",+ failed: "destructive",+ terminated: "destructive",+ canceled: "secondary",+ timed_out: "destructive",+};++function StatusDistribution({+ statusCounts,+ totalCount,+}: {+ statusCounts: Record<string, number>;+ totalCount: number;+}) {+ if (totalCount === 0) return null;++ const statusColors: Record<string, string> = {+ completed: "bg-green-500",+ running: "bg-blue-500",+ failed: "bg-red-500",+ terminated: "bg-orange-500",+ canceled: "bg-slate-400",+ timed_out: "bg-yellow-500",+ created: "bg-slate-300",+ queued: "bg-slate-300",+ };++ return (+ <div className="space-y-2">+ <div className="flex h-3 w-full overflow-hidden rounded-full">+ {Object.entries(statusCounts).map(([status, count]) => (+ <div+ key={status}+ className={statusColors[status] ?? "bg-slate-300"}+ style={{ width: `${(count / totalCount) * 100}%` }}+ title={`${status}: ${count} (${Math.round((count / totalCount) * 100)}%)`}+ />+ ))}+ </div>+ <div className="flex flex-wrap gap-3 text-xs text-muted-foreground">+ {Object.entries(statusCounts).map(([status, count]) => (+ <div key={status} className="flex items-center gap-1.5">+ <div+ className={`size-2.5 rounded-full ${statusColors[status] ?? "bg-slate-300"}`}+ />+ <span>+ {status}: {count} ({Math.round((count / totalCount) * 100)}%)+ </span>+ </div>+ ))}+ </div>+ </div>+ );+}++function WorkflowScriptDetailPage() {+ const { workflowPermanentId, scriptId } = useParams();++ const { data: versions, isLoading: versionsLoading } = useScriptVersionsQuery(+ { scriptId },+ );++ const latestVersion = versions?.versions?.[0]?.version;++ const { data: codeData, isLoading: codeLoading } = useScriptVersionCodeQuery({+ scriptId,+ version: latestVersion,+ });++ const { data: runsData, isLoading: runsLoading } = useScriptRunsQuery({+ scriptId,+ pageSize: 50,+ });++ const { data: scriptsData } = useWorkflowScriptsQuery({+ workflowPermanentId,+ });++ const currentScript = scriptsData?.scripts?.find(+ (s) => s.script_id === scriptId,+ );+ const isPinned = currentScript?.is_pinned ?? false;++ const pinMutation = usePinScriptMutation({+ workflowPermanentId: workflowPermanentId ?? "",+ });++ const mainScript = codeData?.main_script ?? "";+ const latestVersionInfo = versions?.versions?.[0];+ const runs = runsData?.runs ?? [];+ const statusCounts = runsData?.status_counts ?? {};+ const totalCount = runsData?.total_count ?? 0;+ const MAX_RUNS_SHOWN = 50;++ if (!workflowPermanentId || !scriptId) return null;++ return (+ <div className="space-y-8">+ <header className="flex items-center justify-between">+ <div className="flex items-center gap-4">+ <Button asChild variant="ghost" size="icon">+ <Link to={`/workflows/${workflowPermanentId}/scripts`}>+ <ArrowLeftIcon className="size-5" />+ </Link>+ </Button>+ <div className="flex flex-col gap-1">+ <div className="flex items-center gap-2">+ <h1 className="text-lg font-semibold">Script Detail</h1>+ {currentScript && isPinned && (+ <Badge+ variant="secondary"+ className="gap-1 border-amber-500/30 bg-amber-500/10 text-amber-500"+ >+ <DrawingPinFilledIcon className="size-3" />+ Pinned+ </Badge>+ )}+ </div>+ <p className="font-mono text-sm text-muted-foreground">+ {scriptId}+ </p>+ </div>+ </div>+ {currentScript && (+ <TooltipProvider delayDuration={300}>+ <Tooltip>+ <TooltipTrigger asChild>+ <Button+ variant="outline"+ size="sm"+ className={+ isPinned+ ? "gap-2 border-amber-500/30 text-amber-500 hover:text-amber-400"+ : "gap-2"+ }+ disabled={pinMutation.isPending}+ onClick={() =>+ pinMutation.mutate({+ cacheKeyValue: currentScript.cache_key_value,+ pin: !isPinned,+ })+ }+ >+ {isPinned ? (+ <DrawingPinFilledIcon className="size-4" />+ ) : (+ <DrawingPinIcon className="size-4" />+ )}+ {isPinned ? "Unpin" : "Pin"}+ </Button>+ </TooltipTrigger>+ <TooltipContent side="bottom">+ {isPinned+ ? "Unpin script to allow auto-updates"+ : "Pin script to prevent auto-updates"}+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ )}+ </header>++ <div className="grid grid-cols-4 gap-4">+ <div className="rounded-md border p-4">+ <p className="text-sm text-muted-foreground">Latest Version</p>+ <p className="text-2xl font-semibold">+ {versionsLoading ? (+ <Skeleton className="h-8 w-12" />+ ) : (+ `v${latestVersion ?? "?"}`+ )}+ </p>+ </div>+ <div className="rounded-md border p-4">+ <p className="text-sm text-muted-foreground">Total Versions</p>+ <p className="text-2xl font-semibold">+ {versionsLoading ? (+ <Skeleton className="h-8 w-12" />+ ) : (+ versions?.versions?.length ?? 0+ )}+ </p>+ </div>+ <div className="rounded-md border p-4">+ <p className="text-sm text-muted-foreground">Total Runs</p>+ <p className="text-2xl font-semibold">+ {runsLoading ? <Skeleton className="h-8 w-12" /> : totalCount}+ </p>+ </div>+ <div className="rounded-md border p-4">+ <p className="text-sm text-muted-foreground">Completion Rate</p>+ <p className="text-2xl font-semibold">+ {runsLoading ? (+ <Skeleton className="h-8 w-12" />+ ) : totalCount > 0 ? (+ `${Math.round(((statusCounts["completed"] ?? 0) / totalCount) * 100)}%`+ ) : (+ "N/A"+ )}+ </p>+ </div>+ </div>++ <div className="space-y-3">+ <h2 className="text-lg font-semibold">Run Status Distribution</h2>+ {runsLoading ? (+ <Skeleton className="h-10 w-full" />+ ) : (+ <StatusDistribution+ statusCounts={statusCounts}+ totalCount={totalCount}+ />+ )}+ </div>++ <div className="space-y-3">+ <h2 className="text-lg font-semibold">Script Code</h2>+ {!codeLoading && !versionsLoading && latestVersionInfo?.run_id && (+ <p className="text-sm text-muted-foreground">+ v{latestVersion} created on run{" "}+ <Link+ to={`/workflows/${workflowPermanentId}/${latestVersionInfo.run_id}/code`}+ className="font-mono text-blue-400 hover:underline"+ >+ {latestVersionInfo.run_id}+ </Link>+ </p>+ )}+ {codeLoading || versionsLoading ? (+ <Skeleton className="h-64 w-full" />+ ) : mainScript ? (+ <div className="max-h-[500px] overflow-auto rounded-md border">+ <CodeEditor value={mainScript} readOnly language="python" />+ </div>+ ) : (+ <p className="text-sm text-muted-foreground">+ No code available for this script.+ </p>+ )}+ </div>++ <div className="space-y-3">+ <h2 className="text-lg font-semibold">+ Recent Runs{" "}+ <span className="text-sm font-normal text-muted-foreground">+ {totalCount > MAX_RUNS_SHOWN+ ? `(showing ${runs.length} of ${totalCount})`+ : `(${totalCount})`}+ </span>+ </h2>+ <div className="rounded-md border">+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>Run ID</TableHead>+ <TableHead>Status</TableHead>+ <TableHead>Started</TableHead>+ <TableHead>Finished</TableHead>+ <TableHead>Failure Reason</TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {runsLoading ? (+ <TableRow>+ <TableCell colSpan={5}>+ <Skeleton className="h-6 w-full" />+ </TableCell>+ </TableRow>+ ) : runs.length === 0 ? (+ <TableRow>+ <TableCell+ colSpan={5}+ className="py-8 text-center text-muted-foreground"+ >+ No runs found for this script.+ </TableCell>+ </TableRow>+ ) : (+ runs.map((run) => (+ <TableRow key={run.workflow_run_id}>+ <TableCell>+ <Link+ to={`/workflows/${workflowPermanentId}/${run.workflow_run_id}/overview`}+ className="font-mono text-sm text-blue-400 hover:underline"+ >+ {run.workflow_run_id}+ </Link>+ </TableCell>+ <TableCell>+ <Badge variant={statusVariant[run.status] ?? "secondary"}>+ {run.status}+ </Badge>+ </TableCell>+ <TableCell+ title={+ run.started_at ? basicTimeFormat(run.started_at) : ""+ }+ >+ {run.started_at+ ? basicLocalTimeFormat(run.started_at)+ : "-"}+ </TableCell>+ <TableCell+ title={+ run.finished_at ? basicTimeFormat(run.finished_at) : ""+ }+ >+ {run.finished_at+ ? basicLocalTimeFormat(run.finished_at)+ : "-"}+ </TableCell>+ <TableCell+ className="max-w-xs truncate"+ title={run.failure_reason ?? ""}+ >+ {run.failure_reason ?? "-"}+ </TableCell>+ </TableRow>+ ))+ )}+ </TableBody>+ </Table>+ </div>+ </div>+ </div>+ );+}++export { WorkflowScriptDetailPage };diff --git a/skyvern-frontend/src/routes/workflows/WorkflowScriptsPage.tsx b/skyvern-frontend/src/routes/workflows/WorkflowScriptsPage.tsxindex c82d1337f..5cbccf9b4 100644--- a/skyvern-frontend/src/routes/workflows/WorkflowScriptsPage.tsx+++ b/skyvern-frontend/src/routes/workflows/WorkflowScriptsPage.tsx@@ -1,5 +1,15 @@-import { Badge } from "@/components/ui/badge";+import { getClient } from "@/api/AxiosClient";import { Button } from "@/components/ui/button";+import {+ Dialog,+ DialogClose,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+ DialogTrigger,+} from "@/components/ui/dialog";import { Skeleton } from "@/components/ui/skeleton";import {Table,@@ -9,27 +19,245 @@ import {TableHeader,TableRow,} from "@/components/ui/table";+import {+ Tooltip,+ TooltipContent,+ TooltipProvider,+ TooltipTrigger,+} from "@/components/ui/tooltip";+import { toast } from "@/components/ui/use-toast";+import { useCredentialGetter } from "@/hooks/useCredentialGetter";import { basicLocalTimeFormat, basicTimeFormat } from "@/util/timeFormat";-import { FileTextIcon, Pencil2Icon, PlayIcon } from "@radix-ui/react-icons";+import {+ DrawingPinFilledIcon,+ DrawingPinIcon,+ FileTextIcon,+ Pencil2Icon,+ PlayIcon,+ ReloadIcon,+ TrashIcon,+} from "@radix-ui/react-icons";+import { useMutation, useQueryClient } from "@tanstack/react-query";+import { type AxiosError } from "axios";+import { useState } from "react";import { Link, useNavigate, useParams } from "react-router-dom";+import { usePinScriptMutation } from "./hooks/usePinScriptMutation";import { useWorkflowQuery } from "./hooks/useWorkflowQuery";import { useWorkflowScriptsQuery } from "./hooks/useWorkflowScriptsQuery";import { WorkflowActions } from "./WorkflowActions";import type { WorkflowScriptSummary } from "./types/scriptTypes";+const TABLE_COL_COUNT = 7;++function PinButton({+ workflowPermanentId,+ script,+}: {+ workflowPermanentId: string;+ script: WorkflowScriptSummary;+}) {+ const pinMutation = usePinScriptMutation({ workflowPermanentId });++ return (+ <TooltipProvider delayDuration={300}>+ <Tooltip>+ <TooltipTrigger asChild>+ <Button+ variant="ghost"+ size="icon"+ className={`size-8 ${+ script.is_pinned+ ? "text-amber-500 hover:text-amber-400"+ : "text-muted-foreground hover:text-foreground"+ }`}+ disabled={pinMutation.isPending}+ onClick={(e) => {+ e.stopPropagation();+ pinMutation.mutate({+ cacheKeyValue: script.cache_key_value,+ pin: !script.is_pinned,+ });+ }}+ >+ {script.is_pinned ? (+ <DrawingPinFilledIcon className="size-4" />+ ) : (+ <DrawingPinIcon className="size-4" />+ )}+ </Button>+ </TooltipTrigger>+ <TooltipContent side="top">+ {script.is_pinned+ ? "Unpin script (allow auto-updates)"+ : "Pin script (prevent auto-updates)"}+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ );+}++function DeleteScriptButton({+ workflowPermanentId,+ script,+}: {+ workflowPermanentId: string;+ script: WorkflowScriptSummary;+}) {+ const credentialGetter = useCredentialGetter();+ const queryClient = useQueryClient();+ const [open, setOpen] = useState(false);++ const deleteMutation = useMutation({+ mutationFn: async () => {+ const client = await getClient(credentialGetter, "sans-api-v1");+ return client.delete(+ `/scripts/${workflowPermanentId}/value?cache-key-value=${encodeURIComponent(script.cache_key_value)}`,+ );+ },+ onSuccess: () => {+ setOpen(false);+ queryClient.invalidateQueries({+ queryKey: ["workflow-scripts", workflowPermanentId],+ });+ toast({ title: "Script deleted", variant: "success" });+ },+ onError: (error: AxiosError) => {+ toast({+ variant: "destructive",+ title: "Failed to delete script",+ description: error.message,+ });+ },+ });++ return (+ <Dialog open={open} onOpenChange={setOpen}>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="icon"+ className="size-8 text-muted-foreground hover:text-destructive"+ onClick={(e) => e.stopPropagation()}+ >+ <TrashIcon className="size-4" />+ </Button>+ </DialogTrigger>+ <DialogContent onClick={(e) => e.stopPropagation()}>+ <DialogHeader>+ <DialogTitle>Delete script?</DialogTitle>+ <DialogDescription>+ This will delete the cached script for{" "}+ <span className="font-mono font-semibold text-primary">+ {script.cache_key_value}+ </span>+ . The script will be regenerated on the next run.+ </DialogDescription>+ </DialogHeader>+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="secondary">Cancel</Button>+ </DialogClose>+ <Button+ variant="destructive"+ onClick={() => deleteMutation.mutate()}+ disabled={deleteMutation.isPending}+ >+ {deleteMutation.isPending && (+ <ReloadIcon className="mr-2 size-4 animate-spin" />+ )}+ Delete+ </Button>+ </DialogFooter>+ </DialogContent>+ </Dialog>+ );+}++function ClearAllScriptsButton({+ workflowPermanentId,+ disabled,+}: {+ workflowPermanentId: string;+ disabled: boolean;+}) {+ const credentialGetter = useCredentialGetter();+ const queryClient = useQueryClient();+ const [open, setOpen] = useState(false);++ const clearMutation = useMutation({+ mutationFn: async () => {+ const client = await getClient(credentialGetter, "sans-api-v1");+ return client.delete(`/scripts/${workflowPermanentId}/cache`);+ },+ onSuccess: () => {+ setOpen(false);+ queryClient.invalidateQueries({+ queryKey: ["workflow-scripts", workflowPermanentId],+ });+ toast({ title: "All scripts cleared", variant: "success" });+ },+ onError: (error: AxiosError) => {+ toast({+ variant: "destructive",+ title: "Failed to clear scripts",+ description: error.message,+ });+ },+ });++ return (+ <Dialog open={open} onOpenChange={setOpen}>+ <DialogTrigger asChild>+ <Button variant="destructive" size="sm" disabled={disabled}>+ <TrashIcon className="mr-2 size-4" />+ Clear All Scripts+ </Button>+ </DialogTrigger>+ <DialogContent>+ <DialogHeader>+ <DialogTitle>Clear all scripts?</DialogTitle>+ <DialogDescription>+ This will delete all cached scripts for this workflow. Scripts will+ be regenerated on the next run. This action cannot be undone.+ </DialogDescription>+ </DialogHeader>+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="secondary">Cancel</Button>+ </DialogClose>+ <Button+ variant="destructive"+ onClick={() => clearMutation.mutate()}+ disabled={clearMutation.isPending}+ >+ {clearMutation.isPending && (+ <ReloadIcon className="mr-2 size-4 animate-spin" />+ )}+ Clear All+ </Button>+ </DialogFooter>+ </DialogContent>+ </Dialog>+ );+}+function ScriptsTableRows({isLoading,isError,scripts,+ workflowPermanentId,}: {isLoading: boolean;isError: boolean;scripts: WorkflowScriptSummary[];+ workflowPermanentId: string;}) {+ const navigate = useNavigate();+if (isLoading) {return (<TableRow>- <TableCell colSpan={5}>+ <TableCell colSpan={TABLE_COL_COUNT}><div className="space-y-2 py-2"><Skeleton className="h-6 w-full" /><Skeleton className="h-6 w-full" />@@ -43,7 +271,7 @@ function ScriptsTableRows({if (isError) {return (<TableRow>- <TableCell colSpan={5}>+ <TableCell colSpan={TABLE_COL_COUNT}><div className="flex flex-col items-center gap-2 py-12 text-center"><p className="text-sm text-red-500">Failed to load scripts. Please try again.@@ -57,7 +285,7 @@ function ScriptsTableRows({if (scripts.length === 0) {return (<TableRow>- <TableCell colSpan={5}>+ <TableCell colSpan={TABLE_COL_COUNT}><div className="flex flex-col items-center gap-2 py-12 text-center"><FileTextIcon className="size-8 text-slate-400" /><p className="text-sm text-slate-500">@@ -71,23 +299,49 @@ function ScriptsTableRows({}return scripts.map((script) => (- // TODO: link to script detail view in Phase 2- <TableRow key={script.script_id}>+ <TableRow+ key={script.script_id}+ className="cursor-pointer"+ onClick={() =>+ navigate(+ `/workflows/${workflowPermanentId}/scripts/${script.script_id}`,+ )+ }+ >+ <TableCell className="w-10">+ <PinButton workflowPermanentId={workflowPermanentId} script={script} />+ </TableCell><TableCell className="font-mono text-sm">{script.cache_key_value || "(default)"}</TableCell>- <TableCell>{script.version_count}</TableCell><TableCell>v{script.latest_version}</TableCell>+ <TableCell>{script.total_runs}</TableCell><TableCell>- <Badge- variant={script.status === "published" ? "default" : "secondary"}- >- {script.status}- </Badge>+ {script.success_rate != null ? (+ <span+ className={+ script.success_rate >= 0.8+ ? "text-green-500"+ : script.success_rate >= 0.5+ ? "text-yellow-500"+ : "text-red-500"+ }+ >+ {Math.round(script.success_rate * 100)}%+ </span>+ ) : (+ <span className="text-muted-foreground">-</span>+ )}</TableCell><TableCell title={basicTimeFormat(script.modified_at)}>{basicLocalTimeFormat(script.modified_at)}</TableCell>+ <TableCell>+ <DeleteScriptButton+ workflowPermanentId={workflowPermanentId}+ script={script}+ />+ </TableCell></TableRow>));}@@ -154,19 +408,29 @@ function WorkflowScriptsPage() {<div className="space-y-4"><header className="flex items-center justify-between"><h1 className="text-2xl">Scripts</h1>- <Button asChild variant="outline" size="sm">- <Link to={`/workflows/${workflowPermanentId}/runs`}>View Runs</Link>- </Button>+ <div className="flex gap-2">+ <ClearAllScriptsButton+ workflowPermanentId={workflowPermanentId}+ disabled={scripts.length === 0}+ />+ <Button asChild variant="outline" size="sm">+ <Link to={`/workflows/${workflowPermanentId}/runs`}>+ View Runs+ </Link>+ </Button>+ </div></header><div className="rounded-md border"><Table><TableHeader><TableRow>- <TableHead className="w-1/4">Cache Key Value</TableHead>- <TableHead className="w-1/6">Versions</TableHead>- <TableHead className="w-1/6">Latest</TableHead>- <TableHead className="w-1/6">Status</TableHead>- <TableHead className="w-1/4">Last Updated</TableHead>+ <TableHead className="w-10" />+ <TableHead>Cache Key Value</TableHead>+ <TableHead>Version</TableHead>+ <TableHead>Total Runs</TableHead>+ <TableHead>Success Rate</TableHead>+ <TableHead>Last Updated</TableHead>+ <TableHead className="w-12" /></TableRow></TableHeader><TableBody>@@ -174,6 +438,7 @@ function WorkflowScriptsPage() {isLoading={scriptsLoading}isError={isError}scripts={scripts}+ workflowPermanentId={workflowPermanentId}/></TableBody></Table>diff --git a/skyvern-frontend/src/routes/workflows/Workflows.tsx b/skyvern-frontend/src/routes/workflows/Workflows.tsxindex d81931c18..5eb939ff5 100644--- a/skyvern-frontend/src/routes/workflows/Workflows.tsx+++ b/skyvern-frontend/src/routes/workflows/Workflows.tsx@@ -112,7 +112,8 @@ const emptyWorkflowRequest: WorkflowCreateYAMLRequest = {title: "New Workflow",description: "",ai_fallback: true,- run_with: "agent",+ adaptive_caching: true,+ run_with: "code",workflow_definition: {version: 2,blocks: [],diff --git a/skyvern-frontend/src/routes/workflows/WorkflowsPageBanner.tsx b/skyvern-frontend/src/routes/workflows/WorkflowsPageBanner.tsxindex 1241b2203..b49d1aa55 100644--- a/skyvern-frontend/src/routes/workflows/WorkflowsPageBanner.tsx+++ b/skyvern-frontend/src/routes/workflows/WorkflowsPageBanner.tsx@@ -7,6 +7,9 @@ import { WorkflowCreateYAMLRequest } from "./types/workflowYamlTypes";const emptyWorkflowRequest: WorkflowCreateYAMLRequest = {title: "New Workflow",description: "",+ ai_fallback: true,+ adaptive_caching: true,+ run_with: "code",workflow_definition: {version: 2,blocks: [],diff --git a/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx b/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsxindex ebb964c40..b2c159ba5 100644--- a/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx+++ b/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx@@ -77,7 +77,7 @@ function WorkflowEditor() {runWith:workflow.adaptive_caching && workflow.run_with === "code"? "code_v2"- : workflow.run_with,+ : workflow.run_with ?? "agent",scriptCacheKey: workflow.cache_key,aiFallback: workflow.ai_fallback ?? true,runSequentially: workflow.run_sequentially ?? false,diff --git a/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx b/skyvern-frontend/src/routes/workflows/editor/Workspace.tsxindex c8614bd53..0b2c84714 100644--- a/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx+++ b/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx@@ -1052,7 +1052,7 @@ function Workspace({runWith:workflowData.adaptive_caching && workflowData.run_with === "code"? "code_v2"- : workflowData.run_with ?? null,+ : workflowData.run_with ?? "agent",scriptCacheKey: workflowData.cache_key ?? null,aiFallback: workflowData.ai_fallback ?? true,runSequentially: workflowData.run_sequentially ?? false,@@ -1102,7 +1102,7 @@ function Workspace({runWith:selectedVersion.adaptive_caching && selectedVersion.run_with === "code"? "code_v2"- : selectedVersion.run_with,+ : selectedVersion.run_with ?? "agent",scriptCacheKey: selectedVersion.cache_key,aiFallback: selectedVersion.ai_fallback ?? true,runSequentially: selectedVersion.run_sequentially ?? false,diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/HttpRequestNode/HttpUtils.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/HttpRequestNode/HttpUtils.tsxindex df4d746f9..12199049d 100644--- a/skyvern-frontend/src/routes/workflows/editor/nodes/HttpRequestNode/HttpUtils.tsx+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/HttpRequestNode/HttpUtils.tsx@@ -213,14 +213,14 @@ export function RequestPreview({return (<div className="rounded-md border bg-slate-50 p-3 dark:bg-slate-900/50">- <div className="flex items-center justify-between">- <div className="flex items-center gap-2">- <MethodBadge method={method} />- <span className="font-mono text-sm text-slate-600 dark:text-slate-400">+ <div className="flex items-center justify-between gap-2">+ <div className="flex min-w-0 items-center gap-2">+ <MethodBadge method={method} className="shrink-0" />+ <span className="truncate font-mono text-sm text-slate-600 dark:text-slate-400">{url || "No URL specified"}</span>{hasFiles && (- <Badge variant="outline" className="text-xs">+ <Badge variant="outline" className="shrink-0 text-xs">Files</Badge>)}@@ -229,7 +229,7 @@ export function RequestPreview({variant="ghost"size="sm"onClick={() => setExpanded(!expanded)}- className="h-6 text-xs"+ className="h-6 shrink-0 text-xs">{expanded ? "Hide" : "Show"} Details</Button>@@ -237,6 +237,14 @@ export function RequestPreview({{expanded && (<div className="mt-3 space-y-2">+ {/* URL */}+ <div>+ <div className="mb-1 text-xs font-medium">URL:</div>+ <pre className="overflow-x-auto whitespace-pre-wrap break-all rounded bg-slate-100 p-2 text-xs text-slate-600 dark:bg-slate-800 dark:text-slate-400">+ {url}+ </pre>+ </div>+{/* Headers */}<div><div className="mb-1 text-xs font-medium">Headers:</div>diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsxindex ea26a2f44..30a622db8 100644--- a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx@@ -294,7 +294,7 @@ function StartNode({ id, data, parentId }: NodeProps<StartNode>) {<HelpTooltip content="If code has been generated and saved from a previously successful run, set this to 'Code' to use that code when executing the workflow. To avoid using code, set this to 'Skyvern Agent'." /></div><Select- value={data.runWith ?? "agent"}+ value={data.runWith || "agent"}onValueChange={(value) => {update({ runWith: value });}}diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.tsindex 60a4e5a78..4db116e2a 100644--- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts+++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts@@ -2765,7 +2765,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {model: null,maxScreenshotScrolls: null,extraHttpHeaders: null,- runWith: "agent",+ runWith: "code_v2",scriptCacheKey: null,aiFallback: true,runSequentially: false,diff --git a/skyvern-frontend/src/routes/workflows/hooks/usePinScriptMutation.ts b/skyvern-frontend/src/routes/workflows/hooks/usePinScriptMutation.tsnew file mode 100644index 000000000..f849f28b0--- /dev/null+++ b/skyvern-frontend/src/routes/workflows/hooks/usePinScriptMutation.ts@@ -0,0 +1,50 @@+import { getClient } from "@/api/AxiosClient";+import { toast } from "@/components/ui/use-toast";+import { useCredentialGetter } from "@/hooks/useCredentialGetter";+import { useMutation, useQueryClient } from "@tanstack/react-query";+import { AxiosError } from "axios";+import type { PinScriptResponse } from "../types/scriptTypes";++type Props = {+ workflowPermanentId: string;+};++function usePinScriptMutation({ workflowPermanentId }: Props) {+ const credentialGetter = useCredentialGetter();+ const queryClient = useQueryClient();++ return useMutation<+ PinScriptResponse,+ AxiosError<{ detail?: string }>,+ { cacheKeyValue: string; pin: boolean }+ >({+ mutationFn: async ({ cacheKeyValue, pin }) => {+ const client = await getClient(credentialGetter, "sans-api-v1");+ const action = pin ? "pin" : "unpin";+ return client+ .post<PinScriptResponse>(`/scripts/${workflowPermanentId}/${action}`, {+ cache_key_value: cacheKeyValue,+ })+ .then((response) => response.data);+ },+ onSuccess: (data) => {+ queryClient.invalidateQueries({+ queryKey: ["workflow-scripts", workflowPermanentId],+ });+ toast({+ title: data.is_pinned ? "Script pinned" : "Script unpinned",+ variant: "success",+ });+ },+ onError: (error) => {+ const detail = error.response?.data?.detail;+ toast({+ title: "Failed to update pin status",+ description: detail ?? error.message,+ variant: "destructive",+ });+ },+ });+}++export { usePinScriptMutation };diff --git a/skyvern-frontend/src/routes/workflows/hooks/useScriptRunsQuery.ts b/skyvern-frontend/src/routes/workflows/hooks/useScriptRunsQuery.tsnew file mode 100644index 000000000..1a3bcc46f--- /dev/null+++ b/skyvern-frontend/src/routes/workflows/hooks/useScriptRunsQuery.ts@@ -0,0 +1,26 @@+import { getClient } from "@/api/AxiosClient";+import { useCredentialGetter } from "@/hooks/useCredentialGetter";+import { useQuery } from "@tanstack/react-query";+import type { ScriptRunsResponse } from "../types/scriptTypes";++type Props = {+ scriptId?: string;+ pageSize?: number;+};++function useScriptRunsQuery({ scriptId, pageSize = 50 }: Props) {+ const credentialGetter = useCredentialGetter();++ return useQuery<ScriptRunsResponse>({+ queryKey: ["script-runs", scriptId, pageSize],+ queryFn: async () => {+ const client = await getClient(credentialGetter, "sans-api-v1");+ return client+ .get(`/scripts/${scriptId}/runs?page_size=${pageSize}`)+ .then((r) => r.data);+ },+ enabled: !!scriptId,+ });+}++export { useScriptRunsQuery };diff --git a/skyvern-frontend/src/routes/workflows/types/scriptTypes.ts b/skyvern-frontend/src/routes/workflows/types/scriptTypes.tsindex 46577f3cd..75680e2bd 100644--- a/skyvern-frontend/src/routes/workflows/types/scriptTypes.ts+++ b/skyvern-frontend/src/routes/workflows/types/scriptTypes.ts@@ -97,6 +97,9 @@ export type WorkflowScriptSummary = {status: "published" | "pending";latest_version: number;version_count: number;+ total_runs: number;+ success_rate: number | null;+ is_pinned: boolean;created_at: string;modified_at: string;};@@ -115,3 +118,18 @@ export type PinScriptResponse = {is_pinned: boolean;pinned_at: string | null;};++export type ScriptRunSummary = {+ workflow_run_id: string;+ status: string;+ started_at: string | null;+ finished_at: string | null;+ created_at: string;+ failure_reason: string | null;+};++export type ScriptRunsResponse = {+ runs: ScriptRunSummary[];+ total_count: number;+ status_counts: Record<string, number>;+};diff --git a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowTypes.tsindex 8d6eadc4e..14a4a47d0 100644--- a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts+++ b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts@@ -617,7 +617,7 @@ export type WorkflowSettings = {model: WorkflowModel | null;maxScreenshotScrolls: number | null;extraHttpHeaders: string | null;- runWith: string | null; // 'agent' or 'code'+ runWith: string | null; // 'agent', 'code', or 'code_v2'scriptCacheKey: string | null;aiFallback: boolean | null;runSequentially: boolean;diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunTimelineBlockItem.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunTimelineBlockItem.tsxindex def78ad8b..eefdeaa82 100644--- a/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunTimelineBlockItem.tsx+++ b/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunTimelineBlockItem.tsx@@ -270,19 +270,10 @@ function WorkflowRunTimelineBlockItem({const actions = block.actions ?? [];const isFinallyBlock = finallyBlockLabel && block.label === finallyBlockLabel;- const hasActiveAction =- isAction(activeItem) &&- Boolean(- block.actions?.find(- (action) => action.action_id === activeItem.action_id,- ),- );- const isActiveBlock =- isWorkflowRunBlock(activeItem) &&- activeItem.workflow_run_block_id === block.workflow_run_block_id;-const showDiagnosticLink =- isTaskVariantBlock(block) && (hasActiveAction || isActiveBlock);+ isTaskVariantBlock(block) &&+ block.task_id !== null &&+ block.task_id !== undefined;const refCallback = useCallback((element: HTMLDivElement | null) => {if (diff --git a/skyvern/core/script_generations/real_skyvern_page_ai.py b/skyvern/core/script_generations/real_skyvern_page_ai.pyindex c1493ca45..d46fa6351 100644--- a/skyvern/core/script_generations/real_skyvern_page_ai.py+++ b/skyvern/core/script_generations/real_skyvern_page_ai.py@@ -257,6 +257,7 @@ class RealSkyvernPageAi(SkyvernPageAi):if value and isinstance(data, dict) and "value" not in data:data["value"] = value+ otp_value = Noneif (totp_identifier or totp_url) and context and organization_id and task_id:if totp_identifier:totp_identifier = _render_template_with_label(totp_identifier, label=self.current_label)diff --git a/skyvern/core/script_generations/skyvern_page.py b/skyvern/core/script_generations/skyvern_page.pyindex cd02be9a4..76fcd9da9 100644--- a/skyvern/core/script_generations/skyvern_page.py+++ b/skyvern/core/script_generations/skyvern_page.py@@ -428,8 +428,17 @@ class SkyvernPage(Page):# Skip fill when value is None (missing parameter) and AI won't generate one.# ai='proactive' means the LLM generates the value from the prompt, so None is fine there.if value is None and ai != "proactive":- LOG.info("Skipping fill — value is None (missing parameter)", selector=selector, prompt=prompt)- return ""+ if prompt:+ LOG.info(+ "Upgrading to proactive — value is None but prompt provided",+ selector=selector,+ prompt=prompt,+ original_ai=ai,+ )+ ai = "proactive"+ else:+ LOG.info("Skipping fill — value is None and no prompt", selector=selector, prompt=prompt)+ return ""timeout = kwargs.pop("timeout", settings.BROWSER_ACTION_TIMEOUT_MS)data = kwargs.pop("data", None)@@ -544,10 +553,20 @@ class SkyvernPage(Page):if not selector and not prompt:raise ValueError("Missing input: pass a selector and/or a prompt.")- # Skip when value is None and AI won't generate one+ # Skip fill when value is None (missing parameter) and AI won't generate one.+ # ai='proactive' means the LLM generates the value from the prompt, so None is fine there.if value is None and ai != "proactive":- LOG.info("Skipping fill_autocomplete — value is None (missing parameter)", selector=selector, prompt=prompt)- return ""+ if prompt:+ LOG.info(+ "Upgrading to proactive — value is None but prompt provided",+ selector=selector,+ prompt=prompt,+ original_ai=ai,+ )+ ai = "proactive"+ else:+ LOG.info("Skipping fill_autocomplete — value is None and no prompt", selector=selector, prompt=prompt)+ return ""context = skyvern_context.current()if context and context.ai_mode_override:diff --git a/skyvern/forge/sdk/api/aws.py b/skyvern/forge/sdk/api/aws.pyindex 8d16f8457..878364c3d 100644--- a/skyvern/forge/sdk/api/aws.py+++ b/skyvern/forge/sdk/api/aws.py@@ -29,7 +29,7 @@ class S3StorageClass(StrEnum):ONEZONE_IA = "ONEZONE_IA"GLACIER = "GLACIER"GLACIER_IR = "GLACIER_IR" # Glacier Instant Retrieval- # DEEP_ARCHIVE = "DEEP_ARCHIVE"+ DEEP_ARCHIVE = "DEEP_ARCHIVE"# OUTPOSTS = "OUTPOSTS"# STANDARD_IA = "STANDARD_IA"diff --git a/skyvern/forge/sdk/api/llm/config_registry.py b/skyvern/forge/sdk/api/llm/config_registry.pyindex 3d96f85d4..2322a70e6 100644--- a/skyvern/forge/sdk/api/llm/config_registry.py+++ b/skyvern/forge/sdk/api/llm/config_registry.py@@ -349,6 +349,9 @@ if settings.ENABLE_ANTHROPIC:max_completion_tokens=8192,),)+ # All Claude 4+ models require temperature=1 when extended thinking is enabled.+ # The runtime applies thinking optimization to all Anthropic models, so temperature=1+ # must be set here to avoid "temperature must be 1" errors from the Anthropic API.LLMConfigRegistry.register_config("ANTHROPIC_CLAUDE4_OPUS",LLMConfig(@@ -357,6 +360,7 @@ if settings.ENABLE_ANTHROPIC:supports_vision=True,add_assistant_prefix=True,max_completion_tokens=32000,+ temperature=1,),)LLMConfigRegistry.register_config(@@ -367,6 +371,7 @@ if settings.ENABLE_ANTHROPIC:supports_vision=True,add_assistant_prefix=True,max_completion_tokens=64000,+ temperature=1,),)LLMConfigRegistry.register_config(@@ -377,6 +382,7 @@ if settings.ENABLE_ANTHROPIC:supports_vision=True,add_assistant_prefix=True,max_completion_tokens=64000,+ temperature=1,),)LLMConfigRegistry.register_config(@@ -387,6 +393,7 @@ if settings.ENABLE_ANTHROPIC:supports_vision=True,add_assistant_prefix=True,max_completion_tokens=64000,+ temperature=1,),)LLMConfigRegistry.register_config(@@ -516,6 +523,7 @@ if settings.ENABLE_BEDROCK:supports_vision=True,add_assistant_prefix=True,max_completion_tokens=64000,+ temperature=1,),)LLMConfigRegistry.register_config(@@ -526,6 +534,7 @@ if settings.ENABLE_BEDROCK:supports_vision=True,add_assistant_prefix=True,max_completion_tokens=32000,+ temperature=1,),)LLMConfigRegistry.register_config(diff --git a/skyvern/forge/sdk/core/skyvern_context.py b/skyvern/forge/sdk/core/skyvern_context.pyindex 24ba4bad8..3c441d3aa 100644--- a/skyvern/forge/sdk/core/skyvern_context.py+++ b/skyvern/forge/sdk/core/skyvern_context.py@@ -33,6 +33,7 @@ class SkyvernContext:browser_container_task_arn: str | None = None# feature flags+ enable_page_ready_wait: bool = Falseenable_parse_select_in_extract: bool = Falseuse_prompt_caching: bool = Falsecached_static_prompt: str | None = Nonediff --git a/skyvern/forge/sdk/db/agent_db.py b/skyvern/forge/sdk/db/agent_db.pyindex cb8730730..040b518df 100644--- a/skyvern/forge/sdk/db/agent_db.py+++ b/skyvern/forge/sdk/db/agent_db.py@@ -6111,13 +6111,17 @@ class AgentDB(BaseAlchemyDB):query = (select(ScriptModel.script_id,+ # max(version) must include soft-deleted rows so next-version+ # assignment doesn't collide with the unique constraint.func.max(ScriptModel.version),- func.count(ScriptModel.script_revision_id),+ # version_count only counts live rows (for display).+ func.count(ScriptModel.script_revision_id).filter(+ ScriptModel.deleted_at.is_(None),+ ),).filter(ScriptModel.organization_id == organization_id,ScriptModel.script_id.in_(script_ids),- ScriptModel.deleted_at.is_(None),).group_by(ScriptModel.script_id))@@ -6287,6 +6291,16 @@ class AgentDB(BaseAlchemyDB):).all()return [convert_to_script_file(script_file) for script_file in script_files]+ async def soft_delete_script_by_revision(self, script_revision_id: str, organization_id: str) -> None:+ async with self.Session() as session:+ await session.execute(+ update(ScriptModel)+ .filter_by(script_revision_id=script_revision_id)+ .filter_by(organization_id=organization_id)+ .values(deleted_at=datetime.utcnow())+ )+ await session.commit()+async def get_script_file_by_id(self,script_revision_id: str,@@ -6668,6 +6682,133 @@ class AgentDB(BaseAlchemyDB):LOG.error("UnexpectedError", exc_info=True)raise+ async def get_workflow_runs_for_script(+ self,+ organization_id: str,+ script_id: str,+ page_size: int = 50,+ created_after: datetime | None = None,+ created_before: datetime | None = None,+ ) -> tuple[list[WorkflowRunModel], int, dict[str, int]]:+ """Get workflow runs associated with a script, with total count and status counts.++ Returns (runs, total_count, status_counts) where runs is limited by page_size,+ total_count is derived from the status_counts GROUP BY, and status_counts is a+ GROUP BY aggregation of statuses across all runs.++ If created_after/created_before are provided, filters runs to those that started+ within the time window (used for version-scoped queries).+ """+ try:+ async with self.Session() as session:+ # Subquery: distinct run IDs for this script+ run_ids_subquery = (+ select(distinct(WorkflowScriptModel.workflow_run_id))+ .filter_by(organization_id=organization_id, script_id=script_id)+ .filter(WorkflowScriptModel.deleted_at.is_(None))+ .filter(WorkflowScriptModel.workflow_run_id.isnot(None))+ )++ # Base filter for workflow runs+ base_filters = [+ WorkflowRunModel.workflow_run_id.in_(run_ids_subquery),+ WorkflowRunModel.organization_id == organization_id,+ ]+ if created_after is not None:+ base_filters.append(WorkflowRunModel.created_at >= created_after)+ if created_before is not None:+ base_filters.append(WorkflowRunModel.created_at < created_before)++ # Count statuses via GROUP BY (also gives us total_count)+ status_query = (+ select(WorkflowRunModel.status, func.count())+ .filter(*base_filters)+ .group_by(WorkflowRunModel.status)+ )+ status_counts = {(s or "unknown"): c for s, c in (await session.execute(status_query)).all()}+ total_count = sum(status_counts.values())++ if total_count == 0:+ return [], 0, {}++ # Get the actual workflow runs (paginated)+ runs_query = (+ select(WorkflowRunModel)+ .filter(*base_filters)+ .order_by(WorkflowRunModel.created_at.desc())+ .limit(page_size)+ )+ runs = list((await session.scalars(runs_query)).all())++ return runs, total_count, status_counts+ except SQLAlchemyError:+ LOG.error("SQLAlchemyError", exc_info=True)+ raise+ except Exception:+ LOG.error("UnexpectedError", exc_info=True)+ raise++ async def get_script_run_stats(+ self,+ organization_id: str,+ script_ids: list[str],+ ) -> dict[str, tuple[float | None, int]]:+ """Get success rate and total run count for each script_id.++ Both metrics are computed from the same population (workflow_scripts joined+ to workflow_runs), so they are always consistent.++ Returns a dict mapping script_id -> (success_rate, total_runs) where+ success_rate is 0.0-1.0 or None if no runs.+ """+ if not script_ids:+ return {}+ try:+ async with self.Session() as session:+ # Join workflow_scripts -> workflow_runs, group by script_id and status+ query = (+ select(+ WorkflowScriptModel.script_id,+ WorkflowRunModel.status,+ func.count(distinct(WorkflowRunModel.workflow_run_id)),+ )+ .join(+ WorkflowRunModel,+ WorkflowScriptModel.workflow_run_id == WorkflowRunModel.workflow_run_id,+ )+ .filter(+ WorkflowScriptModel.organization_id == organization_id,+ WorkflowScriptModel.script_id.in_(script_ids),+ WorkflowScriptModel.deleted_at.is_(None),+ WorkflowScriptModel.workflow_run_id.isnot(None),+ WorkflowRunModel.organization_id == organization_id,+ )+ .group_by(WorkflowScriptModel.script_id, WorkflowRunModel.status)+ )+ rows = (await session.execute(query)).all()++ # Aggregate per script_id+ totals: dict[str, int] = {}+ completed: dict[str, int] = {}+ for sid, status, count in rows:+ totals[sid] = totals.get(sid, 0) + count+ if status == "completed":+ completed[sid] = completed.get(sid, 0) + count++ return {+ sid: (+ (completed.get(sid, 0) / totals[sid]) if totals.get(sid) else None,+ totals.get(sid, 0),+ )+ for sid in script_ids+ }+ except SQLAlchemyError:+ LOG.error("SQLAlchemyError", exc_info=True)+ raise+ except Exception:+ LOG.error("UnexpectedError", exc_info=True)+ raise+# ── Script Pinning ─────────────────────────────────────────────────async def is_script_pinned(diff --git a/skyvern/forge/sdk/db/models.py b/skyvern/forge/sdk/db/models.pyindex 1756bc62f..b7f129193 100644--- a/skyvern/forge/sdk/db/models.py+++ b/skyvern/forge/sdk/db/models.py@@ -1079,6 +1079,7 @@ class WorkflowScriptModel(Base):Index("idx_workflow_scripts_wpid_cache_key_value", "workflow_permanent_id", "cache_key_value", "workflow_run_id"),+ Index("idx_workflow_scripts_org_script_id", "organization_id", "script_id"),)workflow_script_id = Column(String, primary_key=True, default=generate_workflow_script_id)diff --git a/skyvern/forge/sdk/forge_log.py b/skyvern/forge/sdk/forge_log.pyindex 5c8e18193..93cc044a8 100644--- a/skyvern/forge/sdk/forge_log.py+++ b/skyvern/forge/sdk/forge_log.py@@ -370,7 +370,6 @@ def setup_logger() -> None:structlog.stdlib.add_logger_name,structlog.stdlib.ProcessorFormatter.remove_processors_meta,structlog.processors.TimeStamper(fmt="iso"),- structlog.processors.format_exc_info,renderer,])diff --git a/skyvern/forge/sdk/routes/scripts.py b/skyvern/forge/sdk/routes/scripts.pyindex 80dc86e37..6441eaf3e 100644--- a/skyvern/forge/sdk/routes/scripts.py+++ b/skyvern/forge/sdk/routes/scripts.py@@ -1,10 +1,14 @@import asyncioimport base64import hashlib+from typing import TYPE_CHECKINGimport structlogfrom fastapi import BackgroundTasks, Depends, HTTPException, Path, Query, Request+if TYPE_CHECKING:+ from skyvern.forge.sdk.db.models import WorkflowScriptModel+from skyvern.config import settingsfrom skyvern.forge import appfrom skyvern.forge.sdk.executor.factory import AsyncExecutorFactory@@ -26,6 +30,8 @@ from skyvern.schemas.scripts import (ScriptBlocksResponse,ScriptCacheKeyValuesResponse,ScriptFallbackEpisode,+ ScriptRunsResponse,+ ScriptRunSummary,ScriptStatus,ScriptVersionCompareResponse,ScriptVersionDetailResponse,@@ -858,40 +864,55 @@ async def list_workflow_scripts(workflow_scripts = await app.DATABASE.get_workflow_scripts_by_permanent_id(organization_id=organization_id,workflow_permanent_id=workflow_permanent_id,+ statuses=[ScriptStatus.published],)if not workflow_scripts:return WorkflowScriptsListResponse(scripts=[])- script_ids = list({ws.script_id for ws in workflow_scripts})- version_stats = await app.DATABASE.get_script_version_stats(- organization_id=organization_id,- script_ids=script_ids,+ # Group by cache_key_value -- one row per variant.+ # Multiple runs can reference the same script; collapse them.+ by_cache_key: dict[str, list[WorkflowScriptModel]] = {}+ for ws in workflow_scripts:+ by_cache_key.setdefault(ws.cache_key_value, []).append(ws)++ # Pick the most recent script per cache_key_value.+ # Relies on get_workflow_scripts_by_permanent_id() ORDER BY modified_at DESC.+ representatives: list[WorkflowScriptModel] = []+ for _ckv, group in by_cache_key.items():+ representatives.append(group[0])++ if not representatives:+ return WorkflowScriptsListResponse(scripts=[])++ # Batch queries for version stats and run stats (success_rate + total_runs+ # computed from the same DB population for consistency).+ # These are independent -- run in parallel.+ rep_script_ids = [ws.script_id for ws in representatives]+ version_stats, run_stats = await asyncio.gather(+ app.DATABASE.get_script_version_stats(+ organization_id=organization_id,+ script_ids=rep_script_ids,+ ),+ app.DATABASE.get_script_run_stats(+ organization_id=organization_id,+ script_ids=rep_script_ids,+ ),)summaries = []- for ws in workflow_scripts:+ for ws in representatives:latest_version, version_count = version_stats.get(ws.script_id, (0, 0))- # Skip scripts with no live versions (all soft-deleted)if version_count == 0:continue- status = ScriptStatus.published- if ws.status:- try:- status = ScriptStatus(ws.status)- except ValueError:- LOG.warning(- "Unknown script status, defaulting to published",- status=ws.status,- script_id=ws.script_id,- organization_id=organization_id,- )- else:- LOG.warning(- "WorkflowScript has null status, defaulting to published",- script_id=ws.script_id,- organization_id=organization_id,- )++ try:+ status = ScriptStatus(ws.status) if ws.status else ScriptStatus.published+ except ValueError:+ status = ScriptStatus.published++ success_rate, total_runs = run_stats.get(ws.script_id, (None, 0))+summaries.append(WorkflowScriptSummary(script_id=ws.script_id,@@ -900,15 +921,63 @@ async def list_workflow_scripts(status=status,latest_version=latest_version,version_count=version_count,+ total_runs=total_runs,+ success_rate=success_rate,+ is_pinned=bool(ws.is_pinned),created_at=ws.created_at,modified_at=ws.modified_at,))- # Results are already sorted by modified_at DESC from the DB query+ # Sort: published first, then by modified_at DESC+ summaries.sort(key=lambda s: (s.status != ScriptStatus.published, -s.modified_at.timestamp()))return WorkflowScriptsListResponse(scripts=summaries)+@base_router.get(+ "/scripts/{script_id}/runs",+ include_in_schema=False,+)+@base_router.get(+ "/scripts/{script_id}/runs/",+ include_in_schema=False,+)+async def get_script_runs(+ script_id: str = Path(..., description="The script ID"),+ page_size: int = Query(50, ge=1, le=100),+ current_org: Organization = Depends(org_auth_service.get_current_org),+) -> ScriptRunsResponse:+ """Get workflow runs associated with a specific script, with status counts."""+ organization_id = current_org.organization_id++ # Verify script exists+ script = await app.DATABASE.get_script(script_id=script_id, organization_id=organization_id)+ if not script:+ raise HTTPException(status_code=404, detail="Script not found")++ runs, total_count, status_counts = await app.DATABASE.get_workflow_runs_for_script(+ organization_id=organization_id,+ script_id=script_id,+ page_size=page_size,+ )++ return ScriptRunsResponse(+ runs=[+ ScriptRunSummary(+ workflow_run_id=r.workflow_run_id,+ status=r.status or "unknown",+ started_at=r.started_at,+ finished_at=r.finished_at,+ created_at=r.created_at,+ failure_reason=r.failure_reason,+ )+ for r in runs+ ],+ total_count=total_count,+ status_counts=status_counts,+ )++@base_router.delete("/scripts/{workflow_permanent_id}/value",include_in_schema=False,diff --git a/skyvern/forge/sdk/schemas/persistent_browser_sessions.py b/skyvern/forge/sdk/schemas/persistent_browser_sessions.pyindex fc9123402..1ed6bf831 100644--- a/skyvern/forge/sdk/schemas/persistent_browser_sessions.py+++ b/skyvern/forge/sdk/schemas/persistent_browser_sessions.py@@ -30,6 +30,7 @@ def is_final_status(status: str | None) -> bool:class PersistentBrowserType(StrEnum):MSEdge = "msedge"Chrome = "chrome"+ CloakBrowser = "cloakbrowser"class Extensions(StrEnum):diff --git a/skyvern/forge/sdk/workflow/exceptions.py b/skyvern/forge/sdk/workflow/exceptions.pyindex 8fbd18e08..562c60acb 100644--- a/skyvern/forge/sdk/workflow/exceptions.py+++ b/skyvern/forge/sdk/workflow/exceptions.py@@ -63,14 +63,13 @@ class WorkflowVersionConflict(BaseWorkflowHTTPException):class OutputParameterKeyCollisionError(BaseWorkflowHTTPException):- def __init__(self, key: str, retry_count: int | None = None) -> None:- message = f"Output parameter key {key} already exists in the context manager."- if retry_count is not None:- message += f" Retrying {retry_count} more times."- elif retry_count == 0:- message += " Max duplicate retries reached, aborting."+ def __init__(self, key: str) -> None:+ # Extract the block label from the output parameter key (e.g. "block_1_output" -> "block_1")+ block_label = key.removesuffix("_output")super().__init__(- message,+ f"Duplicate block label detected: '{block_label}' (output parameter key '{key}' already exists). "+ f"Each block must have a unique label across all nesting levels, including blocks inside loops. "+ f"Please rename one of the blocks with label '{block_label}' to a unique name.",status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,)diff --git a/skyvern/forge/sdk/workflow/models/block.py b/skyvern/forge/sdk/workflow/models/block.pyindex 7bbf3fc08..d2a34b7ae 100644--- a/skyvern/forge/sdk/workflow/models/block.py+++ b/skyvern/forge/sdk/workflow/models/block.py@@ -2407,12 +2407,32 @@ class TextPromptBlock(Block):) -> list[PARAMETER_TYPE]:return self.parameters+ def _render_schema_templates(self, obj: Any, workflow_run_context: WorkflowRunContext) -> Any:+ if isinstance(obj, str):+ try:+ return self.format_block_parameter_template_from_workflow_run_context(obj, workflow_run_context)+ except Exception:+ LOG.warning(+ "Failed to render Jinja template in json_schema value, using original value",+ value=obj,+ block_label=self.label,+ exc_info=True,+ )+ return obj+ elif isinstance(obj, dict):+ return {k: self._render_schema_templates(v, workflow_run_context) for k, v in obj.items()}+ elif isinstance(obj, list):+ return [self._render_schema_templates(item, workflow_run_context) for item in obj]+ return obj+def format_potential_template_parameters(self, workflow_run_context: WorkflowRunContext) -> None:if self.llm_key:self.llm_key = self.format_block_parameter_template_from_workflow_run_context(self.llm_key, workflow_run_context)self.prompt = self.format_block_parameter_template_from_workflow_run_context(self.prompt, workflow_run_context)+ if self.json_schema:+ self.json_schema = self._render_schema_templates(self.json_schema, workflow_run_context)async def send_prompt(self,diff --git a/skyvern/forge/sdk/workflow/models/workflow.py b/skyvern/forge/sdk/workflow/models/workflow.pyindex 29bc3c06c..343a5c67f 100644--- a/skyvern/forge/sdk/workflow/models/workflow.py+++ b/skyvern/forge/sdk/workflow/models/workflow.py@@ -12,7 +12,7 @@ from skyvern.forge.sdk.workflow.exceptions import (NonTerminalFinallyBlock,WorkflowDefinitionHasDuplicateBlockLabels,)-from skyvern.forge.sdk.workflow.models.block import BlockTypeVar+from skyvern.forge.sdk.workflow.models.block import BlockTypeVar, ForLoopBlock, get_all_blocksfrom skyvern.forge.sdk.workflow.models.parameter import PARAMETER_TYPE, OutputParameterfrom skyvern.schemas.runs import ProxyLocationInput, ScriptRunResponsefrom skyvern.schemas.workflows import WorkflowStatus@@ -55,20 +55,28 @@ class WorkflowDefinition(BaseModel):finally_block_label: str | None = Nonedef validate(self) -> None:- labels: set[str] = set()+ all_labels: set[str] = set()duplicate_labels: set[str] = set()- for block in self.blocks:- if block.label in labels:- duplicate_labels.add(block.label)- else:- labels.add(block.label)++ def _collect_labels(blocks: list[BlockTypeVar]) -> None:+ for block in blocks:+ if block.label in all_labels:+ duplicate_labels.add(block.label)+ else:+ all_labels.add(block.label)+ if isinstance(block, ForLoopBlock) and block.loop_blocks:+ _collect_labels(block.loop_blocks)++ _collect_labels(self.blocks)if duplicate_labels:raise WorkflowDefinitionHasDuplicateBlockLabels(duplicate_labels)if self.finally_block_label:- if self.finally_block_label not in labels:- raise InvalidFinallyBlockLabel(self.finally_block_label, list(labels))+ # finally_block_label must reference a top-level block+ top_level_labels = {block.label for block in self.blocks}+ if self.finally_block_label not in top_level_labels:+ raise InvalidFinallyBlockLabel(self.finally_block_label, list(top_level_labels))for block in self.blocks:if block.label == self.finally_block_label and block.next_block_label is not None:raise NonTerminalFinallyBlock(self.finally_block_label)@@ -108,7 +116,7 @@ class Workflow(BaseModel):deleted_at: datetime | None = Nonedef get_output_parameter(self, label: str) -> OutputParameter | None:- for block in self.workflow_definition.blocks:+ for block in get_all_blocks(self.workflow_definition.blocks):if block.label == label:return block.output_parameterreturn Nonediff --git a/skyvern/forge/sdk/workflow/service.py b/skyvern/forge/sdk/workflow/service.pyindex 90a740517..89f979833 100644--- a/skyvern/forge/sdk/workflow/service.py+++ b/skyvern/forge/sdk/workflow/service.py@@ -4516,7 +4516,7 @@ class WorkflowService:returnasync def _regenerate_script() -> None:- """Delete old script and generate new one.+ """Create a new version of the existing script, preserving version history.Uses double-check pattern: re-verify regeneration is needed after acquiring lockto handle race conditions where another process regenerated while we waited.@@ -4529,38 +4529,44 @@ class WorkflowService:statuses=[ScriptStatus.published],use_cache=False,)- if fresh_script and fresh_script.script_id != existing_script.script_id:+ if fresh_script and fresh_script.script_revision_id != existing_script.script_revision_id:LOG.info("Script already regenerated by another process, skipping",workflow_id=workflow.workflow_id,workflow_run_id=workflow_run.workflow_run_id,cache_key_value=rendered_cache_key_value,- existing_script_id=existing_script.script_id,- fresh_script_id=fresh_script.script_id,+ existing_revision=existing_script.script_revision_id,+ fresh_revision=fresh_script.script_revision_id,)return+ # Get the latest version number so we can increment it+ version_stats = await app.DATABASE.get_script_version_stats(+ organization_id=workflow.organization_id,+ script_ids=[existing_script.script_id],+ )+ latest_version, _ = version_stats.get(existing_script.script_id, (0, 0))+ next_version = latest_version + 1+LOG.info(- "deleting old workflow script and generating new script",+ "Regenerating script as new version (preserving history)",workflow_id=workflow.workflow_id,workflow_run_id=workflow_run.workflow_run_id,cache_key_value=rendered_cache_key_value,script_id=existing_script.script_id,- script_revision_id=existing_script.script_revision_id,+ old_version=latest_version,+ new_version=next_version,run_with=workflow_run.run_with,blocks_to_update=list(blocks_to_update),code_gen=code_gen,)- await app.DATABASE.delete_workflow_scripts_by_permanent_id(- organization_id=workflow.organization_id,- workflow_permanent_id=workflow.workflow_permanent_id,- script_ids=[existing_script.script_id],- )-+ # Create a new version of the SAME script_id instead of a new scriptregenerated_script = await app.DATABASE.create_script(organization_id=workflow.organization_id,run_id=workflow_run.workflow_run_id,+ script_id=existing_script.script_id,+ version=next_version,)await workflow_script_service.generate_workflow_script(@@ -4571,6 +4577,25 @@ class WorkflowService:cached_script=existing_script,updated_block_labels=blocks_to_update,)++ # If generation failed (e.g. syntax error), clean up the empty script row+ # to avoid orphaned versions that skip version numbers on next regeneration.+ script_files = await app.DATABASE.get_script_files(+ script_revision_id=regenerated_script.script_revision_id,+ organization_id=workflow.organization_id,+ )+ if not script_files:+ LOG.warning(+ "Script generation produced no files, soft-deleting empty version",+ script_id=regenerated_script.script_id,+ version=regenerated_script.version,+ )+ await app.DATABASE.soft_delete_script_by_revision(+ script_revision_id=regenerated_script.script_revision_id,+ organization_id=workflow.organization_id,+ )+ return+aio_task_primary_key = f"{regenerated_script.script_id}_{regenerated_script.version}"if aio_task_primary_key in app.ARTIFACT_MANAGER.upload_aiotasks_map:aio_tasks = app.ARTIFACT_MANAGER.upload_aiotasks_map[aio_task_primary_key]@@ -4986,19 +5011,15 @@ class WorkflowService:) -> bool:"""Determine whether this run should attempt to execute cached scripts.- When neither the run nor the workflow explicitly sets run_with, fall back- to the workflow's adaptive_caching flag. This allows workflows with- adaptive_caching=True to default into code-v2 mode without requiring- every API call to pass run_with explicitly.+ Priority: run-level run_with > workflow-level run_with > default (agent).+ The adaptive_caching flag does NOT independently force code mode — it only+ controls whether a code run uses v1 or v2 (see is_adaptive_caching())."""if workflow_run.run_with in ("code", "code_v2"):return Trueif workflow_run.run_with == "agent":return False- if workflow.run_with == "code":- return True- if workflow.run_with == "agent":- return False- if workflow.adaptive_caching:+ if workflow.run_with in ("code", "code_v2"):return True+ # workflow.run_with is "agent" or null — default to agentreturn Falsediff --git a/skyvern/forge/sdk/workflow/workflow_definition_converter.py b/skyvern/forge/sdk/workflow/workflow_definition_converter.pyindex ec03e25e4..5ea111cba 100644--- a/skyvern/forge/sdk/workflow/workflow_definition_converter.py+++ b/skyvern/forge/sdk/workflow/workflow_definition_converter.py@@ -21,6 +21,7 @@ from skyvern.forge.sdk.workflow.exceptions import (ContextParameterSourceNotDefined,InvalidWaitBlockTime,InvalidWorkflowDefinition,+ WorkflowDefinitionHasDuplicateBlockLabels,WorkflowDefinitionHasDuplicateParameterKeys,WorkflowDefinitionHasReservedParameterKeys,WorkflowDefinitionHasUndefinedParameters,@@ -98,10 +99,17 @@ def convert_workflow_definition(if any(parameter.parameter_type == ParameterType.OUTPUT for parameter in workflow_definition_yaml.parameters):raise InvalidWorkflowDefinition(message="Cannot manually create output parameters")+ # Collect all block labels recursively (including nested loop blocks) and check for duplicates+ all_block_labels = _collect_all_block_labels(workflow_definition_yaml.blocks)+ label_counts: dict[str, int] = {}+ for label in all_block_labels:+ label_counts[label] = label_counts.get(label, 0) + 1+ duplicate_labels = {label for label, count in label_counts.items() if count > 1}+ if duplicate_labels:+ raise WorkflowDefinitionHasDuplicateBlockLabels(duplicate_labels)+# Check if any parameter keys collide with automatically created output parameter keys- block_labels = [block.label for block in workflow_definition_yaml.blocks]- # TODO (kerem): Check if block labels are unique- output_parameter_keys = [f"{block_label}_output" for block_label in block_labels]+ output_parameter_keys = [f"{label}_output" for label in all_block_labels]parameter_keys = [parameter.key for parameter in workflow_definition_yaml.parameters]if any(key in output_parameter_keys for key in parameter_keys):raise WorkflowDefinitionHasReservedParameterKeys(@@ -325,6 +333,16 @@ def convert_workflow_definition(return workflow_definition+def _collect_all_block_labels(block_yamls: list[BLOCK_YAML_TYPES]) -> list[str]:+ """Recursively collect all block labels including those inside for-loop blocks."""+ labels = []+ for block_yaml in block_yamls:+ labels.append(block_yaml.label)+ if isinstance(block_yaml, ForLoopBlockYAML) and block_yaml.loop_blocks:+ labels.extend(_collect_all_block_labels(block_yaml.loop_blocks))+ return labels++def _create_all_output_parameters_for_workflow(workflow_id: str, block_yamls: list[BLOCK_YAML_TYPES]) -> dict[str, OutputParameter]:diff --git a/skyvern/schemas/scripts.py b/skyvern/schemas/scripts.pyindex 64c21c857..aa1fd35aa 100644--- a/skyvern/schemas/scripts.py+++ b/skyvern/schemas/scripts.py@@ -227,6 +227,9 @@ class WorkflowScriptSummary(BaseModel):status: ScriptStatuslatest_version: intversion_count: int+ total_runs: int = 0+ success_rate: float | None = None+ is_pinned: bool = Falsecreated_at: datetimemodified_at: datetime@@ -237,6 +240,25 @@ class WorkflowScriptsListResponse(BaseModel):scripts: list[WorkflowScriptSummary]+class ScriptRunSummary(BaseModel):+ """Summary of a workflow run that used a specific script."""++ workflow_run_id: str+ status: str+ started_at: datetime | None = None+ finished_at: datetime | None = None+ created_at: datetime+ failure_reason: str | None = None+++class ScriptRunsResponse(BaseModel):+ """Response for listing runs associated with a script."""++ runs: list[ScriptRunSummary]+ total_count: int+ status_counts: dict[str, int] = Field(default_factory=dict)++class ClearCacheResponse(BaseModel):"""Response model for cache clearing operations."""diff --git a/skyvern/services/script_reviewer.py b/skyvern/services/script_reviewer.pyindex 6e02fda43..8621c0571 100644--- a/skyvern/services/script_reviewer.py+++ b/skyvern/services/script_reviewer.py@@ -727,6 +727,21 @@ class ScriptReviewer:current_prompt = self._build_retry_prompt(updated_code, param_error, function_signature)continue+ # Validate parameter references are preserved from existing code.+ # Unlike _validate_structural_regression, this is NOT skipped when user_instructions+ # is set — dropping parameter refs is never intentional and always causes runtime failures.+ preservation_error = self._validate_parameter_preservation(updated_code, existing_code, parameter_keys)+ if preservation_error is not None:+ LOG.warning(+ "ScriptReviewer: parameter preservation regression, retrying",+ block_label=block_label,+ attempt=attempt,+ error=preservation_error,+ )+ if attempt < max_attempts:+ current_prompt = self._build_retry_prompt(updated_code, preservation_error, function_signature)+ continue+# Validate structural regression (catch deleted branches, shrunk code).# Skip when user provides explicit instructions — they may request deletions.regression_error = (@@ -1388,6 +1403,16 @@ class ScriptReviewer:# Regex to find context.parameters['key'] or context.parameters["key"]_PARAM_REF_RE = re.compile(r"""context\.parameters\[['"](\w+)['"]\]""")+ def _find_param_refs_excluding_comments(self, code: str) -> list[str]:+ """Extract parameter reference keys from code, skipping comment lines."""+ refs: list[str] = []+ for line in code.split("\n"):+ if line.lstrip().startswith("#"):+ continue+ for match in self._PARAM_REF_RE.finditer(line):+ refs.append(match.group(1))+ return refs+def _validate_parameter_references(self, code: str, parameter_keys: list[str]) -> str | None:"""Validate that context.parameters['key'] references use known parameter keys.@@ -1420,6 +1445,36 @@ class ScriptReviewer:f"instead of context.parameters['invented_name'].")+ def _validate_parameter_preservation(+ self, new_code: str, existing_code: str | None, parameter_keys: list[str]+ ) -> str | None:+ """Ensure parameter references from existing code are preserved in updated code.++ Catches the case where the LLM drops value=context.parameters['key'] references+ when rewriting block code (e.g., adding classify branches), replacing them with+ ai='proactive' fill() calls that have no value and silently become no-ops.+ """+ if not existing_code or not parameter_keys:+ return None++ old_params = set(self._find_param_refs_excluding_comments(existing_code))+ new_params = set(self._find_param_refs_excluding_comments(new_code))++ # Only flag parameters that are in the valid keys list (ignore spurious refs)+ valid_old = old_params & set(parameter_keys)+ dropped = valid_old - new_params++ if not dropped:+ return None++ return (+ f"Parameter references dropped: {', '.join(f'context.parameters[{k!r}]' for k in sorted(dropped))}. "+ f"The existing code referenced these workflow parameters but the updated code does not. "+ f"Every page.fill() or page.fill_autocomplete() for a field that maps to a workflow parameter "+ f"MUST include value=context.parameters['key']. Do NOT replace with ai='proactive' — "+ f"parameter values from context.parameters are deterministic; AI-generated values are not."+ )+def _validate_structural_regression(self, new_code: str, existing_code: str | None) -> str | None:"""Compare new code against existing code to catch regressions.diff --git a/skyvern/services/workflow_script_service.py b/skyvern/services/workflow_script_service.pyindex 231fed129..42d18550a 100644--- a/skyvern/services/workflow_script_service.py+++ b/skyvern/services/workflow_script_service.py@@ -434,6 +434,21 @@ async def generate_workflow_script(# 3.5) Post-process: fix static actions inside for-loop blockspython_src = _fix_static_actions_in_for_loops(python_src)+ # 3.6) Validate generated Python is syntactically valid before persisting.+ # A corrupted script will fail to load on the next run, causing the caching+ # system to regenerate from scratch and lose version history.+ try:+ compile(python_src, "<generated_script>", "exec")+ except SyntaxError as e:+ LOG.error(+ "Generated script has syntax error, skipping persist",+ script_id=script.script_id,+ version=script.version,+ error=str(e),+ lineno=e.lineno,+ )+ return+# 4) Persist script and files, then record mappingcontent_bytes = python_src.encode("utf-8")content_b64 = base64.b64encode(content_bytes).decode("utf-8")diff --git a/skyvern/webeye/actions/handler.py b/skyvern/webeye/actions/handler.pyindex 83b6fc4b1..acbd1ca38 100644--- a/skyvern/webeye/actions/handler.py+++ b/skyvern/webeye/actions/handler.py@@ -2130,9 +2130,18 @@ async def handle_terminate_action(step: Step,) -> list[ActionResult]:if task.error_code_mapping:- action.errors = await extract_user_defined_errors(- task=task, step=step, scraped_page=scraped_page, reasoning=action.reasoning- )+ try:+ action.errors = await extract_user_defined_errors(+ task=task, step=step, scraped_page=scraped_page, reasoning=action.reasoning+ )+ except Exception:+ LOG.warning(+ "extract_user_defined_errors failed, using errors from action reasoning",+ task_id=task.task_id,+ step_id=step.step_id,+ action_errors=action.errors,+ exc_info=True,+ )return [ActionSuccess()]diff --git a/skyvern/webeye/scraper/scraper.py b/skyvern/webeye/scraper/scraper.pyindex 854a90be5..5fc2c8683 100644--- a/skyvern/webeye/scraper/scraper.py+++ b/skyvern/webeye/scraper/scraper.py@@ -263,6 +263,12 @@ async def get_frame_text(iframe: Frame) -> str:return text+def _should_use_page_ready_wait() -> bool:+ """Check if the enhanced page-ready wait is enabled via context (set by agent before scraping)."""+ context = skyvern_context.current()+ return bool(context and context.enable_page_ready_wait)++async def scrape_web_unsafe(browser_state: BrowserState,url: str,@@ -310,7 +316,15 @@ async def scrape_web_unsafe()skyvern_frame = await SkyvernFrame.create_instance(page)- await skyvern_frame.safe_wait_for_animation_end()+ if _should_use_page_ready_wait():+ await skyvern_frame.wait_for_page_ready(+ network_idle_timeout_ms=settings.PAGE_READY_NETWORK_IDLE_TIMEOUT_MS,+ loading_indicator_timeout_ms=settings.PAGE_READY_LOADING_INDICATOR_TIMEOUT_MS,+ dom_stable_ms=settings.PAGE_READY_DOM_STABLE_MS,+ dom_stability_timeout_ms=settings.PAGE_READY_DOM_STABILITY_TIMEOUT_MS,+ )+ else:+ await skyvern_frame.safe_wait_for_animation_end()if wait_seconds > 0:LOG.info(f"Waiting for {wait_seconds} seconds before scraping the website.", wait_seconds=wait_seconds)@@ -458,7 +472,15 @@ async def add_frame_interactable_elements(try:skyvern_frame = await SkyvernFrame.create_instance(frame)- await skyvern_frame.safe_wait_for_animation_end()+ if _should_use_page_ready_wait():+ await skyvern_frame.wait_for_page_ready(+ network_idle_timeout_ms=settings.PAGE_READY_NETWORK_IDLE_TIMEOUT_MS,+ loading_indicator_timeout_ms=settings.PAGE_READY_LOADING_INDICATOR_TIMEOUT_MS,+ dom_stable_ms=settings.PAGE_READY_DOM_STABLE_MS,+ dom_stability_timeout_ms=settings.PAGE_READY_DOM_STABILITY_TIMEOUT_MS,+ )+ else:+ await skyvern_frame.safe_wait_for_animation_end()frame_elements, frame_element_tree = await skyvern_frame.build_tree_from_body(frame_name=skyvern_id, frame_index=frame_index, must_included_tags=must_included_tagsdiff --git a/tests/unit/test_handle_terminate_action.py b/tests/unit/test_handle_terminate_action.pynew file mode 100644index 000000000..520257e52--- /dev/null+++ b/tests/unit/test_handle_terminate_action.py@@ -0,0 +1,104 @@+"""Tests for handle_terminate_action error handling.++Verifies that when extract_user_defined_errors fails (e.g., CDP disconnection),+the original error codes from the action reasoning are preserved instead of being lost.+"""++from unittest.mock import AsyncMock, MagicMock, patch++import pytest++from skyvern.errors.errors import UserDefinedError+from skyvern.webeye.actions.actions import TerminateAction+from skyvern.webeye.actions.handler import handle_terminate_action+from skyvern.webeye.actions.responses import ActionSuccess+++def _make_task(error_code_mapping: dict | None = None) -> MagicMock:+ task = MagicMock()+ task.task_id = "tsk_test"+ task.error_code_mapping = error_code_mapping+ return task+++def _make_step() -> MagicMock:+ step = MagicMock()+ step.step_id = "stp_test"+ return step+++async def test_terminate_preserves_errors_when_extract_fails() -> None:+ """When extract_user_defined_errors raises, action.errors from LLM reasoning should be preserved."""+ task = _make_task(error_code_mapping={"OTP_TIMEOUT": "OTP verification code not received"})+ step = _make_step()+ page = MagicMock()+ scraped_page = MagicMock()++ original_errors = [UserDefinedError(error_code="OTP_TIMEOUT", reasoning="No TOTP found", confidence_float=0.95)]+ action = TerminateAction(reasoning="No TOTP verification code found", errors=original_errors)++ with patch(+ "skyvern.webeye.actions.handler.extract_user_defined_errors",+ new_callable=AsyncMock,+ side_effect=RuntimeError("Target page, context or browser has been closed"),+ ):+ results = await handle_terminate_action(+ action=action, page=page, scraped_page=scraped_page, task=task, step=step+ )++ assert len(results) == 1+ assert isinstance(results[0], ActionSuccess)+ # The original errors from LLM reasoning must be preserved+ assert len(action.errors) == 1+ assert action.errors[0].error_code == "OTP_TIMEOUT"+++async def test_terminate_uses_extracted_errors_on_success() -> None:+ """When extract_user_defined_errors succeeds, its result should replace action.errors."""+ task = _make_task(error_code_mapping={"OTP_TIMEOUT": "OTP verification code not received"})+ step = _make_step()+ page = MagicMock()+ scraped_page = MagicMock()++ action = TerminateAction(reasoning="No TOTP verification code found")++ extracted_errors = [+ UserDefinedError(error_code="OTP_TIMEOUT", reasoning="Page shows OTP not received", confidence_float=0.99)+ ]+ with patch(+ "skyvern.webeye.actions.handler.extract_user_defined_errors",+ new_callable=AsyncMock,+ return_value=extracted_errors,+ ):+ results = await handle_terminate_action(+ action=action, page=page, scraped_page=scraped_page, task=task, step=step+ )++ assert len(results) == 1+ assert isinstance(results[0], ActionSuccess)+ assert action.errors == extracted_errors+++async def test_terminate_skips_extraction_without_error_code_mapping() -> None:+ """When task has no error_code_mapping, extract_user_defined_errors should not be called."""+ task = _make_task(error_code_mapping=None)+ step = _make_step()+ page = MagicMock()+ scraped_page = MagicMock()++ action = TerminateAction(reasoning="done")++ with patch(+ "skyvern.webeye.actions.handler.extract_user_defined_errors",+ new_callable=AsyncMock,+ ) as mock_extract:+ results = await handle_terminate_action(+ action=action, page=page, scraped_page=scraped_page, task=task, step=step+ )++ mock_extract.assert_not_called()+ assert len(results) == 1+ assert isinstance(results[0], ActionSuccess)diff --git a/tests/unit/test_nested_loop_output_parameters.py b/tests/unit/test_nested_loop_output_parameters.pynew file mode 100644index 000000000..d95a75dc1--- /dev/null+++ b/tests/unit/test_nested_loop_output_parameters.py@@ -0,0 +1,413 @@+"""Tests for nested loop output parameter collision fix (SKY-7375).++Ensures that:+1. Block labels are validated for uniqueness across ALL nesting levels (not just top-level)+2. WorkflowRunContext.init() gracefully handles duplicate output parameter keys+3. Nested loop workflows with unique labels pass validation correctly+"""++from datetime import UTC, datetime+from unittest.mock import MagicMock++import pytest++from skyvern.forge.sdk.schemas.organizations import Organization+from skyvern.forge.sdk.workflow.context_manager import WorkflowRunContext+from skyvern.forge.sdk.workflow.exceptions import (+ OutputParameterKeyCollisionError,+ WorkflowDefinitionHasDuplicateBlockLabels,+)+from skyvern.forge.sdk.workflow.models.block import ForLoopBlock, TaskBlock+from skyvern.forge.sdk.workflow.models.parameter import OutputParameter+from skyvern.forge.sdk.workflow.models.workflow import Workflow, WorkflowDefinition+from skyvern.forge.sdk.workflow.workflow_definition_converter import (+ _collect_all_block_labels,+ _create_all_output_parameters_for_workflow,+ convert_workflow_definition,+)+from skyvern.schemas.workflows import (+ ForLoopBlockYAML,+ TaskBlockYAML,+ WorkflowDefinitionYAML,+)+++class TestCollectAllBlockLabels:+ """Tests for _collect_all_block_labels helper function."""++ def test_flat_blocks(self) -> None:+ """Test collecting labels from flat (non-nested) blocks."""+ blocks = [+ TaskBlockYAML(label="block_1", url="https://example.com"),+ TaskBlockYAML(label="block_2", url="https://example.com"),+ ]+ labels = _collect_all_block_labels(blocks)+ assert labels == ["block_1", "block_2"]++ def test_nested_loop_blocks(self) -> None:+ """Test collecting labels from blocks nested inside a loop."""+ blocks = [+ ForLoopBlockYAML(+ label="outer_loop",+ loop_blocks=[+ TaskBlockYAML(label="inner_task", url="https://example.com"),+ ],+ ),+ ]+ labels = _collect_all_block_labels(blocks)+ assert labels == ["outer_loop", "inner_task"]++ def test_deeply_nested_loop_blocks(self) -> None:+ """Test collecting labels from deeply nested loops (loop inside loop)."""+ blocks = [+ ForLoopBlockYAML(+ label="outer_loop",+ loop_blocks=[+ ForLoopBlockYAML(+ label="inner_loop",+ loop_blocks=[+ TaskBlockYAML(label="deep_task", url="https://example.com"),+ ],+ ),+ ],+ ),+ ]+ labels = _collect_all_block_labels(blocks)+ assert labels == ["outer_loop", "inner_loop", "deep_task"]++ def test_mixed_flat_and_nested(self) -> None:+ """Test collecting labels from a mix of flat and nested blocks."""+ blocks = [+ TaskBlockYAML(label="top_task", url="https://example.com"),+ ForLoopBlockYAML(+ label="loop_1",+ loop_blocks=[+ TaskBlockYAML(label="loop_1_task", url="https://example.com"),+ ],+ ),+ TaskBlockYAML(label="bottom_task", url="https://example.com"),+ ]+ labels = _collect_all_block_labels(blocks)+ assert labels == ["top_task", "loop_1", "loop_1_task", "bottom_task"]++ def test_detects_duplicate_across_nesting_levels(self) -> None:+ """Test that duplicate labels across nesting levels are collected (not deduplicated)."""+ blocks = [+ TaskBlockYAML(label="shared_label", url="https://example.com"),+ ForLoopBlockYAML(+ label="outer_loop",+ loop_blocks=[+ TaskBlockYAML(label="shared_label", url="https://example.com"),+ ],+ ),+ ]+ labels = _collect_all_block_labels(blocks)+ assert labels.count("shared_label") == 2+++class TestCreateAllOutputParametersForNestedLoops:+ """Tests for _create_all_output_parameters_for_workflow with nested loops."""++ def test_creates_parameters_for_nested_blocks(self) -> None:+ """Test that output parameters are created for all nested blocks."""+ blocks = [+ ForLoopBlockYAML(+ label="outer_loop",+ loop_blocks=[+ TaskBlockYAML(label="inner_task", url="https://example.com"),+ ],+ ),+ ]+ params = _create_all_output_parameters_for_workflow(+ workflow_id="test_wf",+ block_yamls=blocks,+ )+ assert "outer_loop" in params+ assert "inner_task" in params+ assert params["outer_loop"].key == "outer_loop_output"+ assert params["inner_task"].key == "inner_task_output"++ def test_creates_parameters_for_deeply_nested_blocks(self) -> None:+ """Test that output parameters are created for deeply nested loops."""+ blocks = [+ ForLoopBlockYAML(+ label="outer_loop",+ loop_blocks=[+ ForLoopBlockYAML(+ label="inner_loop",+ loop_blocks=[+ TaskBlockYAML(label="deep_task", url="https://example.com"),+ ],+ ),+ ],+ ),+ ]+ params = _create_all_output_parameters_for_workflow(+ workflow_id="test_wf",+ block_yamls=blocks,+ )+ assert len(params) == 3+ assert "outer_loop" in params+ assert "inner_loop" in params+ assert "deep_task" in params+++class TestConvertWorkflowDefinitionNestedLoopValidation:+ """Tests for convert_workflow_definition with nested loop duplicate label detection."""++ def test_rejects_duplicate_labels_across_nesting_levels(self) -> None:+ """Test that duplicate labels across nesting levels are rejected."""+ workflow_yaml = WorkflowDefinitionYAML(+ parameters=[],+ blocks=[+ TaskBlockYAML(label="task_a", url="https://example.com"),+ ForLoopBlockYAML(+ label="loop_1",+ loop_blocks=[+ TaskBlockYAML(label="task_a", url="https://example.com"),+ ],+ ),+ ],+ )+ with pytest.raises(WorkflowDefinitionHasDuplicateBlockLabels):+ convert_workflow_definition(workflow_yaml, workflow_id="test_wf")++ def test_rejects_duplicate_labels_within_nested_loops(self) -> None:+ """Test that duplicate labels within two different nested loops are rejected."""+ workflow_yaml = WorkflowDefinitionYAML(+ parameters=[],+ blocks=[+ ForLoopBlockYAML(+ label="loop_1",+ loop_blocks=[+ TaskBlockYAML(label="shared_task", url="https://example.com"),+ ],+ ),+ ForLoopBlockYAML(+ label="loop_2",+ loop_blocks=[+ TaskBlockYAML(label="shared_task", url="https://example.com"),+ ],+ ),+ ],+ )+ with pytest.raises(WorkflowDefinitionHasDuplicateBlockLabels):+ convert_workflow_definition(workflow_yaml, workflow_id="test_wf")++ def test_accepts_unique_labels_in_nested_loops(self) -> None:+ """Test that nested loops with unique labels pass validation."""+ workflow_yaml = WorkflowDefinitionYAML(+ parameters=[],+ blocks=[+ ForLoopBlockYAML(+ label="outer_loop",+ loop_variable_reference="outer_var",+ loop_blocks=[+ ForLoopBlockYAML(+ label="inner_loop",+ loop_variable_reference="inner_var",+ loop_blocks=[+ TaskBlockYAML(label="deep_task", url="https://example.com"),+ ],+ ),+ ],+ ),+ ],+ )+ result = convert_workflow_definition(workflow_yaml, workflow_id="test_wf")+ assert result is not None+ assert len(result.blocks) == 1+++class TestWorkflowDefinitionValidateNestedLabels:+ """Tests for WorkflowDefinition.validate() with nested labels."""++ def _make_output_param(self, label: str) -> OutputParameter:+ now = datetime.now(UTC)+ return OutputParameter(+ output_parameter_id=f"op_{label}",+ key=f"{label}_output",+ workflow_id="test_wf",+ created_at=now,+ modified_at=now,+ )++ def test_validate_catches_duplicate_nested_labels(self) -> None:+ """Test that validate() catches duplicate labels across nesting levels."""+ inner_task = TaskBlock(+ label="shared_label",+ output_parameter=self._make_output_param("shared_label_inner"),+ )+ outer_task = TaskBlock(+ label="shared_label",+ output_parameter=self._make_output_param("shared_label_outer"),+ )+ loop_block = ForLoopBlock(+ label="loop_1",+ output_parameter=self._make_output_param("loop_1"),+ loop_blocks=[inner_task],+ )+ definition = WorkflowDefinition(+ parameters=[],+ blocks=[outer_task, loop_block],+ )+ with pytest.raises(WorkflowDefinitionHasDuplicateBlockLabels):+ definition.validate()++ def test_validate_passes_with_unique_nested_labels(self) -> None:+ """Test that validate() passes with unique labels across all nesting levels."""+ inner_task = TaskBlock(+ label="inner_task",+ output_parameter=self._make_output_param("inner_task"),+ )+ outer_task = TaskBlock(+ label="outer_task",+ output_parameter=self._make_output_param("outer_task"),+ )+ loop_block = ForLoopBlock(+ label="loop_1",+ output_parameter=self._make_output_param("loop_1"),+ loop_blocks=[inner_task],+ )+ definition = WorkflowDefinition(+ parameters=[],+ blocks=[outer_task, loop_block],+ )+ definition.validate() # Should not raise+++class TestWorkflowGetOutputParameterNested:+ """Tests for Workflow.get_output_parameter() searching nested loop blocks (SKY-8397)."""++ def _make_output_param(self, label: str) -> OutputParameter:+ now = datetime.now(UTC)+ return OutputParameter(+ output_parameter_id=f"op_{label}",+ key=f"{label}_output",+ workflow_id="test_wf",+ created_at=now,+ modified_at=now,+ )++ def _make_workflow(self, blocks: list) -> Workflow:+ now = datetime.now(UTC)+ return Workflow(+ workflow_id="wf_test",+ organization_id="org_test",+ title="Test",+ workflow_permanent_id="wpid_test",+ version=1,+ is_saved_task=False,+ workflow_definition=WorkflowDefinition(parameters=[], blocks=blocks),+ created_at=now,+ modified_at=now,+ )++ def test_finds_top_level_block(self) -> None:+ task = TaskBlock(label="top_task", output_parameter=self._make_output_param("top_task"))+ workflow = self._make_workflow([task])+ assert workflow.get_output_parameter("top_task") is task.output_parameter++ def test_finds_block_inside_loop(self) -> None:+ inner_task = TaskBlock(label="inner_task", output_parameter=self._make_output_param("inner_task"))+ loop = ForLoopBlock(+ label="loop_1", output_parameter=self._make_output_param("loop_1"), loop_blocks=[inner_task]+ )+ workflow = self._make_workflow([loop])+ assert workflow.get_output_parameter("inner_task") is inner_task.output_parameter++ def test_finds_block_inside_nested_loop(self) -> None:+ deep_task = TaskBlock(label="deep_task", output_parameter=self._make_output_param("deep_task"))+ inner_loop = ForLoopBlock(+ label="inner_loop", output_parameter=self._make_output_param("inner_loop"), loop_blocks=[deep_task]+ )+ outer_loop = ForLoopBlock(+ label="outer_loop", output_parameter=self._make_output_param("outer_loop"), loop_blocks=[inner_loop]+ )+ workflow = self._make_workflow([outer_loop])+ assert workflow.get_output_parameter("deep_task") is deep_task.output_parameter++ def test_returns_none_for_nonexistent_label(self) -> None:+ task = TaskBlock(label="task_1", output_parameter=self._make_output_param("task_1"))+ workflow = self._make_workflow([task])+ assert workflow.get_output_parameter("nonexistent") is None+++class TestWorkflowRunContextDuplicateOutputParameters:+ """Tests for WorkflowRunContext.init() raising on duplicate output parameter keys with a clear error message."""++ def _make_output_param(self, label: str, param_id: str) -> OutputParameter:+ now = datetime.now(UTC)+ return OutputParameter(+ output_parameter_id=param_id,+ key=f"{label}_output",+ workflow_id="test_wf",+ created_at=now,+ modified_at=now,+ )++ @pytest.mark.asyncio+ async def test_duplicate_output_parameter_keys_raises_with_helpful_message(self) -> None:+ """Test that duplicate output parameter keys raise OutputParameterKeyCollisionError with a clear message."""+ now = datetime.now(UTC)+ org = Organization(+ organization_id="org_test",+ organization_name="Test Org",+ created_at=now,+ modified_at=now,+ )+ aws_client = MagicMock()++ # Two output parameters with the same key but different IDs (simulates duplicate DB rows)+ param_1 = self._make_output_param("block_1", "op_first")+ param_2 = self._make_output_param("block_1", "op_second")++ with pytest.raises(OutputParameterKeyCollisionError) as exc_info:+ await WorkflowRunContext.init(+ aws_client=aws_client,+ organization=org,+ workflow_run_id="wr_test",+ workflow_title="Test Workflow",+ workflow_id="wf_test",+ workflow_permanent_id="wpid_test",+ workflow_parameter_tuples=[],+ workflow_output_parameters=[param_1, param_2],+ context_parameters=[],+ secret_parameters=[],+ )++ error_msg = str(exc_info.value)+ assert "block_1" in error_msg+ assert "unique label" in error_msg+ assert "rename" in error_msg.lower()++ @pytest.mark.asyncio+ async def test_unique_output_parameter_keys_all_registered(self) -> None:+ """Test that unique output parameter keys are all registered normally."""+ now = datetime.now(UTC)+ org = Organization(+ organization_id="org_test",+ organization_name="Test Org",+ created_at=now,+ modified_at=now,+ )+ aws_client = MagicMock()++ param_1 = self._make_output_param("block_1", "op_1")+ param_2 = self._make_output_param("block_2", "op_2")++ context = await WorkflowRunContext.init(+ aws_client=aws_client,+ organization=org,+ workflow_run_id="wr_test",+ workflow_title="Test Workflow",+ workflow_id="wf_test",+ workflow_permanent_id="wpid_test",+ workflow_parameter_tuples=[],+ workflow_output_parameters=[param_1, param_2],+ context_parameters=[],+ secret_parameters=[],+ )++ assert "block_1_output" in context.parameters+ assert "block_2_output" in context.parametersdiff --git a/tests/unit/test_script_reviewer_validators.py b/tests/unit/test_script_reviewer_validators.pyindex 274bf043c..ed04215ad 100644--- a/tests/unit/test_script_reviewer_validators.py+++ b/tests/unit/test_script_reviewer_validators.py@@ -107,3 +107,83 @@ async def block_fn(page, context):# Even if "send_email" is technically a value somewhere, it's a block labelparams = {"account_number": "12345678"}assert self.reviewer._validate_no_hardcoded_values(code, params) is None+++class TestValidateParameterPreservation:+ """Tests for _validate_parameter_preservation."""++ def setup_method(self) -> None:+ self.reviewer = ScriptReviewer()++ def test_no_existing_code_returns_none(self) -> None:+ new_code = "await page.fill(selector='#email', ai='proactive', prompt='email')"+ assert self.reviewer._validate_parameter_preservation(new_code, None, ["email"]) is None++ def test_no_parameter_keys_returns_none(self) -> None:+ old_code = "await page.fill(selector='#email', value=context.parameters['email'])"+ new_code = "await page.fill(selector='#email', ai='proactive', prompt='email')"+ assert self.reviewer._validate_parameter_preservation(new_code, old_code, []) is None++ def test_preserved_refs_returns_none(self) -> None:+ """When all parameter refs are preserved, validation passes."""+ old_code = """+await page.fill(selector='#email', value=context.parameters['email'])+await page.fill(selector='#pass', value=context.parameters['password'])+"""+ new_code = """+choice = await page.classify(...)+if choice == 0:+ await page.fill(selector='#email', value=context.parameters['email'])+ await page.fill(selector='#pass', value=context.parameters['password'])+"""+ assert self.reviewer._validate_parameter_preservation(new_code, old_code, ["email", "password"]) is None++ def test_detects_dropped_refs(self) -> None:+ """When the LLM drops value= refs, validation catches it."""+ old_code = """+await page.fill(selector='#email', value=context.parameters['email'])+await page.fill(selector='#pass', value=context.parameters['password'])+"""+ new_code = """+choice = await page.classify(...)+if choice == 0:+ await page.fill(selector='#email', ai='proactive', prompt='fill email')+ await page.fill(selector='#pass', ai='proactive', prompt='fill password')+"""+ error = self.reviewer._validate_parameter_preservation(new_code, old_code, ["email", "password"])+ assert error is not None+ assert "email" in error+ assert "password" in error+ assert "dropped" in error.lower()++ def test_ignores_refs_not_in_parameter_keys(self) -> None:+ """Spurious refs in old code that aren't valid keys should be ignored."""+ old_code = "await page.fill(selector='#x', value=context.parameters['invented_key'])"+ new_code = "await page.fill(selector='#x', ai='proactive', prompt='fill x')"+ assert self.reviewer._validate_parameter_preservation(new_code, old_code, ["email", "password"]) is None++ def test_partial_drop_detected(self) -> None:+ """Dropping one ref while keeping another should flag only the dropped one."""+ old_code = """+await page.fill(selector='#email', value=context.parameters['email'])+await page.fill(selector='#pass', value=context.parameters['password'])+"""+ new_code = """+await page.fill(selector='#email', value=context.parameters['email'])+await page.fill(selector='#pass', ai='proactive', prompt='fill password')+"""+ error = self.reviewer._validate_parameter_preservation(new_code, old_code, ["email", "password"])+ assert error is not None+ assert "context.parameters['password']" in error+ assert "context.parameters['email']" not in error++ def test_commented_ref_in_new_code_counts_as_dropped(self) -> None:+ """A parameter ref only in a comment in new code should be flagged as dropped."""+ old_code = "await page.fill(selector='#email', value=context.parameters['email'])"+ new_code = """+# was: context.parameters['email']+await page.fill(selector='#email', ai='proactive', prompt='fill email')+"""+ error = self.reviewer._validate_parameter_preservation(new_code, old_code, ["email"])+ assert error is not None+ assert "email" in errordiff --git a/tests/unit/test_script_skyvern_page.py b/tests/unit/test_script_skyvern_page.pyindex b3f5ea2fa..27e5b1f3b 100644--- a/tests/unit/test_script_skyvern_page.py+++ b/tests/unit/test_script_skyvern_page.py@@ -556,3 +556,203 @@ async def test_terminate_raises_even_when_handler_fails(mock_scraped_page, mock_await script_page.terminate(errors=["handler error"])mock_handler.assert_called_once()+++# =============================================================================+# Tests for fill() proactive upgrade when value=None + prompt+# =============================================================================+++async def test_fill_value_none_with_prompt_upgrades_to_proactive(mock_scraped_page, mock_ai):+ """+ When fill() is called with value=None and a prompt but ai != 'proactive',+ it should upgrade ai to 'proactive' and delegate to _input_text instead of+ returning "" (the old silent no-op behavior).+ """+ mock_page = create_mock_page()++ with patch(+ "skyvern.core.script_generations.skyvern_page.Page.__init__",+ return_value=None,+ ):+ script_page = ScriptSkyvernPage(+ scraped_page=mock_scraped_page,+ page=mock_page,+ ai=mock_ai,+ )++ # Mock _input_text to capture the call+ script_page._input_text = AsyncMock(return_value="filled_value")++ result = await script_page.fill(+ selector="#email",+ value=None,+ prompt="Fill the email address field",+ ai="fallback",+ )++ # Should NOT return "" — should delegate to _input_text+ assert result == "filled_value"+ script_page._input_text.assert_called_once()+ call_kwargs = script_page._input_text.call_args.kwargs+ assert call_kwargs["ai"] == "proactive"+++async def test_fill_value_none_no_prompt_still_skips(mock_scraped_page, mock_ai):+ """+ When fill() is called with value=None and NO prompt and ai != 'proactive',+ it should still return "" (skip the fill).+ """+ mock_page = create_mock_page()++ with patch(+ "skyvern.core.script_generations.skyvern_page.Page.__init__",+ return_value=None,+ ):+ script_page = ScriptSkyvernPage(+ scraped_page=mock_scraped_page,+ page=mock_page,+ ai=mock_ai,+ )++ script_page._input_text = AsyncMock(return_value="should_not_reach")++ result = await script_page.fill(+ selector="#email",+ value=None,+ ai="fallback",+ )++ assert result == ""+ script_page._input_text.assert_not_called()+++async def test_fill_value_none_proactive_unchanged(mock_scraped_page, mock_ai):+ """+ When fill() is called with value=None and ai='proactive', it should+ proceed as before (not return early, delegate to _input_text).+ """+ mock_page = create_mock_page()++ with patch(+ "skyvern.core.script_generations.skyvern_page.Page.__init__",+ return_value=None,+ ):+ script_page = ScriptSkyvernPage(+ scraped_page=mock_scraped_page,+ page=mock_page,+ ai=mock_ai,+ )++ script_page._input_text = AsyncMock(return_value="ai_value")++ result = await script_page.fill(+ selector="#email",+ value=None,+ prompt="Fill the email",+ ai="proactive",+ )++ assert result == "ai_value"+ script_page._input_text.assert_called_once()+++# =============================================================================+# Tests for fill_autocomplete() proactive upgrade when value=None + prompt+# =============================================================================+++async def test_fill_autocomplete_value_none_with_prompt_upgrades_to_proactive(mock_scraped_page, mock_ai):+ """+ When fill_autocomplete() is called with value=None and a prompt but ai != 'proactive',+ it should upgrade ai to 'proactive' and delegate to ai_input_text instead of+ returning "" (the old silent no-op behavior).+ """+ mock_page = create_mock_page()++ with patch(+ "skyvern.core.script_generations.skyvern_page.Page.__init__",+ return_value=None,+ ):+ script_page = ScriptSkyvernPage(+ scraped_page=mock_scraped_page,+ page=mock_page,+ ai=mock_ai,+ )++ script_page._ai.ai_input_text = AsyncMock(return_value="filled_value")++ result = await script_page.fill_autocomplete(+ selector="#city",+ value=None,+ prompt="Fill the city field",+ ai="fallback",+ )++ assert result == "filled_value"+ script_page._ai.ai_input_text.assert_called_once()+++async def test_fill_autocomplete_value_none_no_prompt_still_skips(mock_scraped_page, mock_ai):+ """+ When fill_autocomplete() is called with value=None and NO prompt and ai != 'proactive',+ it should still return "" (skip the fill).+ """+ mock_page = create_mock_page()++ with patch(+ "skyvern.core.script_generations.skyvern_page.Page.__init__",+ return_value=None,+ ):+ script_page = ScriptSkyvernPage(+ scraped_page=mock_scraped_page,+ page=mock_page,+ ai=mock_ai,+ )++ script_page._ai.ai_input_text = AsyncMock(return_value="should_not_reach")++ result = await script_page.fill_autocomplete(+ selector="#city",+ value=None,+ ai="fallback",+ )++ assert result == ""+ script_page._ai.ai_input_text.assert_not_called()+++async def test_fill_autocomplete_value_none_proactive_unchanged(mock_scraped_page, mock_ai):+ """+ When fill_autocomplete() is called with value=None and ai='proactive', it should+ proceed as before (delegate to ai_input_text).+ """+ mock_page = create_mock_page()++ with patch(+ "skyvern.core.script_generations.skyvern_page.Page.__init__",+ return_value=None,+ ):+ script_page = ScriptSkyvernPage(+ scraped_page=mock_scraped_page,+ page=mock_page,+ ai=mock_ai,+ )++ script_page._ai.ai_input_text = AsyncMock(return_value="ai_value")++ result = await script_page.fill_autocomplete(+ selector="#city",+ value=None,+ prompt="Fill the city",+ ai="proactive",+ )++ assert result == "ai_value"+ script_page._ai.ai_input_text.assert_called_once()diff --git a/tests/unit/test_should_run_script.py b/tests/unit/test_should_run_script.pynew file mode 100644index 000000000..c0874d6b1--- /dev/null+++ b/tests/unit/test_should_run_script.py@@ -0,0 +1,107 @@+"""Tests for WorkflowService.should_run_script().++Verifies the priority chain:+ run-level run_with > workflow-level run_with > default (agent).+adaptive_caching alone does NOT force code mode.+"""++from datetime import datetime, timezone++import pytest++from skyvern.forge.sdk.workflow.models.workflow import Workflow, WorkflowRun, WorkflowRunStatus+++def _make_workflow(run_with: str | None = None, adaptive_caching: bool = False) -> Workflow:+ return Workflow(+ workflow_id="wf_test",+ organization_id="org_test",+ workflow_permanent_id="wpid_test",+ title="test",+ version=1,+ is_saved_task=False,+ workflow_definition={"parameters": [], "blocks": []},+ run_with=run_with,+ adaptive_caching=adaptive_caching,+ created_at=datetime.now(timezone.utc),+ modified_at=datetime.now(timezone.utc),+ )+++def _make_run(run_with: str | None = None) -> WorkflowRun:+ return WorkflowRun(+ workflow_run_id="wr_test",+ workflow_id="wf_test",+ workflow_permanent_id="wpid_test",+ organization_id="org_test",+ status=WorkflowRunStatus.running,+ run_with=run_with,+ created_at=datetime.now(timezone.utc),+ modified_at=datetime.now(timezone.utc),+ )+++def service():+ from skyvern.forge.sdk.workflow.service import WorkflowService++ return WorkflowService()+++class TestShouldRunScript:+ """Run-level run_with takes priority, then workflow-level, then defaults to agent."""++ def test_run_code_overrides_workflow_agent(self, service):+ wf = _make_workflow(run_with="agent")+ wr = _make_run(run_with="code")+ assert service.should_run_script(wf, wr) is True++ def test_run_code_v2_overrides_workflow_agent(self, service):+ wf = _make_workflow(run_with="agent")+ wr = _make_run(run_with="code_v2")+ assert service.should_run_script(wf, wr) is True++ def test_run_agent_overrides_workflow_code(self, service):+ wf = _make_workflow(run_with="code")+ wr = _make_run(run_with="agent")+ assert service.should_run_script(wf, wr) is False++ def test_workflow_code_with_null_run(self, service):+ wf = _make_workflow(run_with="code")+ wr = _make_run(run_with=None)+ assert service.should_run_script(wf, wr) is True++ def test_workflow_agent_with_null_run(self, service):+ wf = _make_workflow(run_with="agent")+ wr = _make_run(run_with=None)+ assert service.should_run_script(wf, wr) is False++ def test_both_null_defaults_to_agent(self, service):+ """When neither workflow nor run specifies run_with, default to agent (no code)."""+ wf = _make_workflow(run_with=None)+ wr = _make_run(run_with=None)+ assert service.should_run_script(wf, wr) is False++ def test_adaptive_caching_alone_does_not_force_code(self, service):+ """adaptive_caching=True with run_with=null should NOT force code mode (SKY-8390)."""+ wf = _make_workflow(run_with=None, adaptive_caching=True)+ wr = _make_run(run_with=None)+ assert service.should_run_script(wf, wr) is False++ def test_adaptive_caching_with_workflow_agent_does_not_force_code(self, service):+ """adaptive_caching=True with explicit run_with=agent should NOT force code."""+ wf = _make_workflow(run_with="agent", adaptive_caching=True)+ wr = _make_run(run_with=None)+ assert service.should_run_script(wf, wr) is False++ def test_adaptive_caching_with_workflow_code_runs_code(self, service):+ """adaptive_caching=True with run_with=code should run code (v1→v2 upgrade is separate)."""+ wf = _make_workflow(run_with="code", adaptive_caching=True)+ wr = _make_run(run_with=None)+ assert service.should_run_script(wf, wr) is True++ def test_workflow_code_v2_with_null_run(self, service):+ """workflow.run_with='code_v2' should be treated the same as 'code'."""+ wf = _make_workflow(run_with="code_v2")+ wr = _make_run(run_with=None)+ assert service.should_run_script(wf, wr) is Truediff --git a/tests/unit/test_text_prompt_block.py b/tests/unit/test_text_prompt_block.pyindex ed87b1aa6..933ba9d4f 100644--- a/tests/unit/test_text_prompt_block.py+++ b/tests/unit/test_text_prompt_block.py@@ -1,12 +1,16 @@import sysfrom datetime import datetime, timezone-from unittest.mock import AsyncMock+from unittest.mock import AsyncMock, MagicMock, patchimport pytest+from jinja2 import StrictUndefined+from jinja2.sandbox import SandboxedEnvironment+import skyvern.forge.sdk.workflow.models.block as _block_modfrom skyvern.config import settings as base_settingsfrom skyvern.forge.prompts import prompt_enginefrom skyvern.forge.sdk.settings_manager import SettingsManager+from skyvern.forge.sdk.workflow.context_manager import WorkflowRunContextfrom skyvern.forge.sdk.workflow.models.block import TextPromptBlockfrom skyvern.forge.sdk.workflow.models.parameter import OutputParameter, ParameterTypefrom skyvern.schemas.workflows import TextPromptBlockYAML, WorkflowRequest@@ -14,6 +18,45 @@ from skyvern.schemas.workflows import TextPromptBlockYAML, WorkflowRequestblock_module = sys.modules["skyvern.forge.sdk.workflow.models.block"]+def _make_workflow_run_context(values: dict | None = None) -> WorkflowRunContext:+ """Create a minimal WorkflowRunContext with given values for template rendering tests."""+ ctx = WorkflowRunContext(+ workflow_title="test",+ workflow_id="w_test",+ workflow_permanent_id="wpid_test",+ workflow_run_id="wr_test",+ aws_client=MagicMock(),+ )+ if values:+ ctx.values.update(values)+ return ctx+++def _make_text_prompt_block(+ prompt: str = "test prompt",+ json_schema: dict | None = None,+) -> TextPromptBlock:+ now = datetime.now(timezone.utc)+ return TextPromptBlock(+ label="test-block",+ llm_key=None,+ prompt=prompt,+ parameters=[],+ json_schema=json_schema,+ output_parameter=OutputParameter(+ parameter_type=ParameterType.OUTPUT,+ key="text_prompt_output",+ description=None,+ output_parameter_id="output-test",+ workflow_id="workflow-1",+ created_at=now,+ modified_at=now,+ deleted_at=None,+ ),+ model=None,+ )++@pytest.mark.asyncio@pytest.mark.parametrize("model_name",@@ -385,3 +428,98 @@ def test_workflow_request_deserialization_strips_invalid_text_prompt_llm_key() -block = workflow_request.json_definition.workflow_definition.blocks[0]assert block.llm_key is Noneassert block.model is None+++# --- json_schema Jinja template rendering tests (SKY-6479) ---+++def test_render_schema_templates_resolves_variables():+ """json_schema description fields with {{ }} should be rendered."""+ block = _make_text_prompt_block(+ json_schema={+ "type": "object",+ "properties": {+ "result": {+ "type": "string",+ "description": "Add 14 days to {{ start_date }}",+ }+ },+ },+ )+ ctx = _make_workflow_run_context({"start_date": "2025-01-15"})+ rendered = block._render_schema_templates(block.json_schema, ctx)++ assert rendered["properties"]["result"]["description"] == "Add 14 days to 2025-01-15"+ # non-template values preserved+ assert rendered["type"] == "object"+ assert rendered["properties"]["result"]["type"] == "string"+++def test_render_schema_templates_nested_list():+ """Templates inside lists within the schema should also be rendered."""+ block = _make_text_prompt_block(+ json_schema={+ "type": "object",+ "required": ["{{ field_name }}"],+ },+ )+ ctx = _make_workflow_run_context({"field_name": "invoice_date"})+ rendered = block._render_schema_templates(block.json_schema, ctx)++ assert rendered["required"] == ["invoice_date"]+++def test_render_schema_templates_failure_preserves_original():+ """When a single value fails to render, it should be preserved and a warning logged."""+ block = _make_text_prompt_block(+ json_schema={+ "type": "object",+ "properties": {+ "good": {"description": "value is {{ known }}"},+ "bad": {"description": "value is {{ unknown }}"},+ },+ },+ )+ strict_env = SandboxedEnvironment(undefined=StrictUndefined)+ with (+ patch.object(base_settings, "WORKFLOW_TEMPLATING_STRICTNESS", "strict"),+ patch.object(_block_mod, "jinja_sandbox_env", strict_env),+ ):+ ctx = _make_workflow_run_context({"known": "hello"})+ rendered = block._render_schema_templates(block.json_schema, ctx)++ # good value rendered+ assert rendered["properties"]["good"]["description"] == "value is hello"+ # bad value preserved as-is+ assert rendered["properties"]["bad"]["description"] == "value is {{ unknown }}"+++def test_format_potential_template_parameters_renders_json_schema():+ """format_potential_template_parameters should render json_schema templates."""+ block = _make_text_prompt_block(+ prompt="Calculate dates for {{ start_date }}",+ json_schema={+ "type": "object",+ "properties": {+ "date_plus_14": {+ "type": "string",+ "description": "14 days after {{ start_date }}",+ }+ },+ },+ )+ ctx = _make_workflow_run_context({"start_date": "2025-01-15"})+ block.format_potential_template_parameters(ctx)++ assert block.prompt == "Calculate dates for 2025-01-15"+ assert block.json_schema["properties"]["date_plus_14"]["description"] == "14 days after 2025-01-15"+++def test_format_potential_template_parameters_no_json_schema():+ """When json_schema is None, format_potential_template_parameters should not fail."""+ block = _make_text_prompt_block(prompt="simple prompt", json_schema=None)+ ctx = _make_workflow_run_context()+ block.format_potential_template_parameters(ctx)++ assert block.json_schema is None+ assert block.prompt == "simple prompt"diff --git a/uv.lock b/uv.lockindex 01cc02b17..dc3ac9b03 100644--- a/uv.lock+++ b/uv.lock@@ -4997,6 +4997,21 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/1b/d0/397f9626e711ff749a95d96b7af99b9c566a9bb5129b8e4c10fc4d100304/python_multipart-0.0.22-py3-none-any.whl", hash = "sha256:2b2cd894c83d21bf49d702499531c7bafd057d730c201782048f7945d82de155", size = 24579, upload-time = "2026-01-25T10:15:54.811Z" },]+[[package]]+name = "python-pptx"+version = "1.0.2"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "lxml" },+ { name = "pillow" },+ { name = "typing-extensions" },+ { name = "xlsxwriter" },+]+sdist = { url = "https://files.pythonhosted.org/packages/52/a9/0c0db8d37b2b8a645666f7fd8accea4c6224e013c42b1d5c17c93590cd06/python_pptx-1.0.2.tar.gz", hash = "sha256:479a8af0eaf0f0d76b6f00b0887732874ad2e3188230315290cd1f9dd9cc7095", size = 10109297, upload-time = "2024-08-07T17:33:37.772Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/d9/4f/00be2196329ebbff56ce564aa94efb0fbc828d00de250b1980de1a34ab49/python_pptx-1.0.2-py3-none-any.whl", hash = "sha256:160838e0b8565a8b1f67947675886e9fea18aa5e795db7ae531606d68e785cba", size = 472788, upload-time = "2024-08-07T17:33:28.192Z" },+]+[[package]]name = "pytz"version = "2025.2"@@ -5700,6 +5715,7 @@ dev = [{ name = "pydevd-pycharm" },{ name = "pytest" },{ name = "pytest-asyncio" },+ { name = "python-pptx" },{ name = "ruff" },{ name = "twine" },{ name = "types-requests" },@@ -5817,6 +5833,7 @@ dev = [{ name = "pydevd-pycharm", specifier = ">=233.6745.319,<234" },{ name = "pytest", specifier = ">=7.4.0,<8" },{ name = "pytest-asyncio", specifier = ">=0.21.1,<0.22" },+ { name = "python-pptx", specifier = ">=1.0.2" },{ name = "ruff", specifier = ">=0.14.1,<0.15" },{ name = "twine", specifier = ">=6.1.0,<7" },{ name = "types-requests", specifier = ">=2.31.0.2,<3" },@@ -6631,6 +6648,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/a4/f5/10b68b7b1544245097b2a1b8238f66f2fc6dcaeb24ba5d917f52bd2eed4f/wsproto-1.3.2-py3-none-any.whl", hash = "sha256:61eea322cdf56e8cc904bd3ad7573359a242ba65688716b0710a5eb12beab584", size = 24405, upload-time = "2025-11-20T18:18:00.454Z" },]+[[package]]+name = "xlsxwriter"+version = "3.2.9"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/46/2c/c06ef49dc36e7954e55b802a8b231770d286a9758b3d936bd1e04ce5ba88/xlsxwriter-3.2.9.tar.gz", hash = "sha256:254b1c37a368c444eac6e2f867405cc9e461b0ed97a3233b2ac1e574efb4140c", size = 215940, upload-time = "2025-09-16T00:16:21.63Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/3a/0c/3662f4a66880196a590b202f0db82d919dd2f89e99a27fadef91c4a33d41/xlsxwriter-3.2.9-py3-none-any.whl", hash = "sha256:9a5db42bc5dff014806c58a20b9eae7322a134abb6fce3c92c181bfb275ec5b3", size = 175315, upload-time = "2025-09-16T00:16:20.108Z" },+]+[[package]]name = "xmltodict"version = "1.0.2"