From 4fd4615c567d9e03e70a578dd5e8ba0563cd23ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?= Date: Tue, 12 May 2026 11:24:14 +0800 Subject: [PATCH] fix: avoid trial workflow schema model collision (#36061) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- api/controllers/console/explore/trial.py | 2 +- api/openapi/markdown/console-swagger.md | 12 ++++++++++-- .../controllers/console/explore/test_trial.py | 5 +++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/api/controllers/console/explore/trial.py b/api/controllers/console/explore/trial.py index 025c517d20..26b48ec599 100644 --- a/api/controllers/console/explore/trial.py +++ b/api/controllers/console/explore/trial.py @@ -106,7 +106,7 @@ app_detail_fields_with_site_copy["tags"] = fields.List(fields.Nested(tag_model)) app_detail_fields_with_site_copy["site"] = fields.Nested(site_model) app_detail_with_site_model = get_or_create_model("TrialAppDetailWithSite", app_detail_fields_with_site_copy) -simple_account_model = get_or_create_model("SimpleAccount", simple_account_fields) +simple_account_model = get_or_create_model("TrialSimpleAccount", simple_account_fields) conversation_variable_model = get_or_create_model("TrialConversationVariable", conversation_variable_fields) pipeline_variable_model = get_or_create_model("TrialPipelineVariable", pipeline_variable_fields) diff --git a/api/openapi/markdown/console-swagger.md b/api/openapi/markdown/console-swagger.md index f3c188fc06..e56d5f6fe5 100644 --- a/api/openapi/markdown/console-swagger.md +++ b/api/openapi/markdown/console-swagger.md @@ -13786,6 +13786,14 @@ Tag type | unit | string | | No | | variable | string | | No | +#### TrialSimpleAccount + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| email | string | | No | +| id | string | | No | +| name | string | | No | + #### TrialSite | Name | Type | Description | Required | @@ -13829,7 +13837,7 @@ Tag type | ---- | ---- | ----------- | -------- | | conversation_variables | [ [TrialConversationVariable](#trialconversationvariable) ] | | No | | created_at | object | | No | -| created_by | [SimpleAccount](#simpleaccount) | | No | +| created_by | [TrialSimpleAccount](#trialsimpleaccount) | | No | | environment_variables | [ object ] | | No | | features | object | | No | | graph | object | | No | @@ -13840,7 +13848,7 @@ Tag type | rag_pipeline_variables | [ [TrialPipelineVariable](#trialpipelinevariable) ] | | No | | tool_published | boolean | | No | | updated_at | object | | No | -| updated_by | [SimpleAccount](#simpleaccount) | | No | +| updated_by | [TrialSimpleAccount](#trialsimpleaccount) | | No | | version | string | | No | #### TrialWorkflowPartial diff --git a/api/tests/unit_tests/controllers/console/explore/test_trial.py b/api/tests/unit_tests/controllers/console/explore/test_trial.py index 14f00e6295..82a063307b 100644 --- a/api/tests/unit_tests/controllers/console/explore/test_trial.py +++ b/api/tests/unit_tests/controllers/console/explore/test_trial.py @@ -88,6 +88,11 @@ def valid_parameters(): } +def test_trial_workflow_uses_trial_scoped_simple_account_model(): + assert module.simple_account_model.name == "TrialSimpleAccount" + assert hasattr(module.simple_account_model, "items") + + class TestTrialAppWorkflowRunApi: def test_not_workflow_app(self, app: Flask): api = module.TrialAppWorkflowRunApi()