Skip to content

chore: clean Db session from service#38227

Merged
asukaminato0721 merged 5 commits into
langgenius:mainfrom
asukaminato0721:db-session
Jul 8, 2026
Merged

chore: clean Db session from service#38227
asukaminato0721 merged 5 commits into
langgenius:mainfrom
asukaminato0721:db-session

Conversation

@asukaminato0721

@asukaminato0721 asukaminato0721 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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

#37403

image

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 && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. refactor labels Jun 30, 2026
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-07-07 21:52:21.264607760 +0000
+++ /tmp/pyrefly_pr.txt	2026-07-07 21:52:12.264714674 +0000
@@ -558,30 +558,34 @@
    --> tests/integration_tests/model_runtime/__mock/plugin_model.py:235:9
 ERROR `unpatch` may be uninitialized [unbound-name]
   --> tests/integration_tests/plugin/__mock/http.py:67:9
+ERROR Argument `scoped_session[flask_sqlalchemy.session.Session]` is not assignable to parameter `session` with type `sqlalchemy.orm.session.Session` in function `services.plugin.plugin_permission_service.PluginPermissionService.change_permission` [bad-argument-type]
+  --> tests/integration_tests/services/plugin/test_plugin_lifecycle.py:50:21
+ERROR Argument `scoped_session[flask_sqlalchemy.session.Session]` is not assignable to parameter `session` with type `sqlalchemy.orm.session.Session` in function `services.plugin.plugin_permission_service.PluginPermissionService.change_permission` [bad-argument-type]
+  --> tests/integration_tests/services/plugin/test_plugin_lifecycle.py:64:21
+ERROR Argument `scoped_session[flask_sqlalchemy.session.Session]` is not assignable to parameter `session` with type `sqlalchemy.orm.session.Session` in function `services.plugin.plugin_permission_service.PluginPermissionService.change_permission` [bad-argument-type]
+  --> tests/integration_tests/services/plugin/test_plugin_lifecycle.py:70:21
 ERROR Argument `FakeArchiveStorage` is not assignable to parameter `storage` with type `ArchiveStorage | None` in function `services.retention.workflow_run.archive_paid_plan_workflow_run.WorkflowRunArchiver._archive_bundle` [bad-argument-type]
    --> tests/integration_tests/services/retention/test_workflow_run_archiver.py:412:56
 ERROR Argument `FakeArchiveStorage` is not assignable to parameter `storage` with type `ArchiveStorage | None` in function `services.retention.workflow_run.archive_paid_plan_workflow_run.WorkflowRunArchiver._archive_bundle` [bad-argument-type]
    --> tests/integration_tests/services/retention/test_workflow_run_archiver.py:437:60
 ERROR Argument `_stub_resolver._Resolver` is not assignable to parameter `binding_resolver` with type `WorkflowAgentBindingResolver | None` in function `services.workflow.node_output_inspector_service.NodeOutputInspectorService.__init__` [bad-argument-type]
-   --> tests/integration_tests/services/test_node_output_inspector_service.py:231:59
+   --> tests/integration_tests/services/test_node_output_inspector_service.py:261:59
 ERROR Argument `_stub_resolver._Resolver` is not assignable to parameter `binding_resolver` with type `WorkflowAgentBindingResolver | None` in function `services.workflow.node_output_inspector_service.NodeOutputInspectorService.__init__` [bad-argument-type]
-   --> tests/integration_tests/services/test_node_output_inspector_service.py:257:59
+   --> tests/integration_tests/services/test_node_output_inspector_service.py:288:59
 ERROR Argument `_stub_resolver._Resolver` is not assignable to parameter `binding_resolver` with type `WorkflowAgentBindingResolver | None` in function `services.workflow.node_output_inspector_service.NodeOutputInspectorService.__init__` [bad-argument-type]
