Repository navigation
fix(api): fall back to the raw reference for non-object file reference payloads - #45088
Merged
crazywoola merged 2 commits intoOct 30, 2026
Merged
Conversation
…e payloads parse_file_reference() promises a lenient fallback for malformed canonical references, but only catches base64/JSON decode errors. A reference whose payload decodes to valid non-object JSON (e.g. '[]', 'null', '"abc"') reaches payload.get() and raises AttributeError, which escapes the RequestDownloadFileMapping validator (500 instead of a 4xx validation error) and the Agent-v2 output checker (crash instead of a structured failure). Treat a non-object payload as malformed and return the raw reference as the record id, matching the existing lenient behavior for invalid encodings. Add regression tests for non-object payloads and the validator path. Co-Authored-By: Claude Code <[email protected]>
… file refs The parser tests only covered the non-object payload crash itself. Pin the adjacent lenient branches (object without a valid record_id, non-string storage_key, empty input) and add the Agent-v2 output checker case: a non-object payload now yields TYPE_CHECK_FAILED with a clear reason instead of an AttributeError escaping the checker. Co-Authored-By: Claude Code <[email protected]>
crazywoola
approved these changes
Oct 30, 2026
crazywoola
enabled auto-merge
October 30, 2026 04:24
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-10-30 04:26:18.124524310 +0000
+++ /tmp/pyrefly_pr.txt 2026-10-30 04:26:04.188365883 +0000
@@ -162,6 +162,10 @@
--> providers/vdb/vdb-tencent/tests/e2e_tests/conftest.py:95:33
ERROR Object of class `ModuleType` has no attribute `VectorType` [missing-attribute]
--> providers/vdb/vdb-tidb-vector/tests/unit_tests/src/dify_vdb_tidb_vector/test_tidb_vector.py:77:5
+ERROR Argument `ModuleSpec | None` is not assignable to parameter `spec` with type `ModuleSpec` in function `_frozen_importlib.module_from_spec` [bad-argument-type]
+ --> tests/unit_tests/migrations/versions/test_2025_07_02_2332-1c9ba48be8e4_add_uuidv7_function_in_sql.py:31:46
+ERROR Object of class `NoneType` has no attribute `loader` [missing-attribute]
+ --> tests/unit_tests/migrations/versions/test_2025_07_02_2332-1c9ba48be8e4_add_uuidv7_function_in_sql.py:32:5
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
--> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:75:16
ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
@@ -176,6 +180,8 @@
--> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:123:27
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `MessageStatus | SQLCoreOperations[MessageStatus]` in function `models.model.Message.__init__` [bad-argument-type]
--> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:125:16
+ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
+ --> tests/e2e_tests/containers/controllers/console/app/test_conversation_read_timestamp.py:28:16
ERROR Returned type `set[str | None]` is not assignable to declared return type `set[str]` [bad-return]
--> tests/e2e_tests/containers/controllers/console/test_apikey.py:221:16
ERROR Object of class `FunctionType` has no attribute `__handler__` [missing-attribute]
@@ -313,7 +319,7 @@
ERROR Argument `Literal['workflow-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowNodeExecutionTriggeredFrom] | WorkflowNodeExecutionTriggeredFrom` in function `models.workflow.WorkflowNodeExecutionModel.__init__` [bad-argument-type]
--> tests/e2e_tests/containers/repositories/test_sqlalchemy_api_workflow_node_execution_repository.py:39:24
ERROR Generator function should return `Generator` [bad-return]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_api_workflow_run_repository.py:150:56
+ --> tests/e2e_tests/containers/repositories/test_sqlalchemy_api_workflow_run_repository.py:151:56
ERROR Argument `Literal['chat']` is not assignable to parameter `mode` with type `AppMode | SQLCoreOperations[AppMode]` in function `models.model.App.__init__` [bad-argument-type]
--> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:103:14
ERROR Argument `Literal['emoji']` is not assignable to parameter `icon_type` with type `IconType | SQLCoreOperations[IconType | None] | None` in function `models.model.App.__init__` [bad-argument-type]
@@ -322,50 +328,6 @@
--> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:125:14
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
--> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:130:16
-ERROR Object of class `HumanInputFormReference` has no attribute `submitted` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:348:16
-ERROR Object of class `HumanInputFormReference` has no attribute `form_submission_data` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:350:16
-ERROR Object of class `object` has no attribute `action_id` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:351:16
-ERROR Object of class `object` has no attribute `action_text` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:352:16
-ERROR Object of class `object` has no attribute `rendered_content` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:353:16
-ERROR Object of class `object` has no attribute `node_id` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:354:16
-ERROR Object of class `object` has no attribute `node_title` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:355:16
-ERROR Object of class `HumanInputFormReference` has no attribute `form_submission_data` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:386:16
-ERROR Object of class `object` has no attribute `submitted_data` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:387:16
-ERROR Object of class `HumanInputFormReference` has no attribute `form_submission_data` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:474:16
-ERROR Object of class `object` has no attribute `submitted_data` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:475:16
-ERROR Object of class `object` has no attribute `rendered_content` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:476:16
-ERROR Object of class `HumanInputFormReference` has no attribute `submitted` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:517:16
-ERROR Object of class `HumanInputFormReference` has no attribute `form_definition` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:519:16
-ERROR Object of class `object` has no attribute `form_id` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:521:16
-ERROR Object of class `object` has no attribute `node_id` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:522:16
-ERROR Object of class `object` has no attribute `node_title` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:523:16
-ERROR Object of class `object` has no attribute `form_content` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:524:16
-ERROR Object of class `object` has no attribute `display_in_ui` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:525:16
-ERROR Object of class `object` has no attribute `form_token` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:526:16
-ERROR Object of class `object` has no attribute `resolved_default_values` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:527:16
-ERROR Object of class `object` has no attribute `expiration_time` [missing-attribute]
- --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:528:16
ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `str` in function `_create_node_execution_model` [bad-argument-type]
--> tests/e2e_tests/containers/repositories/test_sqlalchemy_workflow_node_execution_repository.py:184:23
ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `str` in function `_create_node_execution_model` [bad-argument-type]
@@ -663,17 +625,17 @@
ERROR Argument `Literal['web-app']` is not assignable to parameter `invoke_from` with type `InvokeFrom | SQLCoreOperations[InvokeFrom | None] | None` in function `models.model.Message.__init__` [bad-argument-type]
--> tests/e2e_tests/containers/services/test_audio_service_db.py:94:21
ERROR Argument `Literal['chat']` is not assignable to parameter `mode` with type `AppMode | SQLCoreOperations[AppMode]` in function `models.model.App.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_conversation_service.py:50:18
+ --> tests/e2e_tests/containers/services/test_conversation_service.py:52:18
ERROR Argument `Literal['emoji']` is not assignable to parameter `icon_type` with type `IconType | SQLCoreOperations[IconType | None] | None` in function `models.model.App.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_conversation_service.py:51:23
+ --> tests/e2e_tests/containers/services/test_conversation_service.py:53:23
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_conversation_service.py:106:20
+ --> tests/e2e_tests/containers/services/test_conversation_service.py:108:20
ERROR Argument `Literal['debugger', 'explore', 'openapi', 'published', 'service-api', 'trigger', 'validation', 'web-app']` is not assignable to parameter `invoke_from` with type `InvokeFrom | SQLCoreOperations[InvokeFrom | None] | None` in function `models.model.Conversation.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_conversation_service.py:107:25
+ --> tests/e2e_tests/containers/services/test_conversation_service.py:109:25
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `MessageStatus | SQLCoreOperations[MessageStatus]` in function `models.model.Message.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_conversation_service.py:153:20
+ --> tests/e2e_tests/containers/services/test_conversation_service.py:155:20
ERROR Argument `Literal[core.app.entities.app_invoke_entities.InvokeFrom.WEB_APP]` is not assignable to parameter `invoke_from` with type `models.enums.InvokeFrom | SQLCoreOperations[models.enums.InvokeFrom | None] | None` in function `models.model.Message.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_conversation_service.py:154:25
+ --> tests/e2e_tests/containers/services/test_conversation_service.py:156:25
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/e2e_tests/containers/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]
@@ -797,6 +759,18 @@
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
--> tests/e2e_tests/containers/services/test_message_export_service.py:96:20
ERROR Cannot index into `bool` [bad-index]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:47:12
+ERROR Cannot index into `float` [bad-index]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:47:12
+ERROR Cannot index into `int` [bad-index]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:47:12
+ERROR Cannot index into `list[JsonValue]` [bad-index]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:47:12
+ERROR Cannot index into `str` [bad-index]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:47:12
+ERROR `None` is not subscriptable [unsupported-operation]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:47:12
+ERROR Cannot index into `bool` [bad-index]
--> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:48:12
ERROR Cannot index into `float` [bad-index]
--> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:48:12
@@ -845,17 +819,17 @@
ERROR `None` is not subscriptable [unsupported-operation]
--> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:51:12
ERROR Cannot index into `bool` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:52:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:54:12
ERROR Cannot index into `float` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:52:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:54:12
ERROR Cannot index into `int` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:52:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:54:12
ERROR Cannot index into `list[JsonValue]` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:52:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:54:12
ERROR Cannot index into `str` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:52:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:54:12
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:52:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:54:12
ERROR Cannot index into `bool` [bad-index]
--> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:55:12
ERROR Cannot index into `float` [bad-index]
@@ -893,17 +867,29 @@
ERROR `None` is not subscriptable [unsupported-operation]
--> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:57:12
ERROR Cannot index into `bool` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:58:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:96:12
ERROR Cannot index into `float` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:58:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:96:12
ERROR Cannot index into `int` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:58:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:96:12
ERROR Cannot index into `list[JsonValue]` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:58:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:96:12
ERROR Cannot index into `str` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:58:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:96:12
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:58:12
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:96:12
+ERROR Cannot index into `bool` [bad-index]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:97:12
+ERROR Cannot index into `float` [bad-index]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:97:12
+ERROR Cannot index into `int` [bad-index]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:97:12
+ERROR Cannot index into `list[JsonValue]` [bad-index]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:97:12
+ERROR Cannot index into `str` [bad-index]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:97:12
+ERROR `None` is not subscriptable [unsupported-operation]
+ --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:97:12
ERROR Cannot index into `bool` [bad-index]
--> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:98:12
ERROR Cannot index into `float` [bad-index]
@@ -940,30 +926,6 @@
--> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:100:12
ERROR `None` is not subscriptable [unsupported-operation]
--> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:100:12
-ERROR Cannot index into `bool` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:101:12
-ERROR Cannot index into `float` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:101:12
-ERROR Cannot index into `int` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:101:12
-ERROR Cannot index into `list[JsonValue]` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:101:12
-ERROR Cannot index into `str` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:101:12
-ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:101:12
-ERROR Cannot index into `bool` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:102:12
-ERROR Cannot index into `float` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:102:12
-ERROR Cannot index into `int` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:102:12
-ERROR Cannot index into `list[JsonValue]` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:102:12
-ERROR Cannot index into `str` [bad-index]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:102:12
-ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/e2e_tests/containers/services/test_message_service_execution_extra_content.py:102:12
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `MessageStatus | SQLCoreOperations[MessageStatus]` in function `models.model.Message.__init__` [bad-argument-type]
--> tests/e2e_tests/containers/services/test_message_service_extra_contents.py:44: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]
@@ -1147,37 +1109,37 @@
ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.get_node_variable` [bad-argument-type]
--> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:935:21
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:124:38
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:123:38
ERROR Argument `str | Unknown` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:153:28
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:152:28
ERROR Argument `Literal['succeeded']` is not assignable to parameter `status` with type `SQLCoreOperations[WorkflowExecutionStatus] | WorkflowExecutionStatus` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:157:20
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:156:20
ERROR Argument `float` is not assignable to parameter `value` with type `Decimal | SQLCoreOperations[Decimal]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:210:38
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:209:38
ERROR Argument `float` is not assignable to parameter `value` with type `Decimal | SQLCoreOperations[Decimal]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:211:37
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:210:37
ERROR Argument `float` is not assignable to parameter `value` with type `Decimal | SQLCoreOperations[Decimal]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:212:38
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:211:38
ERROR Argument `float` is not assignable to parameter `value` with type `Decimal | SQLCoreOperations[Decimal]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:213:37
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:212:37
ERROR Argument `Literal['normal']` is not assignable to parameter `value` with type `MessageStatus | SQLCoreOperations[MessageStatus]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:215:26
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:214:26
ERROR Argument `dict[str, int | None]` is not assignable to parameter `args` with type `WorkflowRunListArgs` in function `services.workflow_run_service.WorkflowRunService.get_paginate_workflow_runs` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:256:18
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:255:18
ERROR Argument `dict[Unknown, Unknown]` is not assignable to parameter `args` with type `WorkflowRunListArgs` in function `services.workflow_run_service.WorkflowRunService.get_paginate_workflow_runs` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:349:18
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:348:18
ERROR Argument `dict[str, int | None]` is not assignable to parameter `args` with type `WorkflowRunListArgs` in function `services.workflow_run_service.WorkflowRunService.get_paginate_advanced_chat_workflow_runs` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:400:18
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:399:18
ERROR Argument `Literal['workflow-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowNodeExecutionTriggeredFrom] | WorkflowNodeExecutionTriggeredFrom` in function `models.workflow.WorkflowNodeExecutionModel.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:519:32
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:518:32
ERROR Argument `Literal['workflow-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowNodeExecutionTriggeredFrom] | WorkflowNodeExecutionTriggeredFrom` in function `models.workflow.WorkflowNodeExecutionModel.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:541:28
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:540:28
ERROR Object of class `NoneType` has no attribute `startswith` [missing-attribute]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:581:20
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:580:20
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:619:38
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:618:38
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/e2e_tests/containers/services/test_workflow_run_service.py:671:38
+ --> tests/e2e_tests/containers/services/test_workflow_run_service.py:670:38
ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> tests/e2e_tests/containers/services/test_workflow_service.py:81:21
ERROR Argument `Literal['emoji']` is not assignable to parameter `icon_type` with type `IconType | SQLCoreOperations[IconType | None] | None` in function `models.model.App.__init__` [bad-argument-type]
@@ -1631,21 +1593,21 @@
ERROR Argument `Literal['emoji']` is not assignable to parameter `icon_type` with type `IconType | SQLCoreOperations[IconType | None] | None` in function `models.model.App.__init__` [bad-argument-type]
--> tests/e2e_tests/containers/trigger/conftest.py:66:19
ERROR Argument `dict[str, str | dict[str, str | dict[str, str]]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `core.trigger.debug.event_selectors.TriggerDebugEventPoller.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:306:21
+ --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:304:21
ERROR Argument `MockPluginSubscription` is not assignable to parameter `subscription` with type `TriggerSubscription` in function `tasks.trigger_processing_tasks.dispatch_trigger_debug_event` [bad-argument-type]
- --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:357:26
+ --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:355:26
ERROR Argument `dict[str, str | dict[str, dict[Unknown, Unknown] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `core.trigger.debug.event_selectors.TriggerDebugEventPoller.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:471:21
+ --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:469:21
ERROR Argument `dict[str, Any]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.schedule_service.ScheduleService.to_schedule_config` [bad-argument-type]
- --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:666:49
+ --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:664:49
ERROR Argument `Literal['api-key']` is not assignable to parameter `credential_type` with type `CredentialType | SQLCoreOperations[CredentialType]` in function `models.trigger.TriggerSubscription.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:735:25
+ --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:733:25
ERROR Cannot set item in `str` [unsupported-operation]
- --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:741:5
+ --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:739:5
ERROR Argument `Literal['api-key']` is not assignable to parameter `credential_type` with type `CredentialType | SQLCoreOperations[CredentialType]` in function `models.trigger.TriggerSubscription.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:832:25
+ --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:830:25
ERROR Argument `dict[str, str | dict[str, dict[Unknown, Unknown] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `core.trigger.debug.event_selectors.TriggerDebugEventPoller.__init__` [bad-argument-type]
- --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:859:21
+ --> tests/e2e_tests/containers/trigger/test_trigger_e2e.py:857:21
ERROR Class member `StaticRepo.get_form` overrides parent class `HumanInputFormRepository` in an inconsistent manner [bad-override]
--> tests/e2e_tests/contracts/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:137:9
ERROR Argument `_TestFileReferenceFactory` is not assignable to parameter `file_reference_factory` with type `DifyFileReferenceFactory | None` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__init__` [bad-argument-type]
@@ -2178,6 +2140,12 @@
--> tests/unit_tests/controllers/console/app/test_audio.py:357:21
WARN Identity comparison `False is False` is always True [unnecessary-comparison]
--> tests/unit_tests/controllers/console/app/test_audio.py:437:31
+ERROR Argument `Literal[core.app.entities.app_invoke_entities.InvokeFrom.EXPLORE]` is not assignable to parameter `invoke_from` with type `models.enums.InvokeFrom | SQLCoreOperations[models.enums.InvokeFrom | None] | None` in function `models.model.Message.__init__` [bad-argument-type]
+ --> tests/unit_tests/controllers/console/app/test_conversation.py:189:21
+WARN Module `sqlalchemy.sql.selectable` exists, but was not imported explicitly. You are relying on other modules to load it. [implicit-import]
+ --> tests/unit_tests/controllers/console/app/test_conversation.py:305:22
+WARN Module `sqlalchemy.sql.selectable` exists, but was not imported explicitly. You are relying on other modules to load it. [implicit-import]
+ --> tests/unit_tests/controllers/console/app/test_conversation.py:325:27
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
--> tests/unit_tests/controllers/console/app/test_message.py:58:16
ERROR Argument `Literal[core.app.entities.app_invoke_entities.InvokeFrom.DEBUGGER]` is not assignable to parameter `invoke_from` with type `models.enums.InvokeFrom | SQLCoreOperations[models.enums.InvokeFrom | None] | None` in function `models.model.Conversation.__init__` [bad-argument-type]
@@ -2200,10 +2168,12 @@
--> tests/unit_tests/controllers/console/app/test_message.py:147:16
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> tests/unit_tests/controllers/console/app/test_message.py:150:16
+ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
+ --> tests/unit_tests/controllers/console/app/test_model_config.py:722:51
ERROR Argument `str | None` is not assignable to parameter `s` with type `bytearray | bytes | str` in function `json.loads` [bad-argument-type]
- --> tests/unit_tests/controllers/console/app/test_model_config.py:891:36
+ --> tests/unit_tests/controllers/console/app/test_model_config.py:892:36
ERROR Object of class `WorkflowRun` has no attribute `retry_index` [missing-attribute]
- --> tests/unit_tests/controllers/console/app/test_workflow_run.py:222:5
+ --> tests/unit_tests/controllers/console/app/test_workflow_run.py:217:5
ERROR Missing argument `app_model` in function `handler` [missing-argument]
--> tests/unit_tests/controllers/console/app/test_wraps.py:41:19
ERROR Unexpected keyword argument `app_id` in function `handler` [unexpected-keyword]
@@ -2354,6 +2324,8 @@
--> tests/unit_tests/controllers/console/datasets/test_external.py:88:21
ERROR Argument `UUID` is not assignable to parameter `object` with type `RequestContext` in function `list.append` [bad-argument-type]
--> tests/unit_tests/controllers/console/datasets/test_external.py:88:21
+ERROR Argument `Literal['api', 'console']` is not assignable to parameter `from_source` with type `ConversationFromSource | SQLCoreOperations[ConversationFromSource]` in function `models.model.Conversation.__init__` [bad-argument-type]
+ --> tests/unit_tests/controllers/console/explore/test_completion.py:818:37
ERROR Generator function should return `Generator` [bad-return]
--> tests/unit_tests/controllers/console/tag/test_tags.py:66:23
ERROR Argument `SimpleNamespace` is not assignable to parameter `form` with type `Form` in function `controllers.console.human_input_form._jsonify_form_definition` [bad-argument-type]
@@ -2499,25 +2471,23 @@
ERROR Argument `list[dict[str, Any]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
--> tests/unit_tests/controllers/service_api/app/test_completion.py:256:24
ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `limit` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_conversation.py:69:39
+ --> tests/unit_tests/controllers/service_api/app/test_conversation.py:70:39
ERROR Argument value `Literal[101]` violates Pydantic `le` constraint `Literal[100]` for field `limit` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_conversation.py:74:39
-ERROR Class member `_FakePauseEntity.get_pause_reasons` is marked as an override, but no parent class has a matching attribute [bad-override]
- --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:274:9
+ --> tests/unit_tests/controllers/service_api/app/test_conversation.py:75:39
ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:285:24
+ --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:283:24
ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:532:27
+ --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:527:27
WARN `datetime.datetime.utcnow` is deprecated [deprecated]
- --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:537:28
+ --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:532:28
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/controllers/service_api/app/test_workflow_events.py:544:37
+ --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:539:37
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/controllers/service_api/app/test_workflow_events.py:624:27
+ --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:619: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/controllers/service_api/app/test_workflow_events.py:627:37
+ --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:622:37
ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `RuntimeState` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter.workflow_pause_to_stream_response` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:717:33
+ --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:712:33
ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
--> tests/unit_tests/controllers/service_api/conftest.py:39:16
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `AppStatus | SQLCoreOperations[AppStatus]` in function `models.model.App.__init__` [bad-argument-type]
@@ -2653,39 +2623,39 @@
WARN Identity comparison `True is True` is always True [unnecessary-comparison]
--> tests/unit_tests/controllers/service_api/test___init__.py:241:54
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:354:12
+ --> tests/unit_tests/controllers/service_api/test___init__.py:326:12
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:438:16
+ --> tests/unit_tests/controllers/service_api/test___init__.py:410:16
ERROR `in` is not supported between `Literal['user']` and `object` [not-iterable]
- --> tests/unit_tests/controllers/service_api/test___init__.py:439:16
+ --> tests/unit_tests/controllers/service_api/test___init__.py:411:16
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:454:37
+ --> tests/unit_tests/controllers/service_api/test___init__.py:426:37
ERROR `in` is not supported between `Literal['user']` and `object` [not-iterable]
- --> tests/unit_tests/controllers/service_api/test___init__.py:455:16
+ --> tests/unit_tests/controllers/service_api/test___init__.py:427:16
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:466:16
+ --> tests/unit_tests/controllers/service_api/test___init__.py:438:16
ERROR `not in` is not supported between `Literal['user']` and `object` [not-iterable]
- --> tests/unit_tests/controllers/service_api/test___init__.py:467:16
+ --> tests/unit_tests/controllers/service_api/test___init__.py:439:16
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:487:20
+ --> tests/unit_tests/controllers/service_api/test___init__.py:459:20
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:496:20
+ --> tests/unit_tests/controllers/service_api/test___init__.py:468:20
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:497:16
+ --> tests/unit_tests/controllers/service_api/test___init__.py:469:16
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:501:12
+ --> tests/unit_tests/controllers/service_api/test___init__.py:473:12
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:572:12
+ --> tests/unit_tests/controllers/service_api/test___init__.py:544:12
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:575:12
+ --> tests/unit_tests/controllers/service_api/test___init__.py:547:12
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:578:12
+ --> tests/unit_tests/controllers/service_api/test___init__.py:550:12
ERROR Type `object` is not iterable [not-iterable]
- --> tests/unit_tests/controllers/service_api/test___init__.py:588:5
+ --> tests/unit_tests/controllers/service_api/test___init__.py:560:5
ERROR Type `object` is not iterable [not-iterable]
- --> tests/unit_tests/controllers/service_api/test___init__.py:594:19
+ --> tests/unit_tests/controllers/service_api/test___init__.py:566:19
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/service_api/test___init__.py:775:12
+ --> tests/unit_tests/controllers/service_api/test___init__.py:747:12
ERROR Argument `() -> Session` is not assignable to parameter `session_factory` with type `sessionmaker[@_]` in function `sqlalchemy.orm.scoping.scoped_session.__init__` [bad-argument-type]
--> tests/unit_tests/controllers/service_api/test_wraps.py:105:27
ERROR Missing argument `app_model` in function `protected_view` [missing-argument]
@@ -3141,85 +3111,85 @@
ERROR Argument `Literal['api']` is not assignable to parameter `from_source` with type `ConversationFromSource | SQLCoreOperations[ConversationFromSource]` in function `models.model.Message.__init__` [bad-argument-type]
--> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:645:21
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.py:734:43
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:733: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.py:742:60
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:741: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.py:787:57
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:786:57
ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(e: Exception) -> ErrorStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:802:65
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:801:65
ERROR `(**kwargs: Sequence[NodeExecutionSnapshot] | str) -> Literal['started']` is not assignable to attribute `workflow_start_to_stream_response` with type `(*, task_id: str, workflow_run_id: str, workflow_id: str, reason: WorkflowStartReason, node_execution_snapshots: Sequence[NodeExecutionSnapshot] = ...) -> WorkflowStartStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:817:83
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:816: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.py:851:66
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:850: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.py:852:54
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:851:54
ERROR `(outputs: Unknown) -> list[dict[str, str]]` is not assignable to attribute `fetch_files_from_node_outputs` with type `(outputs_dict: Mapping[str, Any] | None) -> Sequence[Mapping[str, Any]]` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:865:79
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:864:79
ERROR `(**kwargs: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent | str) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(*, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:868:89
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:867: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.py:878:64
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:877:64
ERROR `(outputs: Unknown) -> list[@_]` is not assignable to attribute `fetch_files_from_node_outputs` with type `(outputs_dict: Mapping[str, Any] | None) -> Sequence[Mapping[str, Any]]` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:885:79
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:884:79
ERROR `(**kwargs: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent | str) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(*, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:886:89
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:885: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.py:896:52
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:895:52
ERROR `(outputs: Unknown) -> list[@_]` is not assignable to attribute `fetch_files_from_node_outputs` with type `(outputs_dict: Mapping[str, Any] | None) -> Sequence[Mapping[str, Any]]` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:902:79
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:901:79
ERROR `(**kwargs: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent | str) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(*, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:903:89
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:902: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.py:915:52
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:914:52
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.py:916:52
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:915:52
ERROR `(**kwargs: QueueIterationStartEvent | str) -> Literal['iter_start']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:923:93
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:922:93
ERROR `(**kwargs: QueueIterationNextEvent | str) -> Literal['iter_next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:926:92
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:925:92
ERROR `(**kwargs: QueueIterationCompletedEvent | str) -> Literal['iter_done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:927:97
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:926:97
ERROR `(**kwargs: QueueLoopStartEvent | str) -> Literal['loop_start']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:930:88
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:929:88
ERROR `(**kwargs: QueueLoopNextEvent | str) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:931:87
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:930:87
ERROR `(**kwargs: QueueLoopCompletedEvent | str) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:932:92
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:931:92
ERROR `(**kwargs: RuntimeState | int | str | None) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(*, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: RuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:994:84
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:993:84
ERROR `(**kwargs: QueueWorkflowPausedEvent | RuntimeState | str) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(*, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: RuntimeState) -> list[StreamResponse]` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:995:83
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:994:83
ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(e: Exception) -> ErrorStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1000:65
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:999:65
ERROR `(**kwargs: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent | str) -> Literal['node_finish']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(*, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1026:89
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1025: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.py:1061:43
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1060: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.py:1067:47
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1066: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.py:1067:68
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1066: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.py:1067:96
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1066: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.py:1088:66
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1087:66
ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1119:78
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1118:78
ERROR `(**kwargs: QueueHumanInputFormFilledEvent | str) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(*, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1132:92
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1131:92
ERROR `(**kwargs: QueueHumanInputFormTimeoutEvent | str) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(*, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1133:93
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1132:93
ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `() -> MessageEndStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1192:52
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1191:52
ERROR `(answer: Unknown) -> Literal['safe']` is not assignable to attribute `handle_output_moderation_when_task_finished` with type `(completion: str) -> str | None` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1214:84
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1213:84
ERROR `(**kwargs: Unknown) -> Literal['replace']` is not assignable to attribute `message_replace_to_stream_response` with type `(answer: str, reason: str = '') -> MessageReplaceStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1215:78
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1214:78
ERROR `() -> Literal['end']` is not assignable to attribute `_message_end_to_stream_response` with type `() -> MessageEndStreamResponse` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1216:52
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1215:52
ERROR `(**kwargs: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent | str) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(*, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
- --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1232:89
+ --> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline.py:1231:89
ERROR Argument `core.app.entities.app_invoke_entities.InvokeFrom` is not assignable to parameter `invoke_from` with type `models.enums.InvokeFrom | SQLCoreOperations[models.enums.InvokeFrom | None] | None` in function `models.model.Conversation.__init__` [bad-argument-type]
--> tests/unit_tests/core/app/apps/agent_app/test_app_generator.py:120:21
ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
@@ -3352,6 +3322,8 @@
--> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:872:16
ERROR Object of class `NoneType` has no attribute `writable` [missing-attribute]
--> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:873:16
+ERROR Argument `Literal['api']` is not assignable to parameter `from_source` with type `ConversationFromSource | SQLCoreOperations[ConversationFromSource]` in function `models.model.Conversation.__init__` [bad-argument-type]
+ --> tests/unit_tests/core/app/apps/agent_app/test_session_store.py:84:21
ERROR Cannot index into `str` [bad-index]
--> tests/unit_tests/core/app/apps/agent_chat/test_generate_response_converter.py:164:16
ERROR Cannot index into `str` [bad-index]
@@ -3415,19 +3387,19 @@
ERROR Class member `_RecordingWorkflowAppRunner._publish_event` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
--> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1477:9
ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
- --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1737:16
+ --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1744:16
ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
- --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1738:16
+ --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1745:16
ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
- --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1741:16
+ --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1748:16
ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
- --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1759:16
+ --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1766:16
ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
- --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1760:16
+ --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1767:16
ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
- --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1763:16
+ --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1770:16
ERROR Object of type `FileInputConfig | FileListInputConfig | ParagraphInputConfig | SelectInputConfig` has no attribute `option_source` [missing-attribute]
- --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1815:16
+ --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1822:16
ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.completion.app_config_manager.CompletionAppConfigManager.get_app_config` [bad-argument-type]
--> tests/unit_tests/core/app/apps/completion/test_app_config_manager.py:49:34
ERROR Argument `dict[str, bool]` is not assignable to parameter `annotation_reply` with type `AnnotationReplyDisabledConfig | AnnotationReplyEnabledConfig | None` in function `core.app.apps.completion.app_config_manager.CompletionAppConfigManager.get_app_config` [bad-argument-type]
@@ -3620,6 +3592,8 @@
--> tests/unit_tests/core/app/apps/test_workflow_app_runner.py:1056:55
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.py:1073:29
+ERROR Generator function should return `Generator` [bad-return]
+ --> tests/unit_tests/core/app/apps/workflow/test_active_workflow_tasks.py:15:29
ERROR Argument `tuple[Literal['layer']]` is not assignable to parameter `graph_engine_layers` with type `Sequence[Layer]` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.\n\n... (truncated) ... |
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #45088 +/- ##
========================================
Coverage 89.55% 89.56%
========================================
Files 6013 6014 +1
Lines 377281 377479 +198
Branches 76412 76432 +20
========================================
+ Hits 337882 338083 +201
+ Misses 33404 33402 -2
+ Partials 5995 5994 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #45084
Summary
parse_file_reference()promises a lenient fallback for malformed canonical references, but only catches base64/JSON decode errors. A reference whose payload decodes to valid non-object JSON ([],null,"abc",3) reachespayload.get("record_id")and raisesAttributeError, which escapes theRequestDownloadFileMappingvalidator (500 instead of a 4xx validation error) and the Agent-v2 output checker (crash instead of a structured failure).api/tests/unit_tests/core/workflow/test_file_reference_non_object_payload.pycovering the valid round trip, raw ids, malformed encodings, non-object payloads, and the validator path.A known sibling with the same pattern lives in
dify-agent/src/dify_agent/agent_stub/protocol/agent_stub.py(is_canonical_dify_file_reference); it is outside this api-scoped fix and can be guarded in a follow-up.Screenshots
Not a UI change.
Checklist
e5acabc3, 6 of the failure-path tests fail withAttributeError: 'list' object has no attribute 'get'; with this change the module's 15 tests pass. The added cases also pin the lenient fallback branches (object without a validrecord_id, non-stringstorage_key, empty input) and the Agent-v2 output checker: a non-object payload now returnsTYPE_CHECK_FAILEDwith a clear reason instead of an escapingAttributeError.ruff check,ruff format --checkclean.From Claude Code