Skip to content

fix(qdrant): scope ID deletion to the dataset - #45586

Merged
Stream29 merged 1 commit into
langgenius:mainfrom
jipeng6036-del:fix/qdrant-delete-dataset-scope-pr6
Nov 5, 2026
Merged

Stream29 merged 1 commit into
langgenius:mainfrom
jipeng6036-del:fix/qdrant-delete-dataset-scope-pr6

Conversation

@jipeng6036-del

Copy link
Copy Markdown
Contributor

Summary

Scope Qdrant delete_by_ids to the provider's dataset group. When two datasets share a collection and an attachment ID, deleting that ID for dataset A previously removed dataset B's vector too. The filter now requires both the requested document ID and group_id.

This addresses the Qdrant dataset-scoping review on #42642, related to #42641. The document-cleanup work in #42642 remains separate; this PR only changes the provider prerequisite.

Validation

  • Complete Qdrant provider test module: 16 passed on Windows, Python 3.13.12, pinned qdrant-client 1.9.0.
  • The two new cases construct the real provider in path: mode and use the official SDK's native local engine. Before the fix, the empty-ID control passes and the shared-attachment case fails because both dataset B points are deleted. With the fix, both pass; unrelated dataset A points and dataset B points remain.
  • Ruff format/check, response-contract lint, all four backend guards, import contracts and dotenv lint passed using the Makefile-equivalent backend commands on Windows. Scoped production Pyrefly is clean. An additional forced strict check of the legacy test module has the same 57 diagnostics on baseline and candidate, with none on the new test.

These are provider/native-SDK checks, not a deployed API or cloud-backend run. Upstream CI runs after this PR is opened.

Screenshots

Not applicable to this backend provider change.

Checklist

From Codex

Require the dataset group alongside document IDs in shared collections.
Add native SDK regressions preserving other datasets and unrelated points.

Refs langgenius#42641, langgenius#42642
@github-actions github-actions Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 4, 2026

@Stream29 Stream29 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-11-05 07:06:31.862516084 +0000
+++ /tmp/pyrefly_pr.txt	2026-11-05 07:06:19.954245365 +0000
@@ -111,45 +111,45 @@
 ERROR Argument `list[Document | SimpleNamespace]` is not assignable to parameter `documents` with type `list[Document]` in function `dify_vdb_pgvector.pgvector.PGVector.add_texts` [bad-argument-type]
    --> providers/vdb/vdb-pgvector/tests/unit_tests/src/dify_vdb_pgvector/test_pgvector.py:392:28
 ERROR Object of class `ModuleType` has no attribute `QdrantClient` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:108:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:110:5
 ERROR Object of class `ModuleType` has no attribute `FilterSelector` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:109:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:111:5
 ERROR Object of class `ModuleType` has no attribute `HnswConfigDiff` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:110:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:112:5
 ERROR Object of class `ModuleType` has no attribute `PayloadSchemaType` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:111:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:113:5
 ERROR Object of class `ModuleType` has no attribute `TextIndexParams` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:112:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:114:5
 ERROR Object of class `ModuleType` has no attribute `TextIndexType` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:113:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:115:5
 ERROR Object of class `ModuleType` has no attribute `TokenizerType` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:114:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:116:5
 ERROR Object of class `ModuleType` has no attribute `VectorParams` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:115:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:117:5
 ERROR Object of class `ModuleType` has no attribute `Distance` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:116:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:118:5
 ERROR Object of class `ModuleType` has no attribute `PointStruct` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:117:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:119:5
 ERROR Object of class `ModuleType` has no attribute `Filter` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:118:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:120:5
 ERROR Object of class `ModuleType` has no attribute `FieldCondition` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:119:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:121:5
 ERROR Object of class `ModuleType` has no attribute `MatchValue` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:120:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:122:5
 ERROR Object of class `ModuleType` has no attribute `MatchAny` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:121:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:123:5
 ERROR Object of class `ModuleType` has no attribute `MatchText` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:122:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:124:5
 ERROR Object of class `ModuleType` has no attribute `UnexpectedResponse` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:123:5
