Skip to content

perf: get_provider_model_bundle use single query instead of get_confi…#34370

Open
fatelei wants to merge 2 commits intolanggenius:mainfrom
fatelei:issue-34367
Open

perf: get_provider_model_bundle use single query instead of get_confi…#34370
fatelei wants to merge 2 commits intolanggenius:mainfrom
fatelei:issue-34367

Conversation

@fatelei
Copy link
Copy Markdown
Contributor

@fatelei fatelei commented Apr 1, 2026

…gurations

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

fix #34367

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint and make type-check (backend) and cd web && npx lint-staged (frontend) to appease the lint gods

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Pyrefly Diff

No changes detected.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Pyrefly Diff

No changes detected.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-01 03:30:42.465184343 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-01 03:30:31.719206451 +0000
@@ -857,15 +857,15 @@
 ERROR Argument `str | None` is not assignable to parameter `created_by` with type `SQLCoreOperations[str] | str` in function `models.model.MessageAgentThought.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_agent_service.py:800:24
 ERROR Argument `Literal['account']` is not assignable to parameter `created_by_role` with type `CreatorUserRole | SQLCoreOperations[CreatorUserRole]` in function `models.model.MessageAgentThought.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_agent_service.py:895:29
+   --> tests/test_containers_integration_tests/services/test_agent_service.py:894:29
 ERROR Argument `Literal['account']` is not assignable to parameter `created_by_role` with type `CreatorUserRole | SQLCoreOperations[CreatorUserRole]` in function `models.model.MessageAgentThought.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_agent_service.py:964:29
+   --> tests/test_containers_integration_tests/services/test_agent_service.py:963:29
 ERROR Argument `str | None` is not assignable to parameter `created_by` with type `SQLCoreOperations[str] | str` in function `models.model.MessageAgentThought.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_agent_service.py:965:24
+   --> tests/test_containers_integration_tests/services/test_agent_service.py:964:24
 ERROR Argument `Literal['account']` is not assignable to parameter `created_by_role` with type `CreatorUserRole | SQLCoreOperations[CreatorUserRole]` in function `models.model.MessageAgentThought.__init__` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_agent_service.py:1005:29
+    --> tests/test_containers_integration_tests/services/test_agent_service.py:1004:29
 ERROR Argument `str | None` is not assignable to parameter `created_by` with type `SQLCoreOperations[str] | str` in function `models.model.MessageAgentThought.__init__` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_agent_service.py:1006:24
+    --> tests/test_containers_integration_tests/services/test_agent_service.py:1005:24
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_annotation_service.py:102:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -1329,7 +1329,7 @@
 ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[StatementError]]) [no-matching-overload]
     --> tests/test_containers_integration_tests/services/test_workflow_service.py:1297:27
 ERROR Argument `dict[str, Any]` is not assignable to parameter `metadata` with type `Mapping[WorkflowNodeExecutionMetadataKey, Any]` in function `graphon.node_events.base.NodeRunResult.__init__` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_workflow_service.py:1641:26
+    --> tests/test_containers_integration_tests/services/test_workflow_service.py:1642:26
 ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_workspace_service.py:53:20
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
@@ -2959,13 +2959,13 @@
 ERROR Argument `None` is not assignable to parameter `value` with type `Segment | dict[Unknown, Unknown] | list[Unknown]` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter._fetch_files_from_variable_value` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:46:77
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AdvancedChatAppGenerateEntity | WorkflowAppGenerateEntity` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter_human_input.py:33:37
+  --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter_human_input.py:32:37
 ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | EndUser` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter_human_input.py:34:14
+  --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter_human_input.py:33:14
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AdvancedChatAppGenerateEntity | WorkflowAppGenerateEntity` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter_resumption.py:32:37
+  --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter_resumption.py:31:37
 ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | EndUser` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter_resumption.py:33:14
+  --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter_resumption.py:32:14
 ERROR Object of class `NoneType` has no attribute `data` [missing-attribute]
    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter_truncation.py:588:16
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.completion.app_config_manager.CompletionAppConfigManager.get_app_config` [bad-argument-type]
@@ -3463,13 +3463,13 @@
 ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `core.app.features.hosting_moderation.hosting_moderation.HostingModerationFeature.check` [bad-argument-type]
   --> tests/unit_tests/core/app/features/test_hosting_moderation.py:23:65
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_suspend_layer.py:19:24
+  --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:48:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:85:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:105:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -5999,13 +5999,13 @@
 ERROR Cannot index into `list[dict[str, Any]]` [bad-index]
    --> tests/unit_tests/core/variables/test_segment.py:491:16
 ERROR Cannot set field `value` [read-only]
-  --> tests/unit_tests/core/variables/test_variables.py:19:9
+  --> tests/unit_tests/core/variables/test_variables.py:20:9
 ERROR Cannot set field `value` [read-only]
-  --> tests/unit_tests/core/variables/test_variables.py:23:9
+  --> tests/unit_tests/core/variables/test_variables.py:24:9
 ERROR Cannot set field `value` [read-only]
-  --> tests/unit_tests/core/variables/test_variables.py:27:9
+  --> tests/unit_tests/core/variables/test_variables.py:28:9
 ERROR Cannot set field `value` [read-only]
-  --> tests/unit_tests/core/variables/test_variables.py:31:9
+  --> tests/unit_tests/core/variables/test_variables.py:32:9
 ERROR Object of class `IExecutionContext` has no attribute `context_vars` [missing-attribute]
    --> tests/unit_tests/core/workflow/context/test_execution_context.py:311:16
 ERROR Object of class `BaseModel` has no attribute `base_url` [missing-attribute]
@@ -6069,11 +6069,11 @@
 ERROR Argument `dict[str, dict[str, Any] | str]` is not assignable to parameter `config` with type `NodeConfigDict` in function `graphon.nodes.base.node.Node.__init__` [bad-argument-type]
    --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:187:16
 ERROR Argument `Sequence[type[GraphEngineEvent]]` is not assignable to parameter `expected_sequence` with type `list[type[GraphEngineEvent]]` in function `TableTestRunner._validate_event_sequence` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:403:21
+   --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:402:21
 ERROR `graph` is uninitialized [unbound-name]
-   --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:456:23
+   --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:455:23
 ERROR `graph_runtime_state` is uninitialized [unbound-name]
-   --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:457:37
+   --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:456:37
 ERROR Argument `Iterator[Unknown]` is not assignable to parameter `messages` with type `Generator[ToolInvokeMessage]` in function `core.workflow.nodes.agent.message_transformer.AgentMessageTransformer.transform` [bad-argument-type]
   --> tests/unit_tests/core/workflow/nodes/agent/test_message_transformer.py:16:26
 ERROR Argument `dict[str, dict[str, str] | str]` is not assignable to parameter `config` with type `NodeConfigDict` in function `graphon.nodes.base.node.Node.__init__` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Pyrefly Diff

No changes detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_provider_model_bundle use single query instead of get_configurations

1 participant