-   --> tests/integration_tests/services/test_node_output_inspector_service.py:267:59
-ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.workflow.node_output_inspector_service.NodeOutputInspectorService.snapshot_workflow_run` [bad-argument-type]
-   --> tests/integration_tests/services/test_node_output_inspector_service.py:269:49
+   --> tests/integration_tests/services/test_node_output_inspector_service.py:298:59
 ERROR Argument `_stub_resolver._Resolver` is not assignable to parameter `binding_resolver` with type `WorkflowAgentBindingResolver | None` in function `services.workflow.node_output_inspector_service.NodeOutputInspectorService.__init__` [bad-argument-type]
-   --> tests/integration_tests/services/test_node_output_inspector_service.py:287:63
+   --> tests/integration_tests/services/test_node_output_inspector_service.py:318:63
 ERROR Argument `_stub_resolver._Resolver` is not assignable to parameter `binding_resolver` with type `WorkflowAgentBindingResolver | None` in function `services.workflow.node_output_inspector_service.NodeOutputInspectorService.__init__` [bad-argument-type]
-   --> tests/integration_tests/services/test_node_output_inspector_service.py:330:63
+   --> tests/integration_tests/services/test_node_output_inspector_service.py:361:63
 ERROR Argument `_stub_resolver._Resolver` is not assignable to parameter `binding_resolver` with type `WorkflowAgentBindingResolver | None` in function `services.workflow.node_output_inspector_service.NodeOutputInspectorService.__init__` [bad-argument-type]
-   --> tests/integration_tests/services/test_node_output_inspector_service.py:371:63
+   --> tests/integration_tests/services/test_node_output_inspector_service.py:402:63
 ERROR Argument `_stub_resolver._Resolver` is not assignable to parameter `binding_resolver` with type `WorkflowAgentBindingResolver | None` in function `services.workflow.node_output_inspector_service.NodeOutputInspectorService.__init__` [bad-argument-type]
-   --> tests/integration_tests/services/test_node_output_inspector_service.py:393:59
+   --> tests/integration_tests/services/test_node_output_inspector_service.py:424:59
 ERROR Argument `_stub_resolver._Resolver` is not assignable to parameter `binding_resolver` with type `WorkflowAgentBindingResolver | None` in function `services.workflow.node_output_inspector_service.NodeOutputInspectorService.__init__` [bad-argument-type]
-   --> tests/integration_tests/services/test_node_output_inspector_service.py:419:59
+   --> tests/integration_tests/services/test_node_output_inspector_service.py:451:59
 ERROR Argument `_stub_resolver._Resolver` is not assignable to parameter `binding_resolver` with type `WorkflowAgentBindingResolver | None` in function `services.workflow.node_output_inspector_service.NodeOutputInspectorService.__init__` [bad-argument-type]
-   --> tests/integration_tests/services/test_node_output_inspector_service.py:468:63
+   --> tests/integration_tests/services/test_node_output_inspector_service.py:501:63
 ERROR Object of class `TestWorkflowDraftVariableServiceResetVariable` has no attribute `_test_user_id` [missing-attribute]
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:626:21
 ERROR Object of class `TestWorkflowDraftVariableServiceResetVariable` has no attribute `_test_user_id` [missing-attribute]
@@ -611,7 +615,7 @@
 ERROR Object of class `object` has no attribute `strip` [missing-attribute]
   --> tests/integration_tests/workflow/test_response_stream_filter_integration.py:75:37
 ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `page` [bad-argument-type]
-   --> tests/test_containers_integration_tests/controllers/console/app/test_app_apis.py:667:51
+   --> tests/test_containers_integration_tests/controllers/console/app/test_app_apis.py:671:51
 ERROR Object of class `RequestError` has no attribute `response` [missing-attribute]
    --> tests/test_containers_integration_tests/controllers/console/auth/test_oauth.py:247:9
 ERROR Object of class `RequestError` has no attribute `response` [missing-attribute]
@@ -627,19 +631,19 @@
 ERROR `in` is not supported between `Literal['webapp-logo']` and `None` [not-iterable]
    --> tests/test_containers_integration_tests/controllers/web/test_site.py:136:16
 ERROR Argument `SimpleNamespace` is not assignable to parameter `webapp_settings` with type `WebAppSettings | None` in function `controllers.web.wraps._validate_user_accessibility` [bad-argument-type]
-  --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:75:33
+  --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:77:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `webapp_settings` with type `WebAppSettings | None` in function `controllers.web.wraps._validate_user_accessibility` [bad-argument-type]
-  --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:98:33
+   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:100:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `webapp_settings` with type `WebAppSettings | None` in function `controllers.web.wraps._validate_user_accessibility` [bad-argument-type]
-   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:110:33
+   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:112:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `webapp_settings` with type `WebAppSettings | None` in function `controllers.web.wraps._validate_user_accessibility` [bad-argument-type]
-   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:128:33
+   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:130:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `webapp_settings` with type `WebAppSettings | None` in function `controllers.web.wraps._validate_user_accessibility` [bad-argument-type]
-   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:146:33
+   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:148:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `webapp_settings` with type `WebAppSettings | None` in function `controllers.web.wraps._validate_user_accessibility` [bad-argument-type]
-   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:163:29
+   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:165:29
 ERROR Argument `SimpleNamespace` is not assignable to parameter `webapp_settings` with type `WebAppSettings | None` in function `controllers.web.wraps._validate_user_accessibility` [bad-argument-type]
-   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:180:33
+   --> tests/test_containers_integration_tests/controllers/web/test_wraps.py:182:33
 ERROR Attribute `file_service` of class `TestPauseStatePersistenceLayerTestContainers` is a read-only descriptor with no `__set__` and cannot be set [read-only]
    --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:156:9
 ERROR Attribute `workflow_run_service` of class `TestPauseStatePersistenceLayerTestContainers` is a read-only descriptor with no `__set__` and cannot be set [read-only]
@@ -777,7 +781,7 @@
 ERROR Generator function should return `Generator` [bad-return]
   --> tests/test_containers_integration_tests/repositories/test_workflow_run_repository.py:89:56
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/test_containers_integration_tests/services/auth/test_api_key_auth_service.py:196:16
+   --> tests/test_containers_integration_tests/services/auth/test_api_key_auth_service.py:202:16
 ERROR Could not find name `Session` [unknown-name]
   --> tests/test_containers_integration_tests/services/plugin/test_plugin_parameter_service.py:54:37
 ERROR Could not find name `Session` [unknown-name]
@@ -789,25 +793,25 @@
 ERROR Object of class `NoneType` has no attribute `open_id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_account_service.py:558:16
 ERROR Object of class `Tenant` has no attribute `role` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:1501:16