-ERROR Object of class `ModuleType` has no attribute `models` [missing-attribute]
    --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:125:5
+ERROR Object of class `ModuleType` has no attribute `models` [missing-attribute]
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:127:5
 ERROR Object of class `ModuleType` has no attribute `QdrantLocal` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:126:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:128:5
 ERROR Object of class `ModuleType` has no attribute `qdrant_local` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:127:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:129:5
 ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
-   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:429:5
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:431:5
 ERROR Object of class `ModuleType` has no attribute `VECTOR` [missing-attribute]
   --> providers/vdb/vdb-relyt/tests/unit_tests/src/dify_vdb_relyt/test_relyt_vector.py:24:5
 ERROR Argument `Index | None` is not assignable to parameter `index` with type `Index` in function `tcvectordb.rpc.model.collection.RPCCollection.__init__` [bad-argument-type]
@@ -2571,103 +2571,103 @@
 ERROR Argument `None` is not assignable to parameter `value` with type `SQLCoreOperations[datetime] | datetime` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
    --> tests/unit_tests/controllers/service_api/dataset/rag_pipeline/test_rag_pipeline_workflow.py:868:34
 ERROR No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, object]) [no-matching-overload]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:144:17
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:143:17
 ERROR No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, object]) [no-matching-overload]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:188:17
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:187:17
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `tenant_id` with type `SQLCoreOperations[str] | str` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `dataset_id` with type `SQLCoreOperations[str] | str` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `position` with type `SQLCoreOperations[int] | int` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `data_source_type` with type `DataSourceType | SQLCoreOperations[DataSourceType]` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `batch` with type `SQLCoreOperations[str] | str` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `name` with type `SQLCoreOperations[str] | str` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `created_from` with type `DocumentCreatedFrom | SQLCoreOperations[DocumentCreatedFrom]` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `created_by` with type `SQLCoreOperations[str] | str` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `data_source_info` with type `SQLCoreOperations[str | None] | str | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `dataset_process_rule_id` with type `SQLCoreOperations[str | None] | str | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `created_api_request_id` with type `SQLCoreOperations[str | None] | str | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `processing_started_at` with type `SQLCoreOperations[datetime | None] | datetime | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `file_id` with type `SQLCoreOperations[str | None] | str | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `word_count` with type `SQLCoreOperations[int | None] | int | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `parsing_completed_at` with type `SQLCoreOperations[datetime | None] | datetime | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `cleaning_completed_at` with type `SQLCoreOperations[datetime | None] | datetime | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `splitting_completed_at` with type `SQLCoreOperations[datetime | None] | datetime | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `tokens` with type `SQLCoreOperations[int | None] | int | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `indexing_latency` with type `SQLCoreOperations[float | None] | float | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `completed_at` with type `SQLCoreOperations[datetime | None] | datetime | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `is_paused` with type `SQLCoreOperations[bool | None] | bool | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `paused_by` with type `SQLCoreOperations[str | None] | str | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `paused_at` with type `SQLCoreOperations[datetime | None] | datetime | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `error` with type `SQLCoreOperations[str | None] | str | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `stopped_at` with type `SQLCoreOperations[datetime | None] | datetime | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `indexing_status` with type `IndexingStatus | SQLCoreOperations[IndexingStatus]` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `enabled` with type `SQLCoreOperations[bool] | bool` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `disabled_at` with type `SQLCoreOperations[datetime | None] | datetime | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `disabled_by` with type `SQLCoreOperations[str | None] | str | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `archived` with type `SQLCoreOperations[bool] | bool` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `archived_reason` with type `SQLCoreOperations[str | None] | str | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `archived_by` with type `SQLCoreOperations[str | None] | str | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `archived_at` with type `SQLCoreOperations[datetime | None] | datetime | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `doc_type` with type `DocumentDocType | SQLCoreOperations[DocumentDocType | None] | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `doc_metadata` with type `SQLCoreOperations[dict[str, Any] | None] | dict[str, Any] | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `doc_form` with type `IndexStructureType | SQLCoreOperations[IndexStructureType]` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `doc_language` with type `SQLCoreOperations[str | None] | str | None` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `need_summary` with type `SQLCoreOperations[bool] | bool` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Unpacked keyword argument `DataSourceType | DocumentCreatedFrom | DocumentDocType | IndexStructureType | IndexingStatus | bool | datetime | float | int | str | None` is not assignable to parameter `id` with type `SQLCoreOperations[str] | str` in function `models.dataset.Document.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:191:25
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:190:25
 ERROR Object of class `Document` has no attribute `summary_index_status` [missing-attribute]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:222:33
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:221:33
 ERROR Missing argument `session` in function `services.knowledge.dataset_service.DocumentService.get_document` [missing-argument]
-   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:434:46
+   --> tests/unit_tests/controllers/service_api/dataset/test_document.py:433:46
+ERROR Object of class `FunctionType` has no attribute `__apidoc__` [missing-attribute]
+    --> tests/unit_tests/controllers/service_api/dataset/test_document.py:1769:16
 ERROR Object of class `FunctionType` has no attribute `__apidoc__` [missing-attribute]
     --> tests/unit_tests/controllers/service_api/dataset/test_document.py:1770:16
 ERROR Object of class `FunctionType` has no attribute `__apidoc__` [missing-attribute]
-    --> tests/unit_tests/controllers/service_api/dataset/test_document.py:1771:16
+    --> tests/unit_tests/controllers/service_api/dataset/test_document.py:1774:16
 ERROR Object of class `FunctionType` has no attribute `__apidoc__` [missing-attribute]
     --> tests/unit_tests/controllers/service_api/dataset/test_document.py:1775:16
 ERROR Object of class `FunctionType` has no attribute `__apidoc__` [missing-attribute]
-    --> tests/unit_tests/controllers/service_api/dataset/test_document.py:1776:16
+    --> tests/unit_tests/controllers/service_api/dataset/test_document.py:1779:16
 ERROR Object of class `FunctionType` has no attribute `__apidoc__` [missing-attribute]
     --> tests/unit_tests/controllers/service_api/dataset/test_document.py:1780:16
-ERROR Object of class `FunctionType` has no attribute `__apidoc__` [missing-attribute]
-    --> tests/unit_tests/controllers/service_api/dataset/test_document.py:1781:16
 ERROR Argument `Literal['completed']` is not assignable to parameter `indexing_status` with type `IndexingStatus | SQLCoreOperations[IndexingStatus]` in function `models.dataset.Document.__init__` [bad-argument-type]
    --> tests/unit_tests/controllers/service_api/dataset/test_segment.py:171:25
 ERROR Argument `str` is not assignable to parameter `doc_form` with type `IndexStructureType | SQLCoreOperations[IndexStructureType]` in function `models.dataset.Document.__init__` [bad-argument-type]
@@ -3969,27 +3969,27 @@
 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/unit_tests/core/app/task_pipeline/test_easy_ui_based_generate_task_pipeline.py:663:21
 ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
-  --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:44:16
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:298:16
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:299:16
+  --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:45:16
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:300:16
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:301:16
+ERROR `None` is not subscriptable [unsupported-operation]
+   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:302:16
+ERROR `None` is not subscriptable [unsupported-operation]
+   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:303:16
 WARN Identity comparison `True is False` is always False [unnecessary-comparison]
-   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:302:90
+   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:304:90
 WARN Identity comparison `True is False` is always False [unnecessary-comparison]
-   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:313:90
+   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:315:90
 ERROR Object of class `NoneType` has no attribute `name` [missing-attribute]
-   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:336:16
+   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:338:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:464:16
+   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:466:16
 ERROR Object of class `NoneType` has no attribute `account` [missing-attribute]
-   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:465:16
+   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:467:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:583:17
+   --> tests/unit_tests/core/app/task_pipeline/test_message_cycle_manager.py:585:17
 ERROR `SimpleNamespace` is not assignable to attribute `_tracer` with type `Tracer | None` [bad-assignment]
   --> tests/unit_tests/core/app/workflow/layers/test_observability.py:46:29
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.app.workflow.layers.observability.ObservabilityLayer.node_run_context` [bad-argument-type]
@@ -4143,11 +4143,11 @@
 WARN Identity comparison `True is False` is always False [unnecessary-comparison]
    --> tests/unit_tests/core/mcp/test_mcp_client.py:508:39
 ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
