From 215e3186006dcc6ded4d9c22e2d338906f758963 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Tue, 12 Aug 2025 16:08:28 +0800 Subject: [PATCH] slice descrition when restore workflow --- .../workflow-app/hooks/use-workflow-run.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow-app/hooks/use-workflow-run.ts b/web/app/components/workflow-app/hooks/use-workflow-run.ts index a5e2740d8c..445a6c9244 100644 --- a/web/app/components/workflow-app/hooks/use-workflow-run.ts +++ b/web/app/components/workflow-app/hooks/use-workflow-run.ts @@ -340,8 +340,17 @@ export const useWorkflowRun = () => { } featuresStore?.setState({ features: mappedFeatures }) - workflowStore.getState().setEnvironmentVariables(publishedWorkflow.environment_variables || []) - workflowStore.getState().setConversationVariables(publishedWorkflow.conversation_variables || []) + // slice description of env & chatVar + const newEnvList = (publishedWorkflow.environment_variables || []).map(env => ({ + ...env, + description: env.description.slice(0, 256), + })) + const newChatVarList = (publishedWorkflow.conversation_variables || []).map(chatVar => ({ + ...chatVar, + description: chatVar.description.slice(0, 256), + })) + workflowStore.getState().setEnvironmentVariables(newEnvList || []) + workflowStore.getState().setConversationVariables(newChatVarList || []) }, [featuresStore, handleUpdateWorkflowCanvas, workflowStore]) return {