+    --> tests/test_containers_integration_tests/services/test_account_service.py:1503:16
 ERROR Argument `list[str]` is not assignable to parameter `roles` with type `list[TenantAccountRole]` in function `services.account_service.TenantService.has_roles` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:1698:45
+    --> tests/test_containers_integration_tests/services/test_account_service.py:1700:45
 ERROR Object of class `NoneType` has no attribute `role` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2070:16
+    --> tests/test_containers_integration_tests/services/test_account_service.py:2072:16
 ERROR Object of class `NoneType` has no attribute `role` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2128:16
+    --> tests/test_containers_integration_tests/services/test_account_service.py:2130:16
 ERROR Object of class `NoneType` has no attribute `role` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2129:16
+    --> tests/test_containers_integration_tests/services/test_account_service.py:2131:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2283:16
+    --> tests/test_containers_integration_tests/services/test_account_service.py:2285:16
 ERROR Argument `dict[str, str | dict[str, bool]]` is not assignable to parameter `value` with type `TenantCustomConfigDict` in function `models.account.Tenant.custom_config_dict` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2461:37
+    --> tests/test_containers_integration_tests/services/test_account_service.py:2463:37
 ERROR TypedDict `TenantCustomConfigDict` does not have key `theme` [bad-typed-dict-key]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2469:33