-  --> tests/unit_tests/core/memory/test_token_buffer_memory.py:67:16
+  --> tests/unit_tests/core/memory/test_token_buffer_memory.py:68:16
 ERROR `in` is not supported between `int` and `object` [not-iterable]
-   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:336:16
+   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:338:16
 ERROR Object of class `FunctionType` has no attribute `side_effect` [missing-attribute]
-   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:440:9
+   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:442:9
 ERROR Object of class `Account` has no attribute `tenant_id` [missing-attribute]
    --> tests/unit_tests/core/plugin/backwards_invocation/test_app.py:439:16
 ERROR Object of class `Account` has no attribute `app_id` [missing-attribute]
@@ -4215,7 +4215,7 @@
 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/plugin/impl/test_model_runtime_factory.py:429:21
 ERROR No matching overload found for function `typing.MutableMapping.update` called with arguments: (object) [no-matching-overload]
-  --> tests/unit_tests/core/plugin/impl/test_oauth.py:72:33
+  --> tests/unit_tests/core/plugin/impl/test_oauth.py:71:33
 ERROR Object of class `NoneType` has no attribute `model` [missing-attribute]
     --> tests/unit_tests/core/plugin/impl/test_plugin.py:1045:20
 ERROR Object of class `NoneType` has no attribute `model` [missing-attribute]
