Skip to content

fix(api): use plain Session in MCP controller to avoid closed transac… - #39788

Open
qielanci wants to merge 8 commits into
langgenius:mainfrom
qielanci:fix/mcp-closed-transaction
Open

fix(api): use plain Session in MCP controller to avoid closed transac…#39788
qielanci wants to merge 8 commits into
langgenius:mainfrom
qielanci:fix/mcp-closed-transaction

Conversation

@qielanci

Copy link
Copy Markdown

…tion

MCP tools/call wraps AppGenerateService in sessionmaker().begin(), but generation paths commit internally, causing InvalidRequestError.

Summary

Root cause

Outer sessionmaker().begin() conflicts with internal session.commit() in Advanced Chat / Workflow generation (same class of bug as #39191 / #36392 ).

Test plan

  • Publish Advanced Chat / Workflow as MCP server
  • initialize / tools/list succeed
  • tools/call succeeds (no -32603 / InvalidRequestError)
  • Verified on self-hosted 1.16.1 before this PR

…tion

MCP tools/call wraps AppGenerateService in sessionmaker().begin(), but
generation paths commit internally, causing InvalidRequestError.
@qielanci
qielanci requested a review from QuantumGhost as a code owner July 30, 2026 04:22
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-08-01 03:28:08.371503611 +0000
+++ /tmp/pyrefly_pr.txt	2026-08-01 03:27:53.287515434 +0000
@@ -4294,13 +4294,17 @@
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:188:16
 ERROR Argument `None` is not assignable to parameter `app_id` with type `str` in function `core.callback_handler.index_tool_callback_handler.DatasetIndexToolCallbackHandler.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/callback_handler/test_index_tool_callback_handler.py:161:20
+  --> tests/unit_tests/core/callback_handler/test_index_tool_callback_handler.py:87:20
 ERROR Argument `None` is not assignable to parameter `message_id` with type `str` in function `core.callback_handler.index_tool_callback_handler.DatasetIndexToolCallbackHandler.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/callback_handler/test_index_tool_callback_handler.py:162:24
+  --> tests/unit_tests/core/callback_handler/test_index_tool_callback_handler.py:88:24
 ERROR Argument `None` is not assignable to parameter `user_id` with type `str` in function `core.callback_handler.index_tool_callback_handler.DatasetIndexToolCallbackHandler.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/callback_handler/test_index_tool_callback_handler.py:163:21
+  --> tests/unit_tests/core/callback_handler/test_index_tool_callback_handler.py:89:21
 ERROR Argument `None` is not assignable to parameter `invoke_from` with type `InvokeFrom` in function `core.callback_handler.index_tool_callback_handler.DatasetIndexToolCallbackHandler.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/callback_handler/test_index_tool_callback_handler.py:164:25
+  --> tests/unit_tests/core/callback_handler/test_index_tool_callback_handler.py:90:25
+ERROR Argument `None` is not assignable to parameter `query` with type `str` in function `core.callback_handler.index_tool_callback_handler.DatasetIndexToolCallbackHandler.on_query` [bad-argument-type]
+  --> tests/unit_tests/core/callback_handler/test_index_tool_callback_handler.py:93:26
+ERROR Argument `None` is not assignable to parameter `dataset_id` with type `str` in function `core.callback_handler.index_tool_callback_handler.DatasetIndexToolCallbackHandler.on_query` [bad-argument-type]
+  --> tests/unit_tests/core/callback_handler/test_index_tool_callback_handler.py:93:32
 ERROR Argument `list[DummyToolInvokeMessage]` is not assignable to parameter `tool_outputs` with type `Iterable[ToolInvokeMessage]` in function `core.callback_handler.workflow_tool_callback_handler.DifyWorkflowCallbackHandler.on_tool_execution` [bad-argument-type]
   --> tests/unit_tests/core/callback_handler/test_workflow_tool_callback_handler.py:55:30
 ERROR Argument `list[DummyToolInvokeMessage]` is not assignable to parameter `tool_outputs` with type `Iterable[ToolInvokeMessage]` in function `core.callback_handler.workflow_tool_callback_handler.DifyWorkflowCallbackHandler.on_tool_execution` [bad-argument-type]
@@ -4448,8 +4452,6 @@
    --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:192:16
 ERROR `in` is not supported between `str` and `None` [not-iterable]
    --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:203:16
-ERROR Argument `() -> Session` is not assignable to parameter `session_factory` with type `sessionmaker[@_]` in function `sqlalchemy.orm.scoping.scoped_session.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/llm_generator/test_llm_generator.py:37:31
 ERROR Object of class `NoneType` has no attribute `split` [missing-attribute]
   --> tests/unit_tests/core/logging/test_trace_helpers.py:76:21
 ERROR Object of class `JSONRPCNotification` has no attribute `id` [missing-attribute]
@@ -4532,60 +4534,36 @@
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:22:9
 ERROR Method `trace` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:23:9
+ERROR `None` is not subscriptable [unsupported-operation]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:316:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:356:12
-ERROR Argument `AppModelConfig | Any | None` is not assignable to parameter `s` with type `bytearray | bytes | str` in function `json.loads` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:362:23
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:406:12
-ERROR Object of class `dict` has no attribute `conversation_mode` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:407:12
-ERROR Object of class `dict` has no attribute `file_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:408:12
-ERROR Object of class `dict` has no attribute `metadata` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:409:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:436:12
-ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:437:12
-ERROR Object of class `dict` has no attribute `inputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:438:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:388:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:440:12
-ERROR Object of class `dict` has no attribute `suggested_question` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:441:12
-ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:460:12
-ERROR Object of class `dict` has no attribute `metadata` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:461:12
-ERROR Cannot instantiate `DifyAPISQLAlchemyWorkflowRunRepository` because the following members are abstract: `save` [bad-instantiation]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:503:50
+ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:468:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
-ERROR Object of class `dict` has no attribute `workflow_app_log_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:511:12
-ERROR Object of class `dict` has no attribute `prompt_tokens` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:512:12
-ERROR Object of class `dict` has no attribute `completion_tokens` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:513:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:480:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:481:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
+ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:497:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:536:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:507:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:537:12
-ERROR Object of class `dict` has no attribute `message_file_data` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:538:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:560:12
-ERROR Object of class `dict` has no attribute `metadata` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:561:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:508:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:579:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:518:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:580:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:519:12
+ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:583:28
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
 ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
@@ -4922,6 +4900,10 @@
    --> tests/unit_tests/core/rag/embedding/test_embedding_base.py:201:23
 ERROR Object of class `PartialImpl` has no attribute `aembed_query` [missing-attribute]
    --> tests/unit_tests/core/rag/embedding/test_embedding_base.py:222:23
+ERROR Argument `None` is not assignable to parameter `orig` with type `BaseException` in function `sqlalchemy.exc.DBAPIError.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/rag/embedding/test_embedding_service.py:560:85
+ERROR Argument `list[LiteralString]` is not assignable to parameter `texts` with type `list[str]` in function `core.rag.embedding.cached_embedding.CacheEmbedding.embed_documents` [bad-argument-type]
+    --> tests/unit_tests/core/rag/embedding/test_embedding_service.py:1323:54
 ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
   --> tests/unit_tests/core/rag/extractor/test_excel_extractor.py:16:56
 ERROR No matching overload found for function `core.rag.extractor.extract_processor.ExtractProcessor.load_from_upload_file` called with arguments: (upload_file=SimpleNamespace, return_text=Literal[False]) [no-matching-overload]
@@ -5044,6 +5026,8 @@
    --> tests/unit_tests/core/repositories/test_sqlalchemy_workflow_node_execution_repository.py:687:61
 ERROR Cannot index into `dict[str, WorkflowNodeExecutionModel]` [bad-index]
    --> tests/unit_tests/core/repositories/test_sqlalchemy_workflow_node_execution_repository.py:700:39
+ERROR Argument `None` is not assignable to parameter `orig` with type `BaseException` in function `sqlalchemy.exc.DBAPIError.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/repositories/test_workflow_node_execution_conflict_handling.py:187:18
 ERROR Cannot index into `bool` [bad-index]
   --> tests/unit_tests/core/schemas/test_resolver.py:42:16
 ERROR Cannot index into `float` [bad-index]
@@ -5543,28 +5527,26 @@
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
   --> tests/unit_tests/core/tools/test_tool_file_manager.py:30:56
-ERROR Argument `Literal['openapi']` is not assignable to parameter `schema_type_str` with type `ApiProviderSchemaType | SQLCoreOperations[ApiProviderSchemaType]` in function `models.tools.ApiToolProvider.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/tools/test_tool_manager.py:86:25
 ERROR `SimpleNamespace` is not assignable to attribute `entity` with type `ToolProviderEntityWithPlugin` [bad-assignment]
-   --> tests/unit_tests/core/tools/test_tool_manager.py:406:32
+   --> tests/unit_tests/core/tools/test_tool_manager.py:300:32
 ERROR Argument `SimpleNamespace` is not assignable to parameter `agent_tool` with type `AgentToolEntity` in function `core.tools.tool_manager.ToolManager.get_agent_tool_runtime` [bad-argument-type]
-   --> tests/unit_tests/core/tools/test_tool_manager.py:540:32
+   --> tests/unit_tests/core/tools/test_tool_manager.py:438:32
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_tool` with type `WorkflowToolRuntimeSpec` in function `core.tools.tool_manager.ToolManager.get_workflow_tool_runtime` [bad-argument-type]
-   --> tests/unit_tests/core/tools/test_tool_manager.py:587:35
+   --> tests/unit_tests/core/tools/test_tool_manager.py:485:35
 ERROR Argument `SimpleNamespace` is not assignable to parameter `agent_tool` with type `AgentToolEntity` in function `core.tools.tool_manager.ToolManager.get_agent_tool_runtime` [bad-argument-type]
-   --> tests/unit_tests/core/tools/test_tool_manager.py:623:36
+   --> tests/unit_tests/core/tools/test_tool_manager.py:521:36
 ERROR Cannot set item in `dict[str, I18nObject | None]` [unsupported-operation]
-   --> tests/unit_tests/core/tools/test_tool_manager.py:729:55
+   --> tests/unit_tests/core/tools/test_tool_manager.py:627:55
 ERROR `SimpleNamespace` is not assignable to attribute `entity` with type `ToolProviderEntityWithPlugin` [bad-assignment]
-   --> tests/unit_tests/core/tools/test_tool_manager.py:819:32
+   --> tests/unit_tests/core/tools/test_tool_manager.py:654:32
 ERROR Argument `Literal['']` is not assignable to parameter `typ` with type `Literal['api', 'builtin', 'mcp', 'workflow'] | None` in function `core.tools.tool_manager.ToolManager.list_providers_from_api` [bad-argument-type]
-   --> tests/unit_tests/core/tools/test_tool_manager.py:864:96
+   --> tests/unit_tests/core/tools/test_tool_manager.py:678:97
 ERROR `SimpleNamespace` is not assignable to attribute `entity` with type `ToolProviderEntityWithPlugin` [bad-assignment]
-    --> tests/unit_tests/core/tools/test_tool_manager.py:1015:30
+   --> tests/unit_tests/core/tools/test_tool_manager.py:839:30
 ERROR `SimpleNamespace` is not assignable to attribute `entity` with type `ToolProviderEntityWithPlugin` [bad-assignment]
-    --> tests/unit_tests/core/tools/test_tool_manager.py:1039:30
+   --> tests/unit_tests/core/tools/test_tool_manager.py:863:30
 ERROR Cannot index into `str` [bad-index]
-    --> tests/unit_tests/core/tools/test_tool_manager.py:1044:20
+   --> tests/unit_tests/core/tools/test_tool_manager.py:868:20
 ERROR Class member `_DummyTool._invoke` overrides parent class `Tool` in an inconsistent manner [bad-override]
   --> tests/unit_tests/core/tools/test_tool_provider_controller.py:30:9
 ERROR Class member `_DummyTool.tool_provider_type` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
@@ -5915,10 +5897,6 @@
    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_agent_node.py:783:13
 ERROR Attribute `graph_execution` of class `GraphRuntimeState` is a read-only property and cannot be set [read-only]
    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_agent_node.py:864:5
-ERROR Object of class `Executable` has no attribute `compile` [missing-attribute]
-   --> tests/unit_tests/core/workflow/nodes/agent_v2/test_binding_resolver.py:229:26
-ERROR Object of class `Executable` has no attribute `compile` [missing-attribute]
-   --> tests/unit_tests/core/workflow/nodes/agent_v2/test_binding_resolver.py:230:34
 ERROR Class member `FakeTool.tool_provider_type` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> tests/unit_tests/core/workflow/nodes/agent_v2/test_dify_tools_builder.py:73:9
 ERROR Class member `FakeTool._invoke` overrides parent class `Tool` in an inconsistent manner [bad-override]
@@ -7074,60 +7052,288 @@
    --> tests/unit_tests/services/agent/test_agent_dsl_service.py:579:17
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `services.agent.dsl_service.AgentDslService._create_workflow_only_agent` [bad-argument-type]
    --> tests/unit_tests/services/agent/test_agent_dsl_service.py:602:18
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.load_workflow_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:206:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.load_workflow_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:247:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.load_workflow_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:280:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.load_workflow_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:324:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._workflow_inline_debug_conversation_id` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:352:17
 ERROR Argument `SimpleNamespace` is not assignable to parameter `binding` with type `WorkflowAgentNodeBinding` in function `services.agent.composer_service.AgentComposerService._workflow_inline_debug_conversation_id` [bad-argument-type]
-   --> tests/unit_tests/services/agent/test_agent_services.py:402:17
+   --> tests/unit_tests/services/agent/test_agent_services.py:354:17
 ERROR Argument `SimpleNamespace` is not assignable to parameter `agent` with type `Agent | None` in function `services.agent.composer_service.AgentComposerService._workflow_inline_debug_conversation_id` [bad-argument-type]
-   --> tests/unit_tests/services/agent/test_agent_services.py:403:15
+   --> tests/unit_tests/services/agent/test_agent_services.py:355:15
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._workflow_inline_debug_conversation_id` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:377:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `binding` with type `WorkflowAgentNodeBinding` in function `services.agent.composer_service.AgentComposerService._workflow_inline_debug_conversation_id` [bad-argument-type]
-   --> tests/unit_tests/services/agent/test_agent_services.py:429:21
+   --> tests/unit_tests/services/agent/test_agent_services.py:379:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `agent` with type `Agent | None` in function `services.agent.composer_service.AgentComposerService._workflow_inline_debug_conversation_id` [bad-argument-type]
-   --> tests/unit_tests/services/agent/test_agent_services.py:430:19
+   --> tests/unit_tests/services/agent/test_agent_services.py:380:19
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._workflow_inline_debug_conversation_id` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:387:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `binding` with type `WorkflowAgentNodeBinding` in function `services.agent.composer_service.AgentComposerService._workflow_inline_debug_conversation_id` [bad-argument-type]
-   --> tests/unit_tests/services/agent/test_agent_services.py:439:21
+   --> tests/unit_tests/services/agent/test_agent_services.py:389:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `agent` with type `Agent | None` in function `services.agent.composer_service.AgentComposerService._workflow_inline_debug_conversation_id` [bad-argument-type]
-   --> tests/unit_tests/services/agent/test_agent_services.py:440:19
-ERROR Object of class `NoneType` has no attribute `agent_workspace_binding_id` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:1278:12
+   --> tests/unit_tests/services/agent/test_agent_services.py:390:19
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.load_workflow_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:404:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.save_workflow_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:467:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.save_workflow_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:534:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.save_workflow_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:557:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.save_agent_app_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:628:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.load_agent_app_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:666:67
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.save_agent_app_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:684:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.save_agent_app_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:729:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.save_agent_app_composer` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:782:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.publish_agent_app_draft` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:833:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.publish_agent_app_draft` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:886:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.publish_agent_app_draft` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:946:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.publish_agent_app_draft` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:952:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.checkout_agent_app_build_draft` [bad-argument-type]
+   --> tests/unit_tests/services/agent/test_agent_services.py:993:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.apply_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1026:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.checkout_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1114:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.checkout_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1126:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.checkout_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1192:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.apply_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1269:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.apply_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1375:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.apply_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1429:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.apply_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1485:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.apply_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1533:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.apply_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1593:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.apply_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1649:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.apply_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1719:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.save_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1762:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.discard_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1773:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.discard_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1813:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.discard_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1845:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.discard_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1871:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.load_agent_soul_for_debug` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1924:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.load_agent_soul_for_debug` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:1949:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.apply_agent_app_build_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2005:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.get_workflow_candidates` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2038:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.get_agent_app_candidates` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2045:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.calculate_impact` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2048:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._serialize_workflow_state` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2088:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._serialize_workflow_state` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2130:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._serialize_workflow_state` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2178:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._save_node_job_only` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2258:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._save_node_job_only` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2268:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._save_as_new_agent` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2278:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._save_to_roster` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2288:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._save_as_new_version` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2302:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._save_node_job_only` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2415:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.get_or_create_normal_agent_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2474:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.get_or_create_normal_agent_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2514:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._save_node_job_only` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2561:17
 ERROR Object of class `object` has no attribute `prompt` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:2728:12
-ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/services/agent/test_agent_services.py:2918:12
-ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/services/agent/test_agent_services.py:2919:12
-ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/services/agent/test_agent_services.py:2920:12
-ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/services/agent/test_agent_services.py:2922:12
-ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/services/agent/test_agent_services.py:2923:12
-ERROR Argument `list[str | None]` is not assignable to parameter `version_ids` with type `list[str]` in function `services.agent.roster_service.AgentRosterService._load_versions_by_id` [bad-argument-type]
-    --> tests/unit_tests/services/agent/test_agent_services.py:4252:52
-ERROR Object of class `NoneType` has no attribute `conversation_id` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5145:16
+    --> tests/unit_tests/services/agent/test_agent_services.py:2582:12
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._save_node_job_only` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2612:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._save_node_job_only` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2660:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.copy_workflow_composer_from_roster` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2748:17
+ERROR Cannot index into `object` [bad-index]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2762:12
+ERROR Cannot index into `object` [bad-index]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2763:12
+ERROR Cannot index into `object` [bad-index]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2764:12
+ERROR Cannot index into `object` [bad-index]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2766:12
+ERROR Cannot index into `object` [bad-index]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2767:12
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.copy_workflow_composer_from_roster` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2810:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.copy_workflow_composer_from_roster` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2851:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.copy_workflow_composer_from_roster` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2904:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.copy_workflow_composer_from_roster` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:2985:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._copy_agent_drive_rows` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3041:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._copy_agent_drive_rows` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3068:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._copy_agent_drive_rows` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3095:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._create_workflow_only_agent` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3200:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._create_roster_agent_for_composer` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3209:17
+ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._require_account` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3239:58
+ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._require_account` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3246:55
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._create_roster_agent_for_composer` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3262:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._create_roster_agent_for_composer` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3295:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._agent_soul_matches_active_config` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3320:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._agent_soul_matches_active_config` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3345:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._create_config_version` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3373:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._update_current_version` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3383:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._get_draft_workflow` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3397:65
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._get_draft_workflow` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3400:58
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._require_agent` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3402:53
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._require_agent` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3405:53
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._get_agent_if_present` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3406:63
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._require_version` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3409:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._require_version` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3418:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._save_to_current_version` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3458:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._save_as_new_agent` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:3473:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.app_service.AppService._build_app_list_filters` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:4311:61
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.app_service.AppService._build_app_list_filters` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:4320:63
 ERROR Object of class `object` has no attribute `name` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5362:16
+    --> tests/unit_tests/services/agent/test_agent_services.py:4974:16
 ERROR Object of class `object` has no attribute `mode` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5363:16
+    --> tests/unit_tests/services/agent/test_agent_services.py:4975:16
 ERROR Object of class `object` has no attribute `agent_role` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5364:16
+    --> tests/unit_tests/services/agent/test_agent_services.py:4976:16
 ERROR Object of class `object` has no attribute `config_snapshot` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5374:16
+    --> tests/unit_tests/services/agent/test_agent_services.py:4986:16
 ERROR Object of class `object` has no attribute `home_snapshot_id` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5376:16
+    --> tests/unit_tests/services/agent/test_agent_services.py:4988:16
 ERROR Object of class `object` has no attribute `summary` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5377:16
+    --> tests/unit_tests/services/agent/test_agent_services.py:4989:16
 ERROR Object of class `object` has no attribute `version_note` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5378:16
+    --> tests/unit_tests/services/agent/test_agent_services.py:4990:16
 ERROR Object of class `object` has no attribute `active_config_has_model` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5379:16
+    --> tests/unit_tests/services/agent/test_agent_services.py:4991:16
 ERROR Object of class `object` has no attribute `updated_by` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5380:16
-ERROR Object of class `object` has no attribute `id` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5381:35
+    --> tests/unit_tests/services/agent/test_agent_services.py:4992:16
 ERROR Object of class `object` has no attribute `agent_role` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_agent_services.py:5446:16
+    --> tests/unit_tests/services/agent/test_agent_services.py:5056:16
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.sync_roster_agent_bindings_for_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5310:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.validate_agent_nodes_for_publish` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5337:25
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.validate_agent_nodes_for_publish` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5359:25
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.project_draft_bindings_to_graph` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5445:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.project_draft_bindings_to_graph` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5502:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.project_draft_bindings_to_graph` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5553:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.sync_roster_agent_bindings_for_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5606:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.sync_agent_bindings_for_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5701:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.sync_agent_bindings_for_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5751:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.sync_agent_bindings_for_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5803:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.sync_agent_bindings_for_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5839:25
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.sync_agent_bindings_for_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5872:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.sync_agent_bindings_for_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5922:25
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.sync_roster_agent_bindings_for_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:5982:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.workflow_publish_service.WorkflowAgentPublishService.sync_roster_agent_bindings_for_draft` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6052:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.knowledge_datasets.get_tenant_knowledge_dataset_rows` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6284:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.knowledge_datasets.get_tenant_knowledge_dataset_rows` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6291:54
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.validate_knowledge_datasets` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6326:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.validate_knowledge_datasets` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6363:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.save_agent_composer` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6421:17
+ERROR Argument `object` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._drive_mention_findings` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6510:17
+ERROR Argument `object` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._drive_mention_findings` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6526:21
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService._drive_mention_findings` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6540:17
+ERROR Argument `object` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.collect_validation_findings` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6563:17
+ERROR Argument `object` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.collect_validation_findings` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6574:17
+ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.resolve_bound_agent_id` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6586:64
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.resolve_workflow_node_agent_id` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6598:69
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.resolve_workflow_node_agent_id` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6607:69
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.resolve_workflow_node_agent_id` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6617:69
 ERROR Cannot set item in `dict[str, str]` [unsupported-operation]
-    --> tests/unit_tests/services/agent/test_agent_services.py:7202:31
+    --> tests/unit_tests/services/agent/test_agent_services.py:6664:31
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.save_workflow_composer` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6670:17
+ERROR Argument `FakeSession` is not assignable to parameter `session` with type `Session` in function `services.agent.composer_service.AgentComposerService.save_workflow_composer` [bad-argument-type]
+    --> tests/unit_tests/services/agent/test_agent_services.py:6732:17
 ERROR Object of class `NoneType` has no attribute `workflow_prompt` [missing-attribute]
    --> tests/unit_tests/services/agent/test_composer_mention_validation.py:113:5
 ERROR Argument `object` is not assignable to parameter `pwd` with type `bytes | None` in function `zipfile.ZipFile.read` [bad-argument-type]
@@ -7599,13 +7805,13 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.SegmentService.delete_child_chunk` [bad-argument-type]
    --> tests/unit_tests/services/test_dataset_service_segment.py:280:64
 ERROR Argument `SimpleNamespace` is not assignable to parameter `segment` with type `DocumentSegment` in function `services.dataset_service.SegmentService.update_child_chunk` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_segment.py:953:49
+   --> tests/unit_tests/services/test_dataset_service_segment.py:946:49
 ERROR Argument `SimpleNamespace` is not assignable to parameter `document` with type `Document` in function `services.dataset_service.SegmentService.update_child_chunk` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_segment.py:953:68
+   --> tests/unit_tests/services/test_dataset_service_segment.py:946:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.SegmentService.update_child_chunk` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_segment.py:953:87
+   --> tests/unit_tests/services/test_dataset_service_segment.py:946:87
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `services.dataset_service.SegmentService.delete_child_chunk` [bad-argument-type]
-   --> tests/unit_tests/services/test_dataset_service_segment.py:967:60
+   --> tests/unit_tests/services/test_dataset_service_segment.py:960:60
 ERROR Argument `str` is not assignable to parameter `type` with type `Literal['basic', 'bearer', 'custom'] | None` in function `services.entities.external_knowledge_entities.external_knowledge_entities.AuthorizationConfig.__init__` [bad-argument-type]
    --> tests/unit_tests/services/test_external_dataset_service.py:118:60
 ERROR Argument `str` is not assignable to parameter `type` with type `Literal['api-key', 'no-auth']` in function `services.entities.external_knowledge_entities.external_knowledge_entities.Authorization.__init__` [bad-argument-type]
@@ -8268,8 +8474,6 @@
    --> tests/unit_tests/services/workflow/test_workflow_converter_additional.py:867:71
 ERROR Argument `None` is not assignable to parameter `value` with type `SQLCoreOperations[bool] | bool` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
    --> tests/unit_tests/services/workflow/test_workflow_draft_variable_service.py:694:37
-ERROR Argument `None` is not assignable to parameter `value` with type `SQLCoreOperations[datetime] | datetime` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-   --> tests/unit_tests/services/workflow/test_workflow_event_snapshot_service.py:507:30
 ERROR Class member `_PauseEntity.id` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/services/workflow/test_workflow_event_snapshot_service_additional.py:157:9
 ERROR Class member `_PauseEntity.workflow_execution_id` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 57.32% 57.32% -0.00%
Strict coverage 56.85% 56.85% -0.00%
Typed symbols 37,550 37,549 -1
Untyped symbols 28,194 28,194 0
Modules 3092 3092 0

@qielanci

Copy link
Copy Markdown
Author

Updated with the latest main. Previous CI issues were from upstream, not this PR. Would appreciate a workflow re-run when possible — thanks!

@fatelei

fatelei commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

python style check failed

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 2, 2026
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 size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP tools/call fails with closed transaction inside sessionmaker().begin() on 1.16.1

3 participants