+    --> tests/test_containers_integration_tests/services/test_account_service.py:2471:33
 ERROR TypedDict `TenantCustomConfigDict` does not have key `language` [bad-typed-dict-key]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2470:33
+    --> tests/test_containers_integration_tests/services/test_account_service.py:2472:33
 ERROR TypedDict `TenantCustomConfigDict` does not have key `feature_flags` [bad-typed-dict-key]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2471:33
+    --> tests/test_containers_integration_tests/services/test_account_service.py:2473:33
 ERROR Argument `dict[str, AppMode | str] | dict[str, str]` is not assignable to parameter `args` with type `AdvancedPromptTemplateArgs` in function `services.advanced_prompt_template_service.AdvancedPromptTemplateService.get_prompt` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_advanced_prompt_template_service.py:718:63
 ERROR Argument `dict[str, AppMode | str]` is not assignable to parameter `args` with type `AdvancedPromptTemplateArgs` in function `services.advanced_prompt_template_service.AdvancedPromptTemplateService.get_prompt` [bad-argument-type]
@@ -829,57 +833,45 @@
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_annotation_service.py:107:81
 ERROR Argument `dict[str, str | Unknown | None]` is not assignable to parameter `args` with type `InsertAnnotationArgs` in function `services.annotation_service.AppAnnotationService.insert_app_annotation_directly` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_annotation_service.py:244:65
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.annotation_service.AppAnnotationService.update_app_annotation_directly` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_annotation_service.py:292:13
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.annotation_service.AppAnnotationService.delete_app_annotation` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_annotation_service.py:580:94
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.annotation_service.AppAnnotationService.delete_app_annotation` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_annotation_service.py:613:65
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.annotation_service.AppAnnotationService.delete_app_annotation` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_annotation_service.py:629:17
+   --> tests/test_containers_integration_tests/services/test_annotation_service.py:247:17
 ERROR Object of class `str` has no attribute `decode` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_annotation_service.py:708:33
+   --> tests/test_containers_integration_tests/services/test_annotation_service.py:762:33
 ERROR Object of class `int` has no attribute `lower` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_annotation_service.py:927:27
+   --> tests/test_containers_integration_tests/services/test_annotation_service.py:996:27
 ERROR Object of class `int` has no attribute `lower` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_annotation_service.py:973:27
+    --> tests/test_containers_integration_tests/services/test_annotation_service.py:1044:27
 ERROR TypedDict `AnnotationSettingDisabledDict` does not have key `id` [bad-typed-dict-key]
-    --> tests/test_containers_integration_tests/services/test_annotation_service.py:1015:23
+    --> tests/test_containers_integration_tests/services/test_annotation_service.py:1086:23
 ERROR TypedDict `AnnotationSettingDisabledDict` does not have key `score_threshold` [bad-typed-dict-key]
-    --> tests/test_containers_integration_tests/services/test_annotation_service.py:1016:23
+    --> tests/test_containers_integration_tests/services/test_annotation_service.py:1087:23
 ERROR TypedDict `AnnotationSettingDisabledDict` does not have key `embedding_model` [bad-typed-dict-key]
-    --> tests/test_containers_integration_tests/services/test_annotation_service.py:1017:23
+    --> tests/test_containers_integration_tests/services/test_annotation_service.py:1088:23
 ERROR TypedDict `AnnotationSettingDisabledDict` does not have key `embedding_model` [bad-typed-dict-key]