@@ -4443,45 +4443,45 @@
 ERROR `None` is not assignable to attribute `_creator_user_role` with type `CreatorUserRole` [bad-assignment]
    --> tests/unit_tests/core/repositories/test_sqlalchemy_workflow_execution_repository.py:372:39
 ERROR Argument `Literal[core.entities.provider_entities.ProviderQuotaType.TRIAL]` is not assignable to parameter `quota_type` with type `models.enums.ProviderQuotaType | SQLCoreOperations[models.enums.ProviderQuotaType | None] | None` in function `models.provider.Provider.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:121:20
+   --> tests/unit_tests/core/test_provider_manager.py:120:20
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.ProviderModelSetting.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:179:20
+   --> tests/unit_tests/core/test_provider_manager.py:178:20
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.LoadBalancingModelConfig.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:192:24
+   --> tests/unit_tests/core/test_provider_manager.py:191:24
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.LoadBalancingModelConfig.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:201:24
+   --> tests/unit_tests/core/test_provider_manager.py:200:24
 ERROR Argument `list[ProviderModelSetting]` is not assignable to parameter `provider_model_settings` with type `list[_ProviderModelSettingCacheEntry] | None` in function `core.provider_manager.ProviderManager._to_model_settings` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:222:37
+   --> tests/unit_tests/core/test_provider_manager.py:221:37
 ERROR Argument `list[LoadBalancingModelConfig]` is not assignable to parameter `load_balancing_model_configs` with type `list[_LoadBalancingModelConfigCacheEntry] | None` in function `core.provider_manager.ProviderManager._to_model_settings` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:223:42
+   --> tests/unit_tests/core/test_provider_manager.py:222:42
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.ProviderModelSetting.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:266:20
+   --> tests/unit_tests/core/test_provider_manager.py:265:20
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.LoadBalancingModelConfig.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:275:24
+   --> tests/unit_tests/core/test_provider_manager.py:274:24
 ERROR Argument `list[ProviderModelSetting]` is not assignable to parameter `provider_model_settings` with type `list[_ProviderModelSettingCacheEntry] | None` in function `core.provider_manager.ProviderManager._to_model_settings` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:289:67
+   --> tests/unit_tests/core/test_provider_manager.py:288:67
 ERROR Argument `list[LoadBalancingModelConfig]` is not assignable to parameter `load_balancing_model_configs` with type `list[_LoadBalancingModelConfigCacheEntry] | None` in function `core.provider_manager.ProviderManager._to_model_settings` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:289:77
+   --> tests/unit_tests/core/test_provider_manager.py:288:77
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.ProviderModelSetting.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:479:20
+   --> tests/unit_tests/core/test_provider_manager.py:478:20
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.LoadBalancingModelConfig.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:490:24
+   --> tests/unit_tests/core/test_provider_manager.py:489:24
 ERROR Argument `list[ProviderModelSetting]` is not assignable to parameter `provider_model_settings` with type `list[_ProviderModelSettingCacheEntry] | None` in function `core.provider_manager.ProviderManager._to_model_settings` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:510:37
+   --> tests/unit_tests/core/test_provider_manager.py:509:37
 ERROR Argument `list[LoadBalancingModelConfig]` is not assignable to parameter `load_balancing_model_configs` with type `list[_LoadBalancingModelConfigCacheEntry] | None` in function `core.provider_manager.ProviderManager._to_model_settings` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:511:42
+   --> tests/unit_tests/core/test_provider_manager.py:510:42
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.ProviderModelSetting.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:529:20
+   --> tests/unit_tests/core/test_provider_manager.py:528:20
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.LoadBalancingModelConfig.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:540:24
+   --> tests/unit_tests/core/test_provider_manager.py:539:24
 ERROR Argument `Literal['llm']` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.LoadBalancingModelConfig.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:549:24
+   --> tests/unit_tests/core/test_provider_manager.py:548:24
 ERROR Argument `list[ProviderModelSetting]` is not assignable to parameter `provider_model_settings` with type `list[_ProviderModelSettingCacheEntry] | None` in function `core.provider_manager.ProviderManager._to_model_settings` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:570:37
+   --> tests/unit_tests/core/test_provider_manager.py:569:37
 ERROR Argument `list[LoadBalancingModelConfig]` is not assignable to parameter `load_balancing_model_configs` with type `list[_LoadBalancingModelConfigCacheEntry] | None` in function `core.provider_manager.ProviderManager._to_model_settings` [bad-argument-type]
-   --> tests/unit_tests/core/test_provider_manager.py:571:42
+   --> tests/unit_tests/core/test_provider_manager.py:570:42
 WARN Identity comparison `False is True` is always False [unnecessary-comparison]
-    --> tests/unit_tests/core/test_provider_manager.py:1376:30
+    --> tests/unit_tests/core/test_provider_manager.py:1309:30
 ERROR Class member `DummyTool.get_runtime_parameters` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> tests/unit_tests/core/tools/__base/test_tool.py:71:9
 ERROR Object of type `ToolInvokeMessage.BlobChunkMessage | ToolInvokeMessage.BlobMessage | ToolInvokeMessage.FileMessage | ToolInvokeMessage.JsonMessage | ToolInvokeMessage.LogMessage | ToolInvokeMessage.RetrieverResourceMessage | ToolInvokeMessage.TextMessage | ToolInvokeMessage.VariableMessage | None` has no attribute `text` [missing-attribute]
@@ -5145,97 +5145,87 @@
 ERROR Argument `object` is not assignable to parameter `output` with type `Decimal | Iterable[Any] | Mapping[str, Any] | bool | bytearray | bytes | float | int | str | None` in function `clients.agent_backend.event_adapter.AgentBackendRunSucceededInternalEvent.__init__` [bad-argument-type]
   --> tests/unit_tests/core/workflow/nodes/agent_v2/test_output_adapter.py:51:16
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:357:18
-ERROR Argument `test_single_step_loads_variables_referenced_only_by_knowledge_filters.DraftVariableLoader` is not assignable to parameter `variable_loader` with type `VariableLoader` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:415:25
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:421:18
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:480:18
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:500:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:507:22
+   --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:283:22
 ERROR Argument `CapturingPluginLayerBuilder` is not assignable to parameter `dify_tools_builder` with type `WorkflowAgentDifyToolLayersBuilder | None` in function `core.workflow.nodes.agent_v2.runtime_request_builder.WorkflowAgentRuntimeRequestBuilder.__init__` [bad-argument-type]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1240:68
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1016:68
 ERROR Cannot index into `bool` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1245:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1021:12
 ERROR Cannot index into `float` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1245:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1021:12
 ERROR Cannot index into `int` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1245:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1021:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1245:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1021:12
 ERROR Cannot index into `str` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1245:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1021:12
 ERROR Cannot index into `bool` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1245:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1021:12
 ERROR Cannot index into `float` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1245:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1021:12
 ERROR Cannot index into `int` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1245:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1021:12
 ERROR Cannot index into `list[JsonValue]` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1245:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1021:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1245:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1021:12
 ERROR Cannot index into `dict[str, JsonValue]` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1245:47
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1021:47
 ERROR Cannot index into `bool` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1246:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1022:12
 ERROR Cannot index into `float` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1246:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1022:12
 ERROR Cannot index into `int` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1246:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1022:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1246:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1022:12
 ERROR Cannot index into `str` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1246:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1022:12
 ERROR Cannot index into `bool` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1246:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1022:12
 ERROR Cannot index into `float` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1246:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1022:12
 ERROR Cannot index into `int` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1246:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1022:12
 ERROR Cannot index into `list[JsonValue]` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1246:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1022:12
 ERROR `None` is not subscriptable [unsupported-operation]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1246:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1022:12
 ERROR Cannot index into `dict[str, JsonValue]` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1246:52
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1022:52
 ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1471:25
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1247:25
 ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1472:18
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1248:18
 ERROR Class member `FileVariablePool.get` overrides parent class `FakeVariablePool` in an inconsistent manner [bad-override]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1489:13
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1265:13
 ERROR Class member `FileVariablePool.get` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1489:13
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1265:13
 ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1514:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1290:12
 ERROR Class member `FileMappingVariablePool.get` overrides parent class `FakeVariablePool` in an inconsistent manner [bad-override]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1527:13
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1303:13
 ERROR Class member `FileMappingVariablePool.get` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1527:13
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1303:13
 ERROR Argument `test_previous_node_file_mapping_strips_extra_fields_in_workflow_context.FileMappingVariablePool` is not assignable to parameter `variable_pool` with type `VariablePoolReader` in function `core.workflow.nodes.agent_v2.runtime_request_builder.WorkflowAgentRuntimeBuildContext.__replace__` [bad-argument-type]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1539:49
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1315:49
 ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1581:12
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1357:12
 ERROR Class member `FileArrayVariablePool.get` overrides parent class `FakeVariablePool` in an inconsistent manner [bad-override]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1592:13
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1368:13
 ERROR Class member `FileArrayVariablePool.get` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1592:13
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1368:13
 ERROR Class member `UploadedFilesVariablePool.get` overrides parent class `FakeVariablePool` in an inconsistent manner [bad-override]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1645:13
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1421:13
 ERROR Class member `UploadedFilesVariablePool.get` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1645:13
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1421:13
 ERROR Class member `LongRemoteUrlVariablePool.get` overrides parent class `FakeVariablePool` in an inconsistent manner [bad-override]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1687:13
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1463:13
 ERROR Class member `LongRemoteUrlVariablePool.get` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1687:13
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1463:13
 ERROR Argument `CapturingPluginLayerBuilder` is not assignable to parameter `dify_tools_builder` with type `WorkflowAgentDifyToolLayersBuilder | None` in function `core.workflow.nodes.agent_v2.runtime_request_builder.WorkflowAgentRuntimeRequestBuilder.__init__` [bad-argument-type]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:2035:68
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1811:68
 ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:2036:14
+    --> tests/unit_tests/core/workflow/nodes/agent_v2/test_runtime_request_builder.py:1812:14
 ERROR Argument `_GraphParams` is not assignable to parameter `init_params` with type `InitParams` in function `core.workflow.nodes.datasource.datasource_node.DatasourceNode.__init__` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/datasource/test_datasource_node.py:105:21
 ERROR Argument `_GraphState` is not assignable to parameter `runtime_state` with type `RuntimeState` in function `core.workflow.nodes.datasource.datasource_node.DatasourceNode.__init__` [bad-argument-type]
@@ -5969,15 +5959,13 @@
 ERROR Argument `_FakeRedisClient` is not assignable to parameter `redis_client` with type `Redis[Unknown] | RedisCluster[Unknown]` in function `libs.broadcast_channel.redis.pubsub_channel.BroadcastChannel.__init__` [bad-argument-type]
     --> tests/unit_tests/services/test_app_generate_service.py:1245:38
 ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `str` in function `services.app_service.AppService.create_app` [bad-argument-type]
-   --> tests/unit_tests/services/test_app_service.py:261:17
+   --> tests/unit_tests/services/test_app_service.py:257:17
 ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `str` in function `services.app_service.AppService.create_app` [bad-argument-type]
-   --> tests/unit_tests/services/test_app_service.py:326:17
+   --> tests/unit_tests/services/test_app_service.py:322:17
 ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `str` in function `services.app_service.AppService.create_app` [bad-argument-type]
-   --> tests/unit_tests/services/test_app_service.py:359:17
+   --> tests/unit_tests/services/test_app_service.py:355:17
 ERROR Argument `Literal['advanced-chat', 'agent', 'agent-chat', 'channel', 'chat', 'completion', 'rag-pipeline', 'workflow']` is not assignable to parameter `mode` with type `Literal['advanced-chat', 'agent', 'agent-chat', 'chat', 'completion', 'workflow']` in function `services.entities.app_entities.CreateAppParams.__init__` [bad-argument-type]
-   --> tests/unit_tests/services/test_app_service.py:360:65
-ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `str` in function `services.app_service.AppService.create_app` [bad-argument-type]
-    --> tests/unit_tests/services/test_app_service.py:1111:17
+   --> tests/unit_tests/services/test_app_service.py:356:65
 ERROR `in` is not supported between `Literal['Quota limit reached']` and `None` [not-iterable]
    --> tests/unit_tests/services/test_async_workflow_service.py:344: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]

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 83.43% 83.39% -0.04%
Strict coverage 83.09% 83.04% -0.05%
Typed symbols 86,630 86,331 -299
Untyped symbols 17,276 17,272 -4
Modules 4396 4386 -10

@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.88%. Comparing base (0d97e36) to head (bf1b71d).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #45586   +/-   ##
=======================================
  Coverage   89.88%   89.88%           
=======================================
  Files        6245     6245           
  Lines      391154   391168   +14     
  Branches    78435    78435           
=======================================
+ Hits       351575   351593   +18     
+ Misses      33481    33476    -5     
- Partials     6098     6099    +1     
Flag Coverage Δ
api 89.67% <100.00%> (-0.01%) ⬇️

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

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Stream29
Stream29 added this pull request to the merge queue Nov 5, 2026
Merged via the queue into langgenius:main with commit 0712c68 Nov 5, 2026
50 of 51 checks passed
fatelei pushed a commit to fatelei/dify that referenced this pull request Nov 9, 2026
@wylswz wylswz mentioned this pull request Nov 17, 2026
1 task done
xhdnoah pushed a commit to xhdnoah/dify that referenced this pull request Nov 18, 2026
xhdnoah pushed a commit that referenced this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants