Skip to content

chore(api): upgrade graphon to v0.3.0#35469

Merged
asukaminato0721 merged 23 commits into
mainfrom
upgrade-graphon-to-0-3-0
May 9, 2026
Merged

chore(api): upgrade graphon to v0.3.0#35469
asukaminato0721 merged 23 commits into
mainfrom
upgrade-graphon-to-0-3-0

Conversation

@laipz8200
Copy link
Copy Markdown
Member

Summary

  • upgrade the backend Graphon dependency from 0.2.2 to 0.3.0
  • migrate Dify's model runtime and provider wiring to Graphon's runtime and model-type split
  • update workflow node construction and backend tests for the data= constructor API and VariablePool.from_bootstrap(...)
  • align document extractor and human input tests with Graphon 0.3.0 behavior changes

Issue

  • No linked issue number was provided for this upgrade request.

Screenshots

  • N/A (backend-only change)

@laipz8200 laipz8200 changed the title Upgrade Graphon to v0.3.0 chore(api): upgrade graphon to v0.3.0 Apr 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-21 16:04:45.040049319 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-21 16:04:36.150112487 +0000
@@ -24,6 +24,8 @@
    --> core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py:321:29
 ERROR Argument `list[Unknown]` is not assignable to parameter `value` with type `SQLCoreOperations[dict[str, Any]] | dict[str, Any]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
    --> core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py:388:27
+ERROR Object of class `QuestionClassifierNode` has no attribute `model_instance` [missing-attribute]
+   --> core/app/workflow/layers/llm_quota.py:119:38
 ERROR No matching overload found for function `core.model_manager.ModelInstance.invoke_llm` called with arguments: (prompt_messages=list[UserPromptMessage], model_parameters=dict[str, int], stream=Literal[False]) [no-matching-overload]
   --> core/llm_generator/llm_generator.py:85:60
 ERROR No matching overload found for function `core.model_manager.ModelInstance.invoke_llm` called with arguments: (prompt_messages=list[UserPromptMessage], model_parameters=dict[str, float | int], stream=Literal[False]) [no-matching-overload]
@@ -44,6 +46,10 @@
    --> core/llm_generator/llm_generator.py:582:60
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-override-param-name]
    --> core/ops/ops_trace_manager.py:206:9
+ERROR Class member `PluginModelRuntime.invoke_llm` overrides parent class `ModelRuntime` in an inconsistent manner [bad-override]
+   --> core/plugin/impl/model_runtime.py:198:9
+ERROR Cannot instantiate `PluginModelRuntime` because the following members are abstract: `invoke_llm_with_structured_output` [bad-instantiation]
+   --> core/plugin/impl/model_runtime_factory.py:116:30
 ERROR Cannot index into `set[Any]` [bad-index]
    --> core/rag/datasource/keyword/jieba/jieba.py:159:29
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._api.post` [bad-argument-type]
@@ -814,18 +820,82 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:651:21
 ERROR Object of class `TestWorkflowDraftVariableServiceResetVariable` has no attribute `_test_user_id` [missing-attribute]
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_code.py:49:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_code.py:50:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_code.py:51:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_code.py:52:9
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_http.py:59:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_http.py:60:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_http.py:61:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_http.py:62:9
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:208:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:209:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:210:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:211:9
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:706:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:707:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:708:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:709:9
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_llm.py:57:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_llm.py:65:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_llm.py:66:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_llm.py:67:9
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_parameter_extractor.py:60:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_parameter_extractor.py:63:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_parameter_extractor.py:64:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_parameter_extractor.py:65:9
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_template_transform.py:70:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_template_transform.py:71:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_template_transform.py:72:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_template_transform.py:73:9
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_tool.py:45:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_tool.py:46:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_tool.py:47:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_tool.py:48:9
 ERROR `dict[str, str | None]` is not assignable to attribute `env` with type `dict[str, str]` [bad-assignment]
    --> tests/test_containers_integration_tests/conftest.py:204:39
 ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `page` [bad-argument-type]
@@ -867,23 +937,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -944,6 +1014,12 @@
    --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:574:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:584:23
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:70:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:76:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:77:9
 ERROR Argument `Connection | Engine` is not assignable to parameter `session_factory` with type `Engine | sessionmaker[Unknown]` in function `core.repositories.sqlalchemy_workflow_execution_repository.SQLAlchemyWorkflowExecutionRepository.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:264:29
 ERROR Argument `Connection | Engine` is not assignable to parameter `session_factory` with type `Engine | sessionmaker[Unknown]` in function `core.repositories.sqlalchemy_workflow_node_execution_repository.SQLAlchemyWorkflowNodeExecutionRepository.__init__` [bad-argument-type]
@@ -2923,43 +2999,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3282,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3328,6 +3402,14 @@
   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_notifications.py:36:51
 ERROR Argument `_DummyWorkflowEntry` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_notifications.py:52:26
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_single_node.py:20:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_single_node.py:21:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_single_node.py:22:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_single_node.py:23:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:84:26
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AdvancedChatAppGenerateEntity | WorkflowAppGenerateEntity` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter.__init__` [bad-argument-type]
@@ -3419,101 +3501,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3633,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3897,45 +3979,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4106,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4257,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50

... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 0.00% 43.64% +43.64%
Strict coverage 0.00% 43.16% +43.16%
Typed symbols 0 21,937 +21,937
Untyped symbols 0 28,643 +28,643
Modules 0 2544 +2,544

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-21 16:04:45.040049319 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-21 16:04:36.150112487 +0000
@@ -24,6 +24,8 @@
    --> core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py:321:29
 ERROR Argument `list[Unknown]` is not assignable to parameter `value` with type `SQLCoreOperations[dict[str, Any]] | dict[str, Any]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
    --> core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py:388:27
+ERROR Object of class `QuestionClassifierNode` has no attribute `model_instance` [missing-attribute]
+   --> core/app/workflow/layers/llm_quota.py:119:38
 ERROR No matching overload found for function `core.model_manager.ModelInstance.invoke_llm` called with arguments: (prompt_messages=list[UserPromptMessage], model_parameters=dict[str, int], stream=Literal[False]) [no-matching-overload]
   --> core/llm_generator/llm_generator.py:85:60
 ERROR No matching overload found for function `core.model_manager.ModelInstance.invoke_llm` called with arguments: (prompt_messages=list[UserPromptMessage], model_parameters=dict[str, float | int], stream=Literal[False]) [no-matching-overload]
@@ -44,6 +46,10 @@
    --> core/llm_generator/llm_generator.py:582:60
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-override-param-name]
    --> core/ops/ops_trace_manager.py:206:9