-    --> tests/test_containers_integration_tests/services/test_annotation_service.py:1018:23
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.annotation_service.AppAnnotationService.update_app_annotation_directly` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_annotation_service.py:1251:13
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.annotation_service.AppAnnotationService.delete_app_annotation` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_annotation_service.py:1322:94
+    --> tests/test_containers_integration_tests/services/test_annotation_service.py:1089:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_api_based_extension_service.py:226:45
+   --> tests/test_containers_integration_tests/services/test_api_based_extension_service.py:226:17
 ERROR Argument `None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_api_based_extension_service.py:424:39
 ERROR Argument `None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_api_based_extension_service.py:431:34
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_api_based_extension_service.py:448:100
+   --> tests/test_containers_integration_tests/services/test_api_based_extension_service.py:448:72
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_api_based_extension_service.py:534:85
+   --> tests/test_containers_integration_tests/services/test_api_based_extension_service.py:535:17
 ERROR Argument `Literal['app']` is not assignable to parameter `value` with type `ApiTokenType | SQLCoreOperations[ApiTokenType]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_api_token_service.py:28:26
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_app_dsl_service.py:165:42
 ERROR Argument `Literal['simple']` is not assignable to parameter `prompt_type` with type `PromptType | SQLCoreOperations[PromptType]` in function `models.model.AppModelConfig.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_dsl_service.py:929:25
+   --> tests/test_containers_integration_tests/services/test_app_dsl_service.py:931:25
 ERROR Argument `Literal['workflow']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_dsl_service.py:952:20
+   --> tests/test_containers_integration_tests/services/test_app_dsl_service.py:954:20
 ERROR Argument `Literal['workflow']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_dsl_service.py:987:20
