Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
test(api): stop excluding five core test modules from strict pyrefly (#45336)
Felix Shidc36c3eb44bb
diff --git a/api/tests/unit_tests/core/agent/test_base_agent_runner.py b/api/tests/unit_tests/core/agent/test_base_agent_runner.pyindex 6f3c23e9d32..e564457fad1 100644--- a/api/tests/unit_tests/core/agent/test_base_agent_runner.py+++ b/api/tests/unit_tests/core/agent/test_base_agent_runner.py@@ -418,10 +418,10 @@ def test_save_agent_thought_serialization_fallbacks(tool_meta = {"c": 3}real_dumps = json.dumps- def dumps_side_effect(value, *args, **kwargs):- if value in (tool_input, observation, tool_meta) and kwargs.get("ensure_ascii") is False:+ def dumps_side_effect(value: object, *, ensure_ascii: bool = True) -> str:+ if value in (tool_input, observation, tool_meta) and ensure_ascii is False:raise TypeError("fail")- return real_dumps(value, *args, **kwargs)+ return real_dumps(value, ensure_ascii=ensure_ascii)mocker.patch.object(module.json, "dumps", side_effect=dumps_side_effect)diff --git a/api/tests/unit_tests/core/app/app_config/easy_ui_based_app/model_config/test_manager.py b/api/tests/unit_tests/core/app/app_config/easy_ui_based_app/model_config/test_manager.pyindex 0894c73771a..60588b440e6 100644--- a/api/tests/unit_tests/core/app/app_config/easy_ui_based_app/model_config/test_manager.py+++ b/api/tests/unit_tests/core/app/app_config/easy_ui_based_app/model_config/test_manager.py@@ -326,7 +326,7 @@ class TestModelConfigManagerCases:class TestEasyUiModelConfigManagerCases:@staticmethod- def test_validate_and_set_defaults_reuses_single_model_assembly():+ def test_validate_and_set_defaults_reuses_single_model_assembly() -> None:provider_name = str(ModelProviderID("openai"))provider_entity = SimpleNamespace(provider=provider_name)model = SimpleNamespace(model="gpt-4o-mini", model_properties={ModelPropertyKey.MODE: "chat"})@@ -339,7 +339,7 @@ class TestEasyUiModelConfigManagerCases:"model": {"provider": "openai","name": "gpt-4o-mini",- "completion_params": {"stop": []},+ "completion_params": {"stop": []}, # pyrefly: ignore[implicit-any-empty-container]}}@@ -355,7 +355,7 @@ class TestEasyUiModelConfigManagerCases:mock_assembly.assert_called_once_with(tenant_id="tenant-1")@staticmethod- def test_convert_keeps_model_config_shape():+ def test_convert_keeps_model_config_shape() -> None:config = {"model": {"provider": "openai",@@ -365,7 +365,7 @@ class TestEasyUiModelConfigManagerCases:}}- result = ModelConfigManager.convert(config)+ result = ModelConfigManager.convert(config) # pyrefly: ignore[bad-argument-type]assert result == ModelConfigEntity(provider="openai",diff --git a/api/tests/unit_tests/core/app/apps/workflow/test_command_channels.py b/api/tests/unit_tests/core/app/apps/workflow/test_command_channels.pyindex 9b5e700728a..ee0817e2871 100644--- a/api/tests/unit_tests/core/app/apps/workflow/test_command_channels.py+++ b/api/tests/unit_tests/core/app/apps/workflow/test_command_channels.py@@ -11,20 +11,20 @@ from core.app.apps.workflow.command_channels import (CombinedCommandChannel,StopFlagCommandChannel,)-from graphon.engine.command import AbortCommand, PauseCommand, RedisChannel+from graphon.engine.command import AbortCommand, Command, PauseCommand, RedisChannelclass _CommandChannelStub:- def __init__(self, commands=None) -> None:+ def __init__(self, commands: list[Command] | None = None) -> None:self.commands = list(commands or [])- self.sent = []+ self.sent: list[Command] = []- def fetch_commands(self):+ def fetch_commands(self) -> list[Command]:commands = self.commandsself.commands = []return commands- def send_command(self, command) -> None:+ def send_command(self, command: Command) -> None:self.sent.append(command)diff --git a/api/tests/unit_tests/core/app/layers/test_conversation_variable_persist_layer.py b/api/tests/unit_tests/core/app/layers/test_conversation_variable_persist_layer.pyindex b4d5808f4c5..a1fa3ce300a 100644--- a/api/tests/unit_tests/core/app/layers/test_conversation_variable_persist_layer.py+++ b/api/tests/unit_tests/core/app/layers/test_conversation_variable_persist_layer.py@@ -47,7 +47,7 @@ def _build_variable_updated_event(variable: StringVariable) -> NodeRunVariableUp)-def test_persists_conversation_variables_from_variable_update_event():+def test_persists_conversation_variables_from_variable_update_event() -> None:conversation_id = "conv-123"variable = StringVariable(id="var-1",@@ -65,7 +65,7 @@ def test_persists_conversation_variables_from_variable_update_event():updater.update.assert_called_once_with(conversation_id=conversation_id, variable=variable)-def test_skips_non_variable_update_events():+def test_skips_non_variable_update_events() -> None:conversation_id = "conv-456"updater = Mock()layer = ConversationVariablePersistenceLayer(updater)@@ -77,7 +77,7 @@ def test_skips_non_variable_update_events():updater.update.assert_not_called()-def test_skips_non_conversation_variables():+def test_skips_non_conversation_variables() -> None:conversation_id = "conv-789"non_conversation_variable = StringVariable(id="var-3",diff --git a/api/tests/unit_tests/core/workflow/nodes/agent_v2/test_session_store.py b/api/tests/unit_tests/core/workflow/nodes/agent_v2/test_session_store.pyindex 5efbad139e7..d1106b59537 100644--- a/api/tests/unit_tests/core/workflow/nodes/agent_v2/test_session_store.py+++ b/api/tests/unit_tests/core/workflow/nodes/agent_v2/test_session_store.py@@ -158,7 +158,14 @@ def _install_backend_client(monkeypatch: pytest.MonkeyPatch) -> MagicMock:def executed_statements(sqlite_engine: Engine) -> Iterator[list[str]]:statements: list[str] = []- def record_statement(_connection, _cursor, statement, _parameters, _context, _executemany) -> None:+ def record_statement(+ _connection: object,+ _cursor: object,+ statement: str,+ _parameters: object,+ _context: object,+ _executemany: object,+ ) -> None:statements.append(statement)event.listen(sqlite_engine, "before_cursor_execute", record_statement)@@ -472,7 +479,7 @@ def test_load_or_create_persists_binding_on_node_execution("existing": "value","workflow_agent_binding_id": "workflow-binding-1",}- assert "agent_workspace_binding_id" not in persisted_execution.process_data_dict+ assert "agent_workspace_binding_id" not in persisted_execution.process_data_dict # pyrefly: ignore[not-iterable]persisted_binding = sqlite_session.get(AgentWorkspaceBinding, stored.binding_id)assert persisted_binding is not Noneassert persisted_binding.base_home_snapshot_id == home_snapshot_id@@ -551,7 +558,7 @@ def test_load_existing_pointer_rejects_missing_workflow_identity(sqlite_session:def test_load_existing_pointer_reuses_matching_workflow_identity(sqlite_session: Session) -> None:- original_process_data = {+ original_process_data: dict[str, object] = {"existing": "value","workflow_agent_binding_id": "workflow-binding-1",}@@ -564,7 +571,7 @@ def test_load_existing_pointer_reuses_matching_workflow_identity(sqlite_session:sqlite_session.expire(execution)assert stored.binding_id == "binding-1"assert execution.process_data_dict == original_process_data- assert "agent_workspace_binding_id" not in execution.process_data_dict+ assert "agent_workspace_binding_id" not in execution.process_data_dict # pyrefly: ignore[not-iterable]assert sqlite_session.scalar(select(func.count()).select_from(AgentWorkspaceBinding)) == 1diff --git a/api/tests/unit_tests/pyrefly.toml b/api/tests/unit_tests/pyrefly.tomlindex d4b8edd3487..9459bacaf73 100644--- a/api/tests/unit_tests/pyrefly.toml+++ b/api/tests/unit_tests/pyrefly.toml@@ -81,7 +81,6 @@ project-excludes = ["controllers/web/test_wraps.py","core/agent/conftest.py","core/agent/output_parser/test_cot_output_parser.py",- "core/agent/test_base_agent_runner.py","core/agent/test_cot_agent_runner.py","core/agent/test_cot_chat_agent_runner.py","core/agent/test_cot_completion_agent_runner.py",@@ -120,20 +119,17 @@ project-excludes = ["core/app/apps/workflow/test_app_generator.py","core/app/apps/test_workflow_app_runner.py","core/app/apps/workflow/test_app_queue_manager.py",- "core/app/apps/workflow/test_command_channels.py","core/app/apps/workflow/test_generate_response_converter.py","core/app/apps/workflow/test_generate_task_pipeline.py","core/app/entities/test_app_invoke_entities.py","core/app/features/rate_limiting/test_rate_limit.py","core/app/features/annotation_reply/test_annotation_reply.py",- "core/app/layers/test_conversation_variable_persist_layer.py","core/app/layers/test_pause_state_persist_layer.py","core/app/layers/test_timeslice_layer.py","core/app/layers/test_trigger_post_layer.py","core/app/task_pipeline/test_based_generate_task_pipeline.py","core/app/task_pipeline/test_easy_ui_based_generate_task_pipeline.py","core/app/task_pipeline/test_message_cycle_manager.py",- "core/app/app_config/easy_ui_based_app/model_config/test_manager.py","core/app/llm/test_quota.py","services/test_workflow_persistence.py","core/workflow/test_node_factory.py",@@ -240,7 +236,6 @@ project-excludes = ["core/workflow/nodes/agent_v2/test_dify_tools_builder.py","core/workflow/nodes/agent_v2/test_output_adapter.py","core/workflow/nodes/agent_v2/test_runtime_request_builder.py",- "core/workflow/nodes/agent_v2/test_session_store.py","core/workflow/nodes/agent_v2/test_validators.py","../e2e_tests/contracts/core/workflow/nodes/answer/test_answer.py","../e2e_tests/contracts/core/workflow/nodes/base/test_base_node.py",