diff --git a/cypress/e2e/233-AI-switch-to-logs-on-error.cy.ts b/cypress/e2e/233-AI-switch-to-logs-on-error.cy.ts index eca3af81fb..79f33b841c 100644 --- a/cypress/e2e/233-AI-switch-to-logs-on-error.cy.ts +++ b/cypress/e2e/233-AI-switch-to-logs-on-error.cy.ts @@ -90,6 +90,14 @@ function createRunDataWithError(inputMessage: string) { routine: 'InitPostgres', } as unknown as Error, } as ExecutionError, + metadata: { + subRun: [ + { + node: 'Postgres Chat Memory', + runIndex: 0, + }, + ], + }, }), createMockNodeExecutionData(AGENT_NODE_NAME, { executionStatus: 'error', @@ -124,14 +132,6 @@ function createRunDataWithError(inputMessage: string) { description: 'Internal error', message: 'Internal error', } as unknown as ExecutionError, - metadata: { - subRun: [ - { - node: 'Postgres Chat Memory', - runIndex: 0, - }, - ], - }, }), ]; } diff --git a/cypress/e2e/30-langchain.cy.ts b/cypress/e2e/30-langchain.cy.ts index 0deec76e9f..e23b7e4da3 100644 --- a/cypress/e2e/30-langchain.cy.ts +++ b/cypress/e2e/30-langchain.cy.ts @@ -278,6 +278,9 @@ describe('Langchain Integration', () => { }, }, }, + metadata: { + subRun: [{ node: AI_LANGUAGE_MODEL_OPENAI_CHAT_MODEL_NODE_NAME, runIndex: 0 }], + }, inputOverride: { ai_languageModel: [ [ @@ -316,9 +319,6 @@ describe('Langchain Integration', () => { jsonData: { main: { output: 'Hi there! How can I assist you today?' }, }, - metadata: { - subRun: [{ node: AI_LANGUAGE_MODEL_OPENAI_CHAT_MODEL_NODE_NAME, runIndex: 0 }], - }, }), ], lastNodeExecuted: AGENT_NODE_NAME, diff --git a/packages/editor-ui/src/components/OutputPanel.vue b/packages/editor-ui/src/components/OutputPanel.vue index bf3cbbe6eb..4c513c07d1 100644 --- a/packages/editor-ui/src/components/OutputPanel.vue +++ b/packages/editor-ui/src/components/OutputPanel.vue @@ -100,14 +100,15 @@ const isTriggerNode = computed(() => { }); const hasAiMetadata = computed(() => { + if (isNodeRunning.value || !workflowRunData.value) { + return false; + } + if (node.value) { - const resultData = workflowsStore.getWorkflowResultDataByNodeName(node.value.name); + const connectedSubNodes = props.workflow.getParentNodes(node.value.name, 'ALL_NON_MAIN'); + const resultData = connectedSubNodes.map(workflowsStore.getWorkflowResultDataByNodeName); - if (!resultData || !Array.isArray(resultData) || resultData.length === 0) { - return false; - } - - return !!resultData[resultData.length - 1].metadata; + return resultData && Array.isArray(resultData) && resultData.length > 0; } return false; }); @@ -295,6 +296,7 @@ const activatePane = () => { :block-u-i="blockUI" :is-production-execution-preview="isProductionExecutionPreview" :is-pane-active="isPaneActive" + :hide-pagination="outputMode === 'logs'" pane-type="output" :data-output-type="outputMode" @activate-pane="activatePane" @@ -368,7 +370,7 @@ const activatePane = () => {