+   --> tests/test_containers_integration_tests/services/test_app_dsl_service.py:989:20
 ERROR Argument `Literal['workflow']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_app_dsl_service.py:1028:20
+    --> tests/test_containers_integration_tests/services/test_app_dsl_service.py:1032:20
 ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `dsl_dependencies` with type `list[PluginDependency]` in function `services.app_dsl_service.AppDslService.get_leaked_dependencies` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_app_dsl_service.py:1314:73
+    --> tests/test_containers_integration_tests/services/test_app_dsl_service.py:1326:73
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_app_generate_service.py:190:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -887,15 +879,15 @@
 ERROR Argument `Literal['invalid_mode']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_app_generate_service.py:568:20
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `services.app_generate_service.AppGenerateService.generate_single_loop` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_generate_service.py:811:64
+   --> tests/test_containers_integration_tests/services/test_app_generate_service.py:829:18
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `services.app_generate_service.AppGenerateService.generate_single_loop` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_generate_service.py:838:64
+   --> tests/test_containers_integration_tests/services/test_app_generate_service.py:861:18
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `services.app_generate_service.AppGenerateService.generate_single_loop` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_generate_service.py:864:68
+   --> tests/test_containers_integration_tests/services/test_app_generate_service.py:892:22
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_generate_service.py:914:23
+   --> tests/test_containers_integration_tests/services/test_app_generate_service.py:944:23
 ERROR Argument `Literal['agent-chat']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_app_generate_service.py:1050:20
+    --> tests/test_containers_integration_tests/services/test_app_generate_service.py:1080:20
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/services/test_app_service.py:87:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -912,172 +904,134 @@
    --> tests/test_containers_integration_tests/services/test_app_service.py:237:36
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_app_service.py:242:68
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:242:87
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_app_service.py:252:37
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_app_service.py:277:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:282:13
-ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:287:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:283:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:304:25
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:304:82
+   --> tests/test_containers_integration_tests/services/test_app_service.py:289:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:315:13
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:317:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:307:25
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:328:13
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:330:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:318:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:362:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:331:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:367:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:365:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:382:25
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:382:82
+   --> tests/test_containers_integration_tests/services/test_app_service.py:371:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:393:25
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:393:82
+   --> tests/test_containers_integration_tests/services/test_app_service.py:387:25
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:422:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:398:25
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_app_service.py:427:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:432:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:433:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:437:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:439:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:459:25
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_starred_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:459:89
+   --> tests/test_containers_integration_tests/services/test_app_service.py:445:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:472:13
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_starred_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:474:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:468:25
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:485:13
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_starred_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:487:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:481:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:538:43
+   --> tests/test_containers_integration_tests/services/test_app_service.py:494:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:539:49
+   --> tests/test_containers_integration_tests/services/test_app_service.py:547:43
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:543:25
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:543:82
+   --> tests/test_containers_integration_tests/services/test_app_service.py:549:13
+ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
+   --> tests/test_containers_integration_tests/services/test_app_service.py:554:25
 ERROR Object of class `NoneType` has no attribute `items` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:545:20
+   --> tests/test_containers_integration_tests/services/test_app_service.py:556:20
 ERROR Cannot index into `object` [bad-index]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:546:16
+   --> tests/test_containers_integration_tests/services/test_app_service.py:557:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:550:25
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:550:95
+   --> tests/test_containers_integration_tests/services/test_app_service.py:561:25
 ERROR Object of class `NoneType` has no attribute `items` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:552:20
+   --> tests/test_containers_integration_tests/services/test_app_service.py:563:20
 ERROR Cannot index into `object` [bad-index]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:553:26
+   --> tests/test_containers_integration_tests/services/test_app_service.py:564:26
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:558:13
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:560:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:569:13
 ERROR Object of class `NoneType` has no attribute `items` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:562:20
+   --> tests/test_containers_integration_tests/services/test_app_service.py:573:20
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:602:32
+   --> tests/test_containers_integration_tests/services/test_app_service.py:613:32
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:611:32
+   --> tests/test_containers_integration_tests/services/test_app_service.py:622:32
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:615:13
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:617:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:626:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:657:38
+   --> tests/test_containers_integration_tests/services/test_app_service.py:668:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:666:72
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:666:91
+   --> tests/test_containers_integration_tests/services/test_app_service.py:677:72
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:670:24
+   --> tests/test_containers_integration_tests/services/test_app_service.py:681:24
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:684:72
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:684:91
+   --> tests/test_containers_integration_tests/services/test_app_service.py:695:72
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:720:38
+   --> tests/test_containers_integration_tests/services/test_app_service.py:731:38
 ERROR Argument `dict[str, bool | str]` is not assignable to parameter `args` with type `AppService.ArgsDict` in function `services.app_service.AppService.update_app` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:744:55
+   --> tests/test_containers_integration_tests/services/test_app_service.py:755:55
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:781:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:792:13
 ERROR Missing required key `max_active_requests` for TypedDict `ArgsDict` [bad-typed-dict-key]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:800:17
+   --> tests/test_containers_integration_tests/services/test_app_service.py:812:17
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:834:13
+   --> tests/test_containers_integration_tests/services/test_app_service.py:847:13
 ERROR Missing required key `max_active_requests` for TypedDict `ArgsDict` [bad-typed-dict-key]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:854:21
+   --> tests/test_containers_integration_tests/services/test_app_service.py:868:21
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:895:38
+   --> tests/test_containers_integration_tests/services/test_app_service.py:910:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_app_service.py:949:38
+   --> tests/test_containers_integration_tests/services/test_app_service.py:964:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1010:38
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1027:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1070:38
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1087:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1130:38
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1147:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1181:38
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1198:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1194:70
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1211:70
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1233:38
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1250:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1256:70
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1273:70
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1293:38
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1310:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1332:38
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1349:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1372:38
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1389:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1453:13
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1470:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1468:13
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1486:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1483:13
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1502:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1499:13
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1519:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1515:25
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1515:94
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1536:25
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1525:13
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1527:13
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1546:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1537:13
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1539:13
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1558:13
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1548:25
-ERROR Argument `Session` is not assignable to parameter `session` with type `scoped_session[Unknown]` in function `services.app_service.AppService.get_paginate_apps` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1548:94
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1569:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1585:41
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1606:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_app_service.py:1599:41
+    --> tests/test_containers_integration_tests/services/test_app_service.py:1620:41
 ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
-  --> tests/test_containers_integration_tests/services/test_conversation_service_variables.py:47:18
+  --> tests/test_containers_integration_tests/services/test_conversation_service_variables.py:46:18
 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_dataset_permission_service.py:39: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]
@@ -1207,7 +1161,7 @@
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.LoadBalancingModelConfig.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_model_load_balancing_service.py:301:24
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.LoadBalancingModelConfig.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/test_model_load_balancing_service.py:420:24
+   --> tests/test_containers_integration_tests/services/test_model_load_balancing_service.py:428:24
 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_model_provider_service.py:55: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]
@@ -1223,7 +1177,7 @@
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/services/test_ops_service.py:60:13
 ERROR Argument `dict[str, Any] | dict[Unknown, Unknown] | object | None` is not assignable to parameter `tracing_config` with type `SQLCoreOperations[dict[str, Any] | None] | dict[str, Any] | None` in function `models.model.TraceAppConfig.__init__` [bad-argument-type]
-  --> tests/test_containers_integration_tests/services/test_ops_service.py:85:28
+  --> tests/test_containers_integration_tests/services/test_ops_service.py:86:28
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/services/test_saved_message_service.py:89:38
 ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
@@ -1281,7 +1235,7 @@
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/test_webhook_service_relationships.py:40:72
 ERROR Class `WebhookServiceRelationshipFactory` has no class attribute `_read_cache` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_webhook_service_relationships.py:516:26
+   --> tests/test_containers_integration_tests/services/test_webhook_service_relationships.py:517:26
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/test_workflow_app_service.py:102:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `log` with type `WorkflowAppLog` in function `services.workflow_app_service.LogView.__init__` [bad-argument-type]
@@ -1325,9 +1279,9 @@
 ERROR Argument `Literal['succeeded']` is not assignable to parameter `value` with type `SQLCoreOperations[WorkflowNodeExecutionStatus] | WorkflowNodeExecutionStatus` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_workflow_service.py:174:33
 ERROR Argument `Literal['invalid_mode']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_workflow_service.py:1293:20