+ERROR Class member `PluginModelRuntime.invoke_llm` overrides parent class `ModelRuntime` in an inconsistent manner [bad-override]
+   --> core/plugin/impl/model_runtime.py:198:9
+ERROR Cannot instantiate `PluginModelRuntime` because the following members are abstract: `invoke_llm_with_structured_output` [bad-instantiation]
+   --> core/plugin/impl/model_runtime_factory.py:116:30
 ERROR Cannot index into `set[Any]` [bad-index]
    --> core/rag/datasource/keyword/jieba/jieba.py:159:29
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._api.post` [bad-argument-type]
@@ -814,18 +820,82 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:651:21
 ERROR Object of class `TestWorkflowDraftVariableServiceResetVariable` has no attribute `_test_user_id` [missing-attribute]
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_code.py:49:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_code.py:50:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_code.py:51:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_code.py:52:9
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_http.py:59:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_http.py:60:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_http.py:61:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_http.py:62:9
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:208:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:209:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:210:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:211:9
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:706:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:707:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:708:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+   --> tests/integration_tests/workflow/nodes/test_http.py:709:9
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_llm.py:57:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_llm.py:65:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_llm.py:66:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_llm.py:67:9
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_parameter_extractor.py:60:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_parameter_extractor.py:63:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_parameter_extractor.py:64:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_parameter_extractor.py:65:9
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_template_transform.py:70:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_template_transform.py:71:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_template_transform.py:72:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_template_transform.py:73:9
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_tool.py:45:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_tool.py:46:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_tool.py:47:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/integration_tests/workflow/nodes/test_tool.py:48:9
 ERROR `dict[str, str | None]` is not assignable to attribute `env` with type `dict[str, str]` [bad-assignment]
    --> tests/test_containers_integration_tests/conftest.py:204:39
 ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `page` [bad-argument-type]
@@ -867,23 +937,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -944,6 +1014,12 @@
    --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:574:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:584:23
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:70:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:76:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:77:9
 ERROR Argument `Connection | Engine` is not assignable to parameter `session_factory` with type `Engine | sessionmaker[Unknown]` in function `core.repositories.sqlalchemy_workflow_execution_repository.SQLAlchemyWorkflowExecutionRepository.__init__` [bad-argument-type]
    --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:264:29
 ERROR Argument `Connection | Engine` is not assignable to parameter `session_factory` with type `Engine | sessionmaker[Unknown]` in function `core.repositories.sqlalchemy_workflow_node_execution_repository.SQLAlchemyWorkflowNodeExecutionRepository.__init__` [bad-argument-type]
@@ -2923,43 +2999,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3282,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3328,6 +3402,14 @@
   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_notifications.py:36:51
 ERROR Argument `_DummyWorkflowEntry` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_notifications.py:52:26
+ERROR Unexpected keyword argument `system_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_single_node.py:20:9
+ERROR Unexpected keyword argument `user_inputs` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_single_node.py:21:9
+ERROR Unexpected keyword argument `environment_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_single_node.py:22:9
+ERROR Unexpected keyword argument `conversation_variables` in function `graphon.runtime.variable_pool.VariablePool.__init__` [unexpected-keyword]
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_single_node.py:23:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:84:26
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AdvancedChatAppGenerateEntity | WorkflowAppGenerateEntity` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter.__init__` [bad-argument-type]
@@ -3419,101 +3501,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3633,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3897,45 +3979,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4106,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4257,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [\n\n... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-21 16:24:10.655781265 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-21 16:24:00.344881398 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3897,45 +3895,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4022,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4173,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4265,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5322,7 +5292,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5387,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5441,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/llm/test_llm_utils.py:744:29
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1216:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1217:9
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1246:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1247:9
 ERROR Argument `Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[LLMResultChunk | LLMStructuredOutput] | LLMResult` in function `graphon.nodes.llm.node.LLMNode.handle_invoke_result` [bad-argument-type]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1504:31
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1505:31
 ERROR Argument `Generator[None, Unknown]` is not assignable to parameter `invoke_result` with type `Generator[LLMResultChunk | LLMStructuredOutput] | LLMResult` in function `graphon.nodes.llm.node.LLMNode.handle_invoke_result` [bad-argument-type]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1541:31
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1542:31
 ERROR Missing argument `run_context` in function `core.app.llm.model_access.DifyCredentialsProvider.__init__` [missing-argument]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1733:32
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1734:32
 ERROR Missing argument `run_context` in function `core.app.llm.model_access.DifyModelFactory.__init__` [missing-argument]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1736:25
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1737:25
 ERROR `in` is not supported between `Literal['variables']` and `object` [not-iterable]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:145:16
 ERROR `in` is not supported between `Literal['template']` and `object` [not-iterable]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:146:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:147:16
+ERROR Object of class `NoneType` has no attribute `assert_called_once_with` [missing-attribute]
+   --> tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py:205:9
+ERROR Object of class `NoneType` has no attribute `assert_called_once_with` [missing-attribute]
+   --> tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py:211:9
 ERROR Argument `dict[str, list[dict[str, Any]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:330:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:333:19
 ERROR Argument `dict[str, list[dict[str, list[str] | str]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:395:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:398:19
 ERROR Argument `dict[str, list[dict[str, list[dict[str, list[str] | str]] | str]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:463:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:466:19
 ERROR `Literal['{invalid-json-schema']` is not assignable to attribute `json_schema` with type `dict[str, Any] | None` [bad-assignment]
    --> tests/unit_tests/core/workflow/nodes/test_start_node_json_object.py:208:28
-ERROR Returned type `VariableBase` is not assignable to declared return type `ArrayAnyVariable | ArrayBooleanVariable | ArrayFileVariable | ArrayNumberVariable | ArrayObjectVariable | ArrayStringVariable | BooleanVariable | FileVariable | FloatVariable | IntegerVariable | NoneVariable | ObjectVariable | SecretVariable | StringVariable` [bad-return]
-   --> tests/unit_tests/core/workflow/nodes/test_start_node_json_object.py:288:12
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]

... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-21 16:24:10.655781265 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-21 16:24:00.344881398 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3897,45 +3895,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4022,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4173,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4265,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5322,7 +5292,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5387,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5441,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/llm/test_llm_utils.py:744:29
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1216:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1217:9
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1246:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1247:9
 ERROR Argument `Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[LLMResultChunk | LLMStructuredOutput] | LLMResult` in function `graphon.nodes.llm.node.LLMNode.handle_invoke_result` [bad-argument-type]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1504:31
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1505:31
 ERROR Argument `Generator[None, Unknown]` is not assignable to parameter `invoke_result` with type `Generator[LLMResultChunk | LLMStructuredOutput] | LLMResult` in function `graphon.nodes.llm.node.LLMNode.handle_invoke_result` [bad-argument-type]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1541:31
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1542:31
 ERROR Missing argument `run_context` in function `core.app.llm.model_access.DifyCredentialsProvider.__init__` [missing-argument]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1733:32
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1734:32
 ERROR Missing argument `run_context` in function `core.app.llm.model_access.DifyModelFactory.__init__` [missing-argument]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1736:25
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1737:25
 ERROR `in` is not supported between `Literal['variables']` and `object` [not-iterable]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:145:16
 ERROR `in` is not supported between `Literal['template']` and `object` [not-iterable]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:146:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:147:16
+ERROR Object of class `NoneType` has no attribute `assert_called_once_with` [missing-attribute]
+   --> tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py:205:9
+ERROR Object of class `NoneType` has no attribute `assert_called_once_with` [missing-attribute]
+   --> tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py:211:9
 ERROR Argument `dict[str, list[dict[str, Any]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:330:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:333:19
 ERROR Argument `dict[str, list[dict[str, list[str] | str]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:395:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:398:19
 ERROR Argument `dict[str, list[dict[str, list[dict[str, list[str] | str]] | str]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:463:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:466:19
 ERROR `Literal['{invalid-json-schema']` is not assignable to attribute `json_schema` with type `dict[str, Any] | None` [bad-assignment]
    --> tests/unit_tests/core/workflow/nodes/test_start_node_json_object.py:208:28
-ERROR Returned type `VariableBase` is not assignable to declared return type `ArrayAnyVariable | ArrayBooleanVariable | ArrayFileVariable | ArrayNumberVariable | ArrayObjectVariable | ArrayStringVariable | BooleanVariable | FileVariable | FloatVariable | IntegerVariable | NoneVariable | ObjectVariable | SecretVariable | StringVariable` [bad-return]
-   --> tests/unit_tests/core/workflow/nodes/test_start_node_json_object.py:288:12
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --\n\n... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-21 16:36:29.144175072 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-21 16:36:17.681253268 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3897,45 +3895,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4022,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4173,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4265,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5322,7 +5292,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5387,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5441,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/llm/test_llm_utils.py:744:29
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1216:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1217:9
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1246:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1247:9
 ERROR Argument `Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[LLMResultChunk | LLMStructuredOutput] | LLMResult` in function `graphon.nodes.llm.node.LLMNode.handle_invoke_result` [bad-argument-type]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1504:31
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1505:31
 ERROR Argument `Generator[None, Unknown]` is not assignable to parameter `invoke_result` with type `Generator[LLMResultChunk | LLMStructuredOutput] | LLMResult` in function `graphon.nodes.llm.node.LLMNode.handle_invoke_result` [bad-argument-type]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1541:31
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1542:31
 ERROR Missing argument `run_context` in function `core.app.llm.model_access.DifyCredentialsProvider.__init__` [missing-argument]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1733:32
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1734:32
 ERROR Missing argument `run_context` in function `core.app.llm.model_access.DifyModelFactory.__init__` [missing-argument]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1736:25
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1737:25
 ERROR `in` is not supported between `Literal['variables']` and `object` [not-iterable]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:145:16
 ERROR `in` is not supported between `Literal['template']` and `object` [not-iterable]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:146:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:147:16
+ERROR Object of class `NoneType` has no attribute `assert_called_once_with` [missing-attribute]
+   --> tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py:205:9
+ERROR Object of class `NoneType` has no attribute `assert_called_once_with` [missing-attribute]
+   --> tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py:211:9
 ERROR Argument `dict[str, list[dict[str, Any]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:330:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:333:19
 ERROR Argument `dict[str, list[dict[str, list[str] | str]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:395:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:398:19
 ERROR Argument `dict[str, list[dict[str, list[dict[str, list[str] | str]] | str]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:463:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:466:19
 ERROR `Literal['{invalid-json-schema']` is not assignable to attribute `json_schema` with type `dict[str, Any] | None` [bad-assignment]
    --> tests/unit_tests/core/workflow/nodes/test_start_node_json_object.py:208:28
-ERROR Returned type `VariableBase` is not assignable to declared return type `ArrayAnyVariable | ArrayBooleanVariable | ArrayFileVariable | ArrayNumberVariable | ArrayObjectVariable | ArrayStringVariable | BooleanVariable | FileVariable | FloatVariable | IntegerVariable | NoneVariable | ObjectVariable | SecretVariable | StringVariable` [bad-return]
-   --> tests/unit_tests/core/workflow/nodes/test_start_node_json_object.py:288:12
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]

... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-21 16:36:29.144175072 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-21 16:36:17.681253268 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3897,45 +3895,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4022,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4173,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4265,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5322,7 +5292,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5387,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5441,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/llm/test_llm_utils.py:744:29
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1216:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1217:9
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1246:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1247:9
 ERROR Argument `Iterator[Any]` is not assignable to parameter `invoke_result` with type `Generator[LLMResultChunk | LLMStructuredOutput] | LLMResult` in function `graphon.nodes.llm.node.LLMNode.handle_invoke_result` [bad-argument-type]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1504:31
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1505:31
 ERROR Argument `Generator[None, Unknown]` is not assignable to parameter `invoke_result` with type `Generator[LLMResultChunk | LLMStructuredOutput] | LLMResult` in function `graphon.nodes.llm.node.LLMNode.handle_invoke_result` [bad-argument-type]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1541:31
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1542:31
 ERROR Missing argument `run_context` in function `core.app.llm.model_access.DifyCredentialsProvider.__init__` [missing-argument]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1733:32
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1734:32
 ERROR Missing argument `run_context` in function `core.app.llm.model_access.DifyModelFactory.__init__` [missing-argument]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1736:25
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1737:25
 ERROR `in` is not supported between `Literal['variables']` and `object` [not-iterable]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:145:16
 ERROR `in` is not supported between `Literal['template']` and `object` [not-iterable]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:146:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/nodes/template_transform/template_transform_node_spec.py:147:16
+ERROR Object of class `NoneType` has no attribute `assert_called_once_with` [missing-attribute]
+   --> tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py:205:9
+ERROR Object of class `NoneType` has no attribute `assert_called_once_with` [missing-attribute]
+   --> tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py:211:9
 ERROR Argument `dict[str, list[dict[str, Any]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:330:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:333:19
 ERROR Argument `dict[str, list[dict[str, list[str] | str]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:395:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:398:19
 ERROR Argument `dict[str, list[dict[str, list[dict[str, list[str] | str]] | str]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:463:19
+   --> tests/unit_tests/core/workflow/nodes/test_if_else.py:466:19
 ERROR `Literal['{invalid-json-schema']` is not assignable to attribute `json_schema` with type `dict[str, Any] | None` [bad-assignment]
    --> tests/unit_tests/core/workflow/nodes/test_start_node_json_object.py:208:28
-ERROR Returned type `VariableBase` is not assignable to declared return type `ArrayAnyVariable | ArrayBooleanVariable | ArrayFileVariable | ArrayNumberVariable | ArrayObjectVariable | ArrayStringVariable | BooleanVariable | FileVariable | FloatVariable | IntegerVariable | NoneVariable | ObjectVariable | SecretVariable | StringVariable` [bad-return]
-   --> tests/unit_tests/core/workflow/nodes/test_start_node_json_object.py:288:12
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --\n\n... (truncated) ...

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.84%. Comparing base (2bb1f09) to head (5aabe33).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #35469      +/-   ##
==========================================
+ Coverage   85.79%   85.84%   +0.04%     
==========================================
  Files        4460     4460              
  Lines      209507   209646     +139     
  Branches    39229    39242      +13     
==========================================
+ Hits       179755   179979     +224     
+ Misses      26554    26464      -90     
- Partials     3198     3203       +5     
Flag Coverage Δ
api 85.17% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 06:10:11.551335876 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 06:10:00.229375450 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,10 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+  --> tests/unit_tests/core/app/test_llm_quota.py:86:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:108:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3899,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4026,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4177,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4269,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5282,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:173:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:184:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5316,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5411,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5465,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/llm/test_llm_utils.py:744:29
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1216:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1217:9
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1246:9

... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 06:10:11.551335876 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 06:10:00.229375450 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,10 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+  --> tests/unit_tests/core/app/test_llm_quota.py:86:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:108:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3899,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4026,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4177,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4269,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5282,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:173:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:184:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5316,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5411,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5465,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/llm/test_llm_utils.py:744:29
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1216:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1217:9
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1246:9
+    --> tests/unit_tests/core/workflow/nodes\n\n... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 06:21:36.344195255 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 06:21:25.362158658 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,10 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:147:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:186:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3899,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4026,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4177,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4269,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5282,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:173:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:184:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5316,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5411,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5465,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/llm/test_llm_utils.py:744:29
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1216:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1217:9
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1246:9

... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 06:21:36.344195255 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 06:21:25.362158658 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,10 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:147:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:186:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3899,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4026,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4177,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4269,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5282,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:173:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:184:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5316,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5411,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5465,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/llm/test_llm_utils.py:744:29
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1216:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1217:9
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1246:9
+    --> tests/unit_tests/core/workflow/nod\n\n... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 06:23:41.456680998 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 06:23:31.057533520 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,10 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:147:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:186:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3899,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4026,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4177,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4269,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5282,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:173:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:184:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5316,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5411,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5465,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/llm/test_llm_utils.py:744:29
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1216:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1217:9
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1246:9

... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 06:23:41.456680998 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 06:23:31.057533520 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,10 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:147:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:186:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3899,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4026,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4177,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4269,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5282,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:173:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:184:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5316,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5411,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5465,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/llm/test_llm_utils.py:744:29
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1216:9
+    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1217:9
 ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
-    --> tests/unit_tests/core/workflow/nodes/llm/test_node.py:1246:9
+    --> tests/unit_tests/core/workflow/nod\n\n... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 06:33:09.140597996 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 06:32:57.903579484 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,14 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:128:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:149:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:168:28
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:195:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3903,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4030,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4181,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4273,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5286,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:173:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:184:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5320,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5415,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5469,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]

... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 06:33:09.140597996 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 06:32:57.903579484 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,14 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:128:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:149:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:168:28
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:195:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3903,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4030,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4181,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4273,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5286,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:173:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:184:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5320,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5415,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5469,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/\n\n... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 06:44:57.594820667 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 06:44:46.099643950 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,14 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:128:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:149:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:168:28
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:195:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3903,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4030,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4181,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4273,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5286,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:176:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:197:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5320,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5415,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5469,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]

... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 06:44:57.594820667 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 06:44:46.099643950 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,14 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:128:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:149:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:168:28
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:195:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3903,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4030,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4181,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4273,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5286,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:176:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:197:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5320,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5415,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5469,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/\n\n... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 18:07:15.998475496 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 18:07:04.377664974 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,14 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:408:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:429:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:448:28
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:475:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3903,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4030,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4181,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4273,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5286,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:176:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:197:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5320,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5415,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5469,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]

... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 18:07:15.998475496 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 18:07:04.377664974 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,14 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:408:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:429:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:448:28
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:475:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3903,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4030,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4181,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4273,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5286,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:176:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:197:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5320,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5415,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5469,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/\n\n... (truncated) ...

@laipz8200 laipz8200 force-pushed the upgrade-graphon-to-0-3-0 branch from 472c06c to a4c942a Compare April 22, 2026 18:08
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 18:09:28.786657979 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 18:09:16.856613208 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,14 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:408:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:429:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:448:28
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:475:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3903,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4030,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4181,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4273,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5286,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:176:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:197:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5320,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5415,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5469,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]

... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-22 18:09:28.786657979 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-22 18:09:16.856613208 +0000
@@ -816,13 +816,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -867,23 +867,23 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:36:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -2923,43 +2923,43 @@
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:258:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:323:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:325:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:324:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:326:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:329:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:331:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:330:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:332:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:361:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:363:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:396:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:398:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:402:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:404:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:423:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:425:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:452:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:454:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:465:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:467:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:466:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:468:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:535:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:539:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:543:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:547:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:568:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:574:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:569:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:575:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:570:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:576:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:592:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:40:34
 ERROR Cannot index into `str` [bad-index]
@@ -3206,8 +3206,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:42:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:92:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:226:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3419,101 +3417,101 @@
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:243:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:265:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:285:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:287:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:292:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:294:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:295:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:296:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:297:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:298:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:299:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:301:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:300:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:302:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:392:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:394:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:448:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:450:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:449:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:451:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:452:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:454:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:461:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:463:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:465:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:467:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:468:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:470:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:490:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:534:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:536:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:544:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:546:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:581:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:583:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:671:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:673:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:676:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:678:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:682:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:684:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:708:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:712:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:716:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:720:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:735:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:741:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:744:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:743:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:749:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:751:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:760:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:768:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:761:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:769:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:777:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:776:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:779:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:787:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:782:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:790:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:788:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:791:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:799:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:804:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:805:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:808:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:821:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:817:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:833:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
@@ -3551,11 +3549,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3844,6 +3842,14 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, dict[str, float | list[str]] | str]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:408:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:429:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:448:28
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:475:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3897,45 +3903,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:208:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:166:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -4024,21 +4030,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:862:31
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:894:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record` with type `ProviderCredential | ProviderModelCredential` in function `core.entities.provider_configuration.ProviderConfiguration._update_load_balancing_configs_with_credential` [bad-argument-type]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:880:27
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:912:27
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:995:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1027:12
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:996:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1028:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1012:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1044:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1497:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1533:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1688:12
+    --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:1725:12
 ERROR Object of class `ModuleType` has no attribute `MockExtension` [missing-attribute]
   --> tests/unit_tests/core/extension/test_extensible.py:62:9
 ERROR Cannot index into `OrderedDict[str, Unknown]` [bad-index]
@@ -4175,36 +4181,10 @@
    --> tests/unit_tests/core/mcp/test_types.py:380:16
 ERROR Argument `Literal['1.0']` is not assignable to parameter `jsonrpc` with type `Literal['2.0']` in function `core.mcp.types.JSONRPCRequest.__init__` [bad-argument-type]
    --> tests/unit_tests/core/mcp/test_types.py:458:25
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:76:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:101:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:122:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:136:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:145:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:175:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:199:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:217:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:245:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:261:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:297:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:317:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:349:50
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:390:23
-ERROR Argument `_FakeModelRuntime` is not assignable to parameter `model_runtime` with type `ModelRuntime` in function `graphon.model_runtime.model_providers.model_provider_factory.ModelProviderFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:408:23
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:401:17
+ERROR Argument `_FakeModelRuntime` is not assignable to parameter `runtime` with type `ModelRuntime` in function `core.plugin.impl.model_runtime_factory.create_model_type_instance` [bad-argument-type]
+   --> tests/unit_tests/core/model_runtime/test_model_provider_factory.py:422:21
 ERROR Missing argument `text` in function `core.moderation.api.api.ModerationOutputParams.__init__` [missing-argument]
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
@@ -4293,8 +4273,6 @@
    --> tests/unit_tests/core/plugin/impl/test_trigger_client.py:192:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `tenant` with type `Tenant` in function `core.plugin.backwards_invocation.model.PluginModelBackwardsInvocation.invoke_summary` [bad-argument-type]
   --> tests/unit_tests/core/plugin/test_backwards_invocation_model.py:54:72
-ERROR Unexpected keyword argument `user_id` in function `core.plugin.impl.model_runtime.PluginModelRuntime.invoke_llm` [unexpected-keyword]
-   --> tests/unit_tests/core/plugin/test_model_runtime_adapter.py:193:17
 ERROR Argument `Literal[123]` is not assignable to parameter `value` with type `bytearray | bytes | str` in function `core.plugin.entities.parameters.PluginParameterOption.__init__` [bad-argument-type]
    --> tests/unit_tests/core/plugin/test_plugin_entities.py:120:46
 ERROR Argument `TestPluginDaemonEntities.test_credential_type_helpers._FakeCredential` is not assignable to parameter `self` with type `CredentialType` in function `core.plugin.entities.plugin_daemon.CredentialType.get_name` [bad-argument-type]
@@ -5308,6 +5286,26 @@
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:205:16
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/context/test_flask_app_context.py:207:26
+ERROR Default `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` [bad-function-definition]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:37:50
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:49:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:65:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:81:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:92:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:108:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:132:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:155:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:176:34
+ERROR Argument `str` is not assignable to parameter `node_type` with type `BuiltinNodeTypes` in function `_build_node` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/layers/test_llm_quota.py:197:34
 ERROR Could not find name `NodeType` [unknown-name]
   --> tests/unit_tests/core/workflow/graph_engine/test_mock_config.py:39:27
 ERROR Could not find name `NodeType` [unknown-name]
@@ -5322,7 +5320,7 @@
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_factory.py:162:44
 ERROR Unexpected keyword argument `node_id` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:100:13
-ERROR Unexpected keyword argument `config` in function `object.__init__` [unexpected-keyword]
+ERROR Unexpected keyword argument `data` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:101:13
 ERROR Unexpected keyword argument `graph_init_params` in function `object.__init__` [unexpected-keyword]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:102:13
@@ -5417,11 +5415,11 @@
 ERROR Cannot index into `object` [bad-index]
   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:66:12
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:122:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:123:35
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:125:21
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:126:35
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:158:17
+   --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Object of class `NoneType` has no attribute `type` [missing-attribute]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:204:16
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
@@ -5471,33 +5469,35 @@
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/\n\n... (truncated) ...

@laipz8200 laipz8200 marked this pull request as ready for review April 23, 2026 00:16
laipz8200 and others added 21 commits May 9, 2026 14:23
Introduce tenant-scoped quota helpers that accept provider and model identity directly.

Refactor the workflow quota layer and engine wiring to use public node and event model identity instead of reconstructing ModelInstance, and keep the legacy ModelInstance helpers as deprecated wrappers with focused test coverage.
Add model-type-aware quota helpers at the shared billing boundary while keeping the LLM-specific helpers as thin adapters.

Preserve model_type in the deprecated ModelInstance wrappers and extend the quota unit tests to cover the generic helper delegation path.
Remove the temporary generic model-type quota helpers now that system-billed models are LLM-only.

Keep the deprecated ModelInstance wrappers as LLM-specific adapters with explicit non-LLM guards and update the quota tests to match the narrower invariant.
Treat missing public model identity on quota-tracked workflow nodes as an execution bug instead of silently skipping quota handling.

Abort the workflow for both pre-run and post-run identity lookup failures and extend the layer tests to assert the stop-event and abort-command behavior.
Make the LLM quota matcher exhaustive for basedpyright and expand unit coverage across quota resolution and deduction branches. This addresses the failing Python style/type gate and raises patch coverage for the Graphon 0.3.0 upgrade branch.
Update the rebased node factory test to mirror Graphon node validation when asserting typed LLM node data construction.
Signed-off-by: -LAN- <laipz8200@outlook.com>
Signed-off-by: -LAN- <laipz8200@outlook.com>
Signed-off-by: -LAN- <laipz8200@outlook.com>
Signed-off-by: -LAN- <laipz8200@outlook.com>
Signed-off-by: -LAN- <laipz8200@outlook.com>
@WH-2099 WH-2099 force-pushed the upgrade-graphon-to-0-3-0 branch from f55c206 to 5aabe33 Compare May 9, 2026 06:25
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-05-09 06:26:34.781620113 +0000
+++ /tmp/pyrefly_pr.txt	2026-05-09 06:26:27.171624400 +0000
@@ -626,13 +626,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -677,25 +677,25 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `Connection | Engine` is not assignable to parameter `session_factory` with type `Engine | sessionmaker[Session]` in function `core.app.layers.pause_state_persist_layer.PauseStatePersistenceLayer.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:293:29
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:295:29
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:37:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -1023,7 +1023,9 @@
 ERROR Object of class `NoneType` has no attribute `quota_used` [missing-attribute]
   --> tests/test_containers_integration_tests/services/test_credit_pool_service.py:91:16
 ERROR Object of class `NoneType` has no attribute `quota_used` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_credit_pool_service.py:105:16
+   --> tests/test_containers_integration_tests/services/test_credit_pool_service.py:108:16
+ERROR Object of class `NoneType` has no attribute `quota_used` [missing-attribute]
+   --> tests/test_containers_integration_tests/services/test_credit_pool_service.py:123:16
 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]
@@ -2767,77 +2769,77 @@
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:105:33
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:183:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:185:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:191:60
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:193:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._listen_audio_msg` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:200:57
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:202:57
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:215:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:217:65
 ERROR `() -> _GeneratorContextManager[SimpleNamespace]` is not assignable to attribute `_database_session` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> _GeneratorContextManager[Session]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:221:38
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:223:38
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_run_id: str, workflow_id: str, reason: WorkflowStartReason) -> WorkflowStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:233:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:235:83
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_publishes_stop._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:269:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:271:66
 ERROR `SimpleNamespace` is not assignable to attribute `queue_manager` with type `AppQueueManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:270:54
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:272:54
 ERROR `(outputs: Unknown) -> list[dict[str, str]]` is not assignable to attribute `fetch_files_from_node_outputs` with type `(cls: type[WorkflowResponseConverter], outputs_dict: Mapping[str, Any] | None) -> Sequence[Mapping[str, Any]]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:283:79
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:285:79
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:286:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:288:89
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueNodeSucceededEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_node_succeeded_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:296:64
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:298:64
 ERROR `(**kwargs: Unknown) -> Literal['iter_start']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:304:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:306:93
 ERROR `(**kwargs: Unknown) -> Literal['iter_next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:307:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:309:92
 ERROR `(**kwargs: Unknown) -> Literal['iter_done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:308:97
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:310:97
 ERROR `(**kwargs: Unknown) -> Literal['loop_start']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:311:88
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:313:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:312:87
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:314:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:313:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:315:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:378:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:382:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:379:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:383:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:384:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:388:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:385:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:389:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:416:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:420:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:451:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:455:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:457:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:461:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:457:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:461:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:457:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:461:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:478:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:482:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:507:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:511:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:520:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:524:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:521:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:525:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:590:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:596:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:604:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:623:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:631:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:624:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:632:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:625:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:633:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:647:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:655:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:41:34
 ERROR Cannot index into `str` [bad-index]
@@ -3072,8 +3074,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:44:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:94:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:228:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3273,121 +3273,121 @@
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:88:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._listen_audio_msg` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:169:57
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:171:57
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:184:65
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:186:65
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_run_id: str, workflow_id: str, reason: WorkflowStartReason) -> WorkflowStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:196:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:198:83
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:212:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:214:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:237:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:239:84
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:239:65
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:241:65
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_handle_text_chunk_event_publishes_tts._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:259:68
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:261:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:259:96
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:261:96
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:262:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:264:16
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:269:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:289:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:309:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:313:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:316:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:320:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:317:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:321:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:318:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:322:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:319:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:323:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:320:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:324:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:321:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:325:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:322:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:326:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:323:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:327:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:324:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:328:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:416:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:420:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:472:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:476:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:473:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:477:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:476:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:480:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:485:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:489:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:489:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:493:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:496:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:514:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:518:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:558:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:562:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:568:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:572:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:605:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:609:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:695:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:699:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:700:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:704:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:706:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:710:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:732:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:740:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:746:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:775:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:775:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:783:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:794:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:795:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:786:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:803:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:800:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:810:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:803:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:806:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:809:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:819:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:822:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:815:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:828:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:838:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:829:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:839:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:832:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:842:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:837:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:847:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:851:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:857:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:867:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Cannot index into `bool` [bad-index]
@@ -3485,11 +3485,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3778,6 +3778,30 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, str | dict[str, float | list[str]]]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:136:5
+ERROR Object of class `FromClause` has no attribute `insert` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:139:13
+ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:327:5
+ERROR Object of class `FromClause` has no attribute `insert` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:330:13
+ERROR No matching overload found for function `dict.__init__` called with arguments: (Sequence[Row[tuple[str, int | None]]]) [no-matching-overload]
+   --> tests/unit_tests/core/app/test_llm_quota.py:387:32
+ERROR Object of class `FromClause` has no attribute `update` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:398:13
+ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:438:5
+ERROR Object of class `FromClause` has no attribute `insert` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:441:13
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:548:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:569:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:588:28
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:615:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3831,45 +3855,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:210:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:167:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -3962,21 +3986,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12

... (truncated) ...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-05-09 06:26:34.781620113 +0000
+++ /tmp/pyrefly_pr.txt	2026-05-09 06:26:27.171624400 +0000
@@ -626,13 +626,13 @@
    --> tests/integration_tests/services/test_workflow_draft_variable_service.py:817:21
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:83:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_http.py:84:35
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol` in function `graphon.nodes.http_request.executor.Executor.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:242:25
 ERROR Argument `SSRFProxy` is not assignable to parameter `http_client` with type `HttpClientProtocol | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:731:21
-ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `() -> ToolFileManagerProtocol` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
+ERROR Argument `type[ToolFileManager]` is not assignable to parameter `tool_file_manager_factory` with type `(() -> ToolFileManagerProtocol) | None` in function `graphon.nodes.http_request.node.HttpRequestNode.__init__` [bad-argument-type]
    --> tests/integration_tests/workflow/nodes/test_http.py:732:35
 ERROR Argument `_SimpleJinja2Renderer` is not assignable to parameter `jinja2_template_renderer` with type `Jinja2TemplateRenderer` in function `graphon.nodes.template_transform.template_transform_node.TemplateTransformNode.__init__` [bad-argument-type]
   --> tests/integration_tests/workflow/nodes/test_template_transform.py:94:34
@@ -677,25 +677,25 @@
 ERROR Attribute `workflow_run_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:157:9
 ERROR Argument `Connection | Engine` is not assignable to parameter `session_factory` with type `Engine | sessionmaker[Session]` in function `core.app.layers.pause_state_persist_layer.PauseStatePersistenceLayer.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:293:29
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:295:29
 ERROR Argument `dict[str, str]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:310:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:312:21
 ERROR Argument `dict[tuple[str, str], dict[str, str] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:313:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:315:23
 ERROR Argument `dict[tuple[str, str], dict[str, str] | list[int] | str]` is not assignable to parameter `variables` with type `dict[tuple[str, str], object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:377:23
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:379:23
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:389:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:391:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:403:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:405:16
 ERROR Argument `dict[str, LiteralString]` is not assignable to parameter `outputs` with type `dict[str, object] | None` in function `TestPauseStatePersistenceLayerTestContainers._create_graph_runtime_state` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:444:21
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:446:21
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:468:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:470:16
 ERROR Object of class `FixtureFunctionDefinition` has no attribute `_workflow_run_repo` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:530:24
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:532:24
 ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `workflow_execution_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:533:16
+   --> tests/test_containers_integration_tests/core/app/layers/test_pause_state_persist_layer.py:535:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:37:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -1023,7 +1023,9 @@
 ERROR Object of class `NoneType` has no attribute `quota_used` [missing-attribute]
   --> tests/test_containers_integration_tests/services/test_credit_pool_service.py:91:16
 ERROR Object of class `NoneType` has no attribute `quota_used` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_credit_pool_service.py:105:16
+   --> tests/test_containers_integration_tests/services/test_credit_pool_service.py:108:16
+ERROR Object of class `NoneType` has no attribute `quota_used` [missing-attribute]
+   --> tests/test_containers_integration_tests/services/test_credit_pool_service.py:123:16
 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]
@@ -2767,77 +2769,77 @@
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:105:33
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:183:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:185:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:191:60
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:193:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._listen_audio_msg` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:200:57
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:202:57
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:215:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:217:65
 ERROR `() -> _GeneratorContextManager[SimpleNamespace]` is not assignable to attribute `_database_session` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> _GeneratorContextManager[Session]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:221:38
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:223:38
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_run_id: str, workflow_id: str, reason: WorkflowStartReason) -> WorkflowStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:233:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:235:83
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_publishes_stop._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:269:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:271:66
 ERROR `SimpleNamespace` is not assignable to attribute `queue_manager` with type `AppQueueManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:270:54
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:272:54
 ERROR `(outputs: Unknown) -> list[dict[str, str]]` is not assignable to attribute `fetch_files_from_node_outputs` with type `(cls: type[WorkflowResponseConverter], outputs_dict: Mapping[str, Any] | None) -> Sequence[Mapping[str, Any]]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:283:79
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:285:79
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:286:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:288:89
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueNodeSucceededEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_node_succeeded_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:296:64
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:298:64
 ERROR `(**kwargs: Unknown) -> Literal['iter_start']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:304:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:306:93
 ERROR `(**kwargs: Unknown) -> Literal['iter_next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:307:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:309:92
 ERROR `(**kwargs: Unknown) -> Literal['iter_done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:308:97
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:310:97
 ERROR `(**kwargs: Unknown) -> Literal['loop_start']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:311:88
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:313:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:312:87
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:314:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:313:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:315:92
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:378:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:382:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:379:83
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:383:83
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:384:65
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:388:65
 ERROR `(**kwargs: Unknown) -> SimpleNamespace` is not assignable to attribute `_get_message` with type `(self: AdvancedChatAppGenerateTaskPipeline, *, session: Session) -> Message` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:385:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:389:33
 ERROR `(**kwargs: Unknown) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:416:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:420:89
 ERROR `SimpleNamespace` is not assignable to attribute `_message_cycle_manager` with type `MessageCycleManager` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:451:43
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:455:43
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `QueueTextChunkEvent` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:457:47
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:461:47
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_handle_text_chunk_event_tracks_streaming_metrics._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:457:68
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:461:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:457:96
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:461:96
 ERROR `TestAdvancedChatGenerateTaskPipeline.test_handle_output_moderation_chunk_appends_token._Moderation` is not assignable to attribute `output_moderation_handler` with type `OutputModeration | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:478:66
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:482:66
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:507:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:511:78
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:520:92
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:524:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:521:93
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:525:93
 ERROR Argument `TestAdvancedChatGenerateTaskPipeline.test_save_message_strips_markdown_and_sets_usage._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline._save_message` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:590:40
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:596:40
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:598:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:604:52
 ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(self: BasedGenerateTaskPipeline, completion: str) -> str | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:623:84
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:631:84
 ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(self: MessageCycleManager, answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:624:78
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:632:78
 ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `(self: AdvancedChatAppGenerateTaskPipeline) -> MessageEndStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:625:52
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:633:52
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:647:89
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:655:89
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.agent_chat.app_config_manager.AgentChatAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/agent_chat/test_agent_chat_app_config_manager.py:41:34
 ERROR Cannot index into `str` [bad-index]
@@ -3072,8 +3074,6 @@
    --> tests/unit_tests/core/app/apps/test_message_based_app_generator.py:175:9
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
   --> tests/unit_tests/core/app/apps/test_pause_resume.py:44:5
-ERROR Class member `_StubToolNode._run` overrides parent class `Node` in an inconsistent manner [bad-override]
-  --> tests/unit_tests/core/app/apps/test_pause_resume.py:94:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_pause_resume.py:228:19
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
@@ -3273,121 +3273,121 @@
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:88:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._listen_audio_msg` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:169:57
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:171:57
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:184:65
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:186:65
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_run_id: str, workflow_id: str, reason: WorkflowStartReason) -> WorkflowStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:196:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:198:83
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:212:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:214:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:237:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:239:84
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(self: BasedGenerateTaskPipeline, e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:239:65
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:241:65
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_handle_text_chunk_event_publishes_tts._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:259:68
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:261:68
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:259:96
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:261:96
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:262:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:264:16
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:267:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:269:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:289:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:293:84
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_created_from._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:309:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:313:49
 ERROR `(**kwargs: Unknown) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:316:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:320:93
 ERROR `(**kwargs: Unknown) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:317:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:321:92
 ERROR `(**kwargs: Unknown) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:318:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:322:97
 ERROR `(**kwargs: Unknown) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:319:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:323:88
 ERROR `(**kwargs: Unknown) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:320:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:324:87
 ERROR `(**kwargs: Unknown) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:321:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:325:92
 ERROR `(**kwargs: Unknown) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:322:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:326:92
 ERROR `(**kwargs: Unknown) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:323:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:327:93
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(self: WorkflowResponseConverter, task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:324:66
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:328:66
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:416:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:420:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:472:22
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:476:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:473:27
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:477:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:476:37
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:480:37
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:485:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:489:53
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:489:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:493:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_wrapper_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:492:53
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:496:53
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:514:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:518:16
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:558:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:562:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:568:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:572:45
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(self: WorkflowAppGenerateTaskPipeline, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:605:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:609:45
 ERROR `(**kwargs: Unknown) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:695:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:699:88
 ERROR `(**kwargs: Unknown) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:700:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:704:88
 ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:706:89
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:710:89
 ERROR `(**kwargs: Unknown) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: GraphRuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:732:84
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:738:84
 ERROR `(**kwargs: Unknown) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: GraphRuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:740:83
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:746:83
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[PingStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_ping_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:759:39
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:39
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:762:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:770:60
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:767:46
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:775:46
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:775:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:61
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_started_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:783:51
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:51
 ERROR `(event: QueueTextChunkEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_text_chunk_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:784:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:794:45
 ERROR `(event: AppQueueEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_dispatch_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:785:36
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:795:36
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[ErrorStreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_error_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:786:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:796:40
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:793:74
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:803:74
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:800:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:810:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:803:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:813:60
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:806:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:816:61
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_paused_event` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:809:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:819:50
 ERROR `() -> Iterator[MessageQueueMessage | WorkflowQueueMessage] | Iterator[Any]` is not assignable to attribute `listen` with type `(self: AppQueueManager) -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:812:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:822:61
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: Unknown) -> Iterator[StreamResponse] | Iterator[Any]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(self: WorkflowAppGenerateTaskPipeline, event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:815:60
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:825:60
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:828:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:838:49
 ERROR Object of class `object` has no attribute `created_from` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:829:16
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:839:16
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:832:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:842:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:837:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:847:49
 ERROR Argument `TestWorkflowGenerateTaskPipeline.test_save_workflow_app_log_covers_invoke_from_variants._Session` is not assignable to parameter `session` with type `Session` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._save_workflow_app_log` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:841:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:851:49
 ERROR `(**kwargs: Unknown) -> TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:857:45
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline_core.py:867:45
 ERROR `Literal['unknown']` is not assignable to attribute `stopped_by` with type `QueueStopEvent.StopBy` [bad-assignment]
   --> tests/unit_tests/core/app/entities/test_queue_entities.py:11:28
 ERROR Cannot index into `bool` [bad-index]
@@ -3485,11 +3485,11 @@
 ERROR Argument `object` is not assignable to parameter `event` with type `GraphEngineEvent` in function `core.app.layers.suspend_layer.SuspendLayer.on_event` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_suspend_layer.py:18:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:47:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:49:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:84:30
+  --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:88:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `ReadOnlyGraphRuntimeState` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:104:30
+   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:110:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AppGenerateEntity` in function `core.app.task_pipeline.based_generate_task_pipeline.BasedGenerateTaskPipeline.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py:23:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.task_pipeline.easy_ui_based_generate_task_pipeline.EasyUIBasedGenerateTaskPipeline.__init__` [bad-argument-type]
@@ -3778,6 +3778,30 @@
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager_optimization.py:249:16
 ERROR Argument `dict[str, dict[str, str | dict[str, float | list[str]]]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
   --> tests/unit_tests/core/app/test_easy_ui_model_config_manager.py:49:41
+ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:136:5
+ERROR Object of class `FromClause` has no attribute `insert` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:139:13
+ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:327:5
+ERROR Object of class `FromClause` has no attribute `insert` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:330:13
+ERROR No matching overload found for function `dict.__init__` called with arguments: (Sequence[Row[tuple[str, int | None]]]) [no-matching-overload]
+   --> tests/unit_tests/core/app/test_llm_quota.py:387:32
+ERROR Object of class `FromClause` has no attribute `update` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:398:13
+ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:438:5
+ERROR Object of class `FromClause` has no attribute `insert` [missing-attribute]
+   --> tests/unit_tests/core/app/test_llm_quota.py:441:13
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:548:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.ensure_llm_quota_available` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:569:51
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:588:28
+ERROR Argument `SimpleNamespace` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.app.llm.quota.deduct_llm_quota` [bad-argument-type]
+   --> tests/unit_tests/core/app/test_llm_quota.py:615:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `file` with type `File` in function `core.app.workflow.file_runtime.DifyWorkflowFileRuntime.resolve_file_url` [bad-argument-type]
   --> tests/unit_tests/core/app/workflow/test_file_runtime.py:60:39
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
@@ -3831,45 +3855,45 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.on_node_run_end` [bad-argument-type]
    --> tests/unit_tests/core/app/workflow/test_observability_layer_extra.py:210:31
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_execution_repository` with type `WorkflowExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:93:39
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:96:39
 ERROR Argument `_RepoRecorder` is not assignable to parameter `workflow_node_execution_repository` with type `WorkflowNodeExecutionRepository` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:94:44
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:44
 ERROR Argument `object | None` is not assignable to parameter `trace_manager` with type `TraceQueueManager | None` in function `core.app.workflow.layers.persistence.WorkflowPersistenceLayer.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:95:23
+  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:98:23
 ERROR Argument `None` is not assignable to parameter `command_channel` with type `CommandChannel` in function `graphon.graph_engine.layers.base.GraphEngineLayer.initialize` [bad-argument-type]
-  --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:97:55
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:100:55
 ERROR `object` is not assignable to attribute `_workflow_execution` with type `WorkflowExecution | None` [bad-assignment]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:105:37
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:108:37
 ERROR Cannot set item in `dict[str, WorkflowNodeExecution]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:106:49
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:109:49
 ERROR Cannot set item in `dict[str, _NodeRuntimeSnapshot]` [unsupported-operation]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:107:43
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:110:43
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:173:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:176:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:174:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:177:16
 ERROR Object of class `object` has no attribute `total_steps` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:175:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:178:16
 ERROR Object of class `GraphRuntimeState` has no attribute `_graph_execution` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:182:9
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:185:9
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:189:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:192:16
 ERROR Object of class `object` has no attribute `exceptions_count` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:190:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:193:16
 ERROR Object of class `object` has no attribute `total_tokens` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:191:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:194:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:214:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:217:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:224:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:227:16
 ERROR Object of class `object` has no attribute `error_message` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:225:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:228:16
 ERROR Object of class `object` has no attribute `status` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:236:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:239:16
 ERROR Object of class `object` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:237:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:240:16
 ERROR Object of class `object` has no attribute `finished_at` [missing-attribute]
-   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:238:16
+   --> tests/unit_tests/core/app/workflow/test_persistence_layer.py:241:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
    --> tests/unit_tests/core/base/test_app_generator_tts_publisher.py:167:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
@@ -3962,21 +3986,21 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `db_provider` with type `MCPToolProvider` in function `core.entities.mcp_provider.MCPProviderEntity.from_db_model` [bad-argument-type]
   --> tests/unit_tests/core/entities/test_entities_mcp_provider.py:59:46
 ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:635:12
+   --> tests/unit_tests/core/entities/test_entities_provider_configuration.py:666:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `credential_record\n\n... (truncated) ...

@asukaminato0721 asukaminato0721 added this pull request to the merge queue May 9, 2026
Merged via the queue into main with commit 1947610 May 9, 2026
32 checks passed
@asukaminato0721 asukaminato0721 deleted the upgrade-graphon-to-0-3-0 branch May 9, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants