From 912a72a7cca26594266d2ad5b1247ee68c8a1851 Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Thu, 2 Oct 2025 18:05:19 -0700 Subject: [PATCH] =?UTF-8?q?pass=20code=5Fgen=20flag=20as=20True=20when=20a?= =?UTF-8?q?uto-playing=20v2=20tasks=20via=20discover=20pr=E2=80=A6=20(#359?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/editor/nodes/components/NodeHeader.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/components/NodeHeader.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/components/NodeHeader.tsx index ace12389..4a5d0263 100644 --- a/skyvern-frontend/src/routes/workflows/editor/nodes/components/NodeHeader.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/nodes/components/NodeHeader.tsx @@ -73,6 +73,7 @@ const getPayload = (opts: { blockLabel: string; blockOutputs: Record; browserSessionId: string | null; + codeGen: boolean | null; parameters: Record; totpIdentifier: string | null; totpUrl: string | null; @@ -116,6 +117,7 @@ const getPayload = (opts: { block_labels: [opts.blockLabel], block_outputs: opts.blockOutputs, browser_session_id: opts.browserSessionId, + code_gen: opts.codeGen, extra_http_headers: extraHttpHeaders, max_screenshot_scrolls: opts.workflowSettings.maxScreenshotScrollingTimes, parameters: opts.parameters, @@ -202,7 +204,7 @@ function NodeHeader({ ) { setAutoplay(null, null); setTimeout(() => { - runBlock.mutateAsync(); + runBlock.mutateAsync({ codeGen: true }); }, 100); } @@ -260,7 +262,7 @@ function NodeHeader({ ]); const runBlock = useMutation({ - mutationFn: async () => { + mutationFn: async (opts?: { codeGen: boolean }) => { closeWorkflowPanel(); await saveWorkflow.mutateAsync(); @@ -313,6 +315,7 @@ function NodeHeader({ blockOutputs: blockOutputsStore.getOutputsWithOverrides(workflowPermanentId), browserSessionId: debugSession.browser_session_id, + codeGen: opts?.codeGen ?? false, parameters, totpIdentifier, totpUrl, @@ -452,7 +455,7 @@ function NodeHeader({ }); const handleOnPlay = () => { - runBlock.mutate(); + runBlock.mutate({ codeGen: false }); }; const handleOnCancel = () => {