+    --> tests/test_containers_integration_tests/services/test_workflow_service.py:1302:20
 ERROR Argument `dict[str, int]` 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:1647:26
+    --> tests/test_containers_integration_tests/services/test_workflow_service.py:1656: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]
@@ -1511,11 +1465,11 @@
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/workflow/test_workflow_converter.py:116:20
 ERROR Argument `AppModelConfig | None` is not assignable to parameter `app_model_config` with type `AppModelConfig` in function `services.workflow.workflow_converter.WorkflowConverter.convert_app_model_config_to_workflow` [bad-argument-type]
-   --> tests/test_containers_integration_tests/services/workflow/test_workflow_converter.py:326:30
+   --> tests/test_containers_integration_tests/services/workflow/test_workflow_converter.py:328:30
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/test_containers_integration_tests/services/workflow/test_workflow_converter.py:646:16
+   --> tests/test_containers_integration_tests/services/workflow/test_workflow_converter.py:651:16
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/test_containers_integration_tests/services/workflow/test_workflow_converter.py:654:16
+   --> tests/test_containers_integration_tests/services/workflow/test_workflow_converter.py:659:16
 ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
   --> tests/test_containers_integration_tests/services/workflow/test_workflow_deletion.py:38:18
 ERROR Cannot instantiate `DifyAPISQLAlchemyWorkflowNodeExecutionRepository` because the following members are abstract: `save`, `save_execution_data`, `get_by_workflow_execution` [bad-instantiation]
