From 579cdea8209694a75bc40bbfae8fd5de0b536bed Mon Sep 17 00:00:00 2001 From: NFish Date: Mon, 9 Feb 2026 15:52:22 +0800 Subject: [PATCH] fix: include app id in automatic generation requests (#32138) --- .../config/automatic/get-automatic-res.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx index f5ebaac3ca..44ce5cde52 100644 --- a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx +++ b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx @@ -19,19 +19,21 @@ import { useBoolean, useSessionStorageState } from 'ahooks' import * as React from 'react' import { useCallback, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' +import { useShallow } from 'zustand/react/shallow' import Button from '@/app/components/base/button' import Confirm from '@/app/components/base/confirm' import { Generator } from '@/app/components/base/icons/src/vender/other' -import Loading from '@/app/components/base/loading' +import Loading from '@/app/components/base/loading' import Modal from '@/app/components/base/modal' import Toast from '@/app/components/base/toast' -import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations' +import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations' import { useModelListAndDefaultModelAndCurrentProviderAndModel } from '@/app/components/header/account-setting/model-provider-page/hooks' import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal' import { generateBasicAppFirstTimeRule, generateRule } from '@/service/debug' import { useGenerateRuleTemplate } from '@/service/use-apps' +import { useStore } from '../../../store' import IdeaOutput from './idea-output' import InstructionEditorInBasic from './instruction-editor' import InstructionEditorInWorkflow from './instruction-editor-in-workflow' @@ -83,6 +85,9 @@ const GetAutomaticRes: FC = ({ onFinished, }) => { const { t } = useTranslation() + const { appDetail } = useStore(useShallow(state => ({ + appDetail: state.appDetail, + }))) const localModel = localStorage.getItem('auto-gen-model') ? JSON.parse(localStorage.getItem('auto-gen-model') as string) as Model : null @@ -235,6 +240,7 @@ const GetAutomaticRes: FC = ({ instruction, model_config: model, no_variable: false, + app_id: appDetail?.id, }) apiRes = { ...res, @@ -256,6 +262,7 @@ const GetAutomaticRes: FC = ({ instruction, ideal_output: ideaOutput, model_config: model, + app_id: appDetail?.id, }) apiRes = res if (error) {