@@ -1931,87 +1885,87 @@
 ERROR No attribute `MethodView` in module `builtins` [missing-attribute]
  --> tests/unit_tests/controllers/common/test_fields.py:8:5
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:703:12
+   --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:715:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:704:12
+   --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:716:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:705:12
+   --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:717:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:706:12
+   --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:718:12
 ERROR `in` is not supported between `Literal['Incorrect API key provided']` and `None` [not-iterable]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1458:12
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1471:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_build_chat_finalization_message` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1544:26
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1557:26
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_build_chat_finalization_message` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1545:23
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1558:23
 ERROR Argument `test_drain_streaming_generate_response_returns_on_message_end.ClosableResponse` is not assignable to parameter `response` with type `Generator[str] | RateLimitGenerator` in function `controllers.console.app.completion._drain_streaming_generate_response` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1592:69
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1605:69
 ERROR Argument `Iterator[Any]` is not assignable to parameter `response` with type `Generator[str] | RateLimitGenerator` in function `controllers.console.app.completion._drain_streaming_generate_response` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1600:66
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1613:66
 ERROR Argument `Iterator[Any]` is not assignable to parameter `response` with type `Generator[str] | RateLimitGenerator` in function `controllers.console.app.completion._drain_streaming_generate_response` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1607:66
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1620:66
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1638:26
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1651:26
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1639:23
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1652:23
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1678:30
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1691:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1679:27
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1692:27
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1707:22
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1720:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1708:19
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1721:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1713:22
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1726:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1714:19
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1727:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1765:30
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1778:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1766:27
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1779:27
 ERROR Object of class `object` has no attribute `data` [missing-attribute]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1849:50
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1862:50
 ERROR Object of class `object` has no attribute `limit` [missing-attribute]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1850:30
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1863:30
 ERROR Object of class `object` has no attribute `has_more` [missing-attribute]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1851:33
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1864:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1863:67
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1876:67
 ERROR Object of class `object` has no attribute `data` [missing-attribute]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1889:50
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1902:50
 ERROR Object of class `object` has no attribute `limit` [missing-attribute]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1890:30
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1903:30
 ERROR Object of class `object` has no attribute `has_more` [missing-attribute]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1891:33
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1904:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1905:67
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1928:67
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account | None` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1905:91
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1928:91
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1925:27
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1949:27
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account | None` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1926:30
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1950:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.message._update_message_feedback` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1941:30
+    --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1965:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._update_message_feedback` [bad-argument-type]
-    --> tests/unit_tests/controllers/c\n\n... (truncated) ...

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 52.41% 52.50% +0.10%
Strict coverage 51.92% 52.02% +0.10%
Typed symbols 32,201 32,379 +178
Untyped symbols 29,518 29,565 +47
Modules 2976 2976 0

@autofix-ci autofix-ci Bot requested a review from crazywoola as a code owner June 30, 2026 14:47
@github-actions github-actions Bot added the web This relates to changes on the web. label Jun 30, 2026
@asukaminato0721 asukaminato0721 requested a review from cqjjjzr July 1, 2026 03:08
@github-actions github-actions Bot removed the web This relates to changes on the web. label Jul 1, 2026
@cqjjjzr cqjjjzr requested review from hj24 and zyssyz123 as code owners July 2, 2026 14:21
@asukaminato0721 asukaminato0721 force-pushed the db-session branch 3 times, most recently from 0bc4515 to 461a29f Compare July 6, 2026 10:21
@WH-2099 WH-2099 force-pushed the db-session branch 2 times, most recently from 50c5ba9 to a013204 Compare July 6, 2026 18:50
@WH-2099 WH-2099 self-assigned this Jul 6, 2026
WH-2099
WH-2099 previously approved these changes Jul 6, 2026
@asukaminato0721 asukaminato0721 added this pull request to the merge queue Jul 6, 2026
@cqjjjzr cqjjjzr removed this pull request from the merge queue due to a manual request Jul 6, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@cqjjjzr cqjjjzr requested a review from CourTeous33 as a code owner July 7, 2026 17:50
@cqjjjzr cqjjjzr requested a review from WH-2099 July 7, 2026 17:50
Comment thread api/commands/account.py
@asukaminato0721 asukaminato0721 enabled auto-merge July 8, 2026 03:06

@cqjjjzr cqjjjzr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be OK

@asukaminato0721 asukaminato0721 added this pull request to the merge queue Jul 8, 2026
Merged via the queue into langgenius:main with commit 68d8328 Jul 8, 2026
31 checks passed
@asukaminato0721 asukaminato0721 deleted the db-session branch July 8, 2026 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants