Skip to content

refactor(api): remove superseded App and Agent execution paths - #43696

Open
41tair wants to merge 34 commits into
refactor/api-76-10-12from
refactor/api-76-10-13
Open

41tair wants to merge 34 commits into
refactor/api-76-10-12from
refactor/api-76-10-13

Conversation

@41tair

@41tair 41tair commented Oct 8, 2026

Copy link
Copy Markdown
Member

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

part of #39993

Remove superseded App and Agent execution paths.

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've verified the change and added or updated tests where meaningful regression risk justifies coverage.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and vp staged (frontend) to appease the lint gods

From Codex

@ghfind-review ghfind-review Bot added the review: top ghfind author score; see https://ghfind.com label Oct 8, 2026
@github-actions github-actions Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 81.51% 82.10% +0.60%
Strict coverage 81.15% 81.76% +0.61%
Typed symbols 85,535 89,988 +4,453
Untyped symbols 19,494 19,701 +207
Modules 4396 4599 +203

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-10-31 15:08:07.500887312 +0000
+++ /tmp/pyrefly_pr.txt	2026-10-31 15:07:48.344898066 +0000
@@ -111,45 +111,49 @@
 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:111: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:112: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:113: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:114: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:115: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:116: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:117: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:118: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:119: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:120: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:121: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:122: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:123: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:124: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:125: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
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:126: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
+   --> 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 `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:129: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:130:5
+ERROR `None` is not subscriptable [unsupported-operation]
+   --> providers/vdb/vdb-qdrant/tests/unit_tests/src/dify_vdb_qdrant/test_qdrant_vector.py:387:16
+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:411: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:451: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]
@@ -249,77 +253,77 @@
 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/controllers/web/test_wraps.py:237:18
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-  --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:38:23
+  --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:45:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-  --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:53:27
+  --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:60:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-  --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:73:60
+  --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:80:64
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-  --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:78:39
+  --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:85:39
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-  --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:99:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:106:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:111:27
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:118:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:130:60
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:137:64
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:153:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:160:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:165:27
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:172:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:184:60
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:191:64
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:207:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:214:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:219:27
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:226:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:238:60
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:245:64
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:271:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:278:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:282:60
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:289:64
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:317:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:324:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:328:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:335:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:359:60
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:366:64
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:364:39
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:371:39
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:386:60
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:393:64
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:412:27
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:419:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:424:27
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:431:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:444:60
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:451:64
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:471:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:478:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:481:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:488:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:499:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:506:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:540:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:547:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:550:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:557:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:588:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:595:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:598:23
+   --> tests/e2e_tests/containers/core/rag/retrieval/test_dataset_retrieval_integration.py:605:23
 ERROR Argument `str` 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/core/workflow/test_human_input_resume_node_execution.py:187:23
+   --> tests/e2e_tests/containers/core/workflow/test_human_input_resume_node_execution.py:188:23
 ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
-  --> tests/e2e_tests/containers/helpers/execution_extra_content.py:48:14
+  --> tests/e2e_tests/containers/helpers/execution_extra_content.py:49:14
 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/helpers/execution_extra_content.py:58:14
+  --> tests/e2e_tests/containers/helpers/execution_extra_content.py:59: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]
-  --> tests/e2e_tests/containers/helpers/execution_extra_content.py:59:19
+  --> tests/e2e_tests/containers/helpers/execution_extra_content.py:60:19
 ERROR Argument `Literal['chat']` is not assignable to parameter `mode` with type `AppMode | SQLCoreOperations[AppMode]` in function `models.model.Conversation.__init__` [bad-argument-type]
-  --> tests/e2e_tests/containers/helpers/execution_extra_content.py:77:14
+  --> tests/e2e_tests/containers/helpers/execution_extra_content.py:78: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/helpers/execution_extra_content.py:82:16
+  --> tests/e2e_tests/containers/helpers/execution_extra_content.py:83:16
 ERROR Returned type `int | str` is not assignable to declared return type `str` [bad-return]
    --> tests/e2e_tests/containers/libs/broadcast_channel/redis/test_sharded_channel.py:367:16
 ERROR Object of class `TypeEngine` has no attribute `length` [missing-attribute]
@@ -335,59 +339,59 @@
 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:143: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
+  --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:97: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]
-   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:104:19
+  --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:98:19
 ERROR Argument `Literal['chat']` is not assignable to parameter `mode` with type `AppMode | SQLCoreOperations[AppMode]` in function `models.model.Conversation.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:125:14
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:119: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:124: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:342: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:344: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:345: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:346: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:347: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:348: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:349: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:380: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:381: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:468: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:469: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:470: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:511: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:513: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:515: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:516: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:517: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:518: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:519: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:520: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:521: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
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:522: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]
@@ -426,6 +430,10 @@
     --> tests/e2e_tests/containers/services/document_service_status.py:1265:16
 ERROR `None` is not subscriptable [unsupported-operation]
     --> tests/e2e_tests/containers/services/document_service_status.py:1266:16
+WARN No attribute `ToolManager` in module `services.agent_service` [missing-attribute-patch-target]
+  --> tests/e2e_tests/containers/services/test_agent_service.py:26:19
+WARN No attribute `AgentConfigManager` in module `services.agent_service` [missing-attribute-patch-target]
+  --> tests/e2e_tests/containers/services/test_agent_service.py:27:19
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/e2e_tests/containers/services/test_agent_service.py:135:38
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
@@ -436,6 +444,12 @@
    --> tests/e2e_tests/containers/services/test_agent_service.py:204:32
 ERROR Argument `float` is not assignable to parameter `answer_unit_price` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
    --> tests/e2e_tests/containers/services/test_agent_service.py:206:31
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:297:18
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:357:13
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:373:13
 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_agent_service.py:407:20
 ERROR Argument `Literal['chat']` is not assignable to parameter `mode` with type `AppMode | SQLCoreOperations[AppMode]` in function `models.model.Conversation.__init__` [bad-argument-type]
@@ -444,6 +458,8 @@
    --> tests/e2e_tests/containers/services/test_agent_service.py:443:32
 ERROR Argument `float` is not assignable to parameter `answer_unit_price` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
    --> tests/e2e_tests/containers/services/test_agent_service.py:445:31
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:454: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_agent_service.py:479:20
 ERROR Argument `Literal['chat']` is not assignable to parameter `mode` with type `AppMode | SQLCoreOperations[AppMode]` in function `models.model.Conversation.__init__` [bad-argument-type]
@@ -452,8 +468,14 @@
    --> tests/e2e_tests/containers/services/test_agent_service.py:515:32
 ERROR Argument `float` is not assignable to parameter `answer_unit_price` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
    --> tests/e2e_tests/containers/services/test_agent_service.py:517:31
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:526:18
 ERROR Argument `str | None` is not assignable to parameter `created_by` with type `SQLCoreOperations[str] | str` in function `models.model.MessageAgentThought.__init__` [bad-argument-type]
    --> tests/e2e_tests/containers/services/test_agent_service.py:564:24
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:570:18
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:593: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_agent_service.py:623:20
 ERROR Argument `Literal['chat']` is not assignable to parameter `mode` with type `AppMode | SQLCoreOperations[AppMode]` in function `models.model.Conversation.__init__` [bad-argument-type]
@@ -462,98 +484,112 @@
    --> tests/e2e_tests/containers/services/test_agent_service.py:643:32
 ERROR Argument `float` is not assignable to parameter `answer_unit_price` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
    --> tests/e2e_tests/containers/services/test_agent_service.py:645:31
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:655:13
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:673:13
 ERROR Argument `str | None` is not assignable to parameter `created_by` with type `SQLCoreOperations[str] | str` in function `models.model.MessageAgentThought.__init__` [bad-argument-type]
    --> tests/e2e_tests/containers/services/test_agent_service.py:793:24
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:799:18
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:892:18
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:919:18
 ERROR Argument `str | None` is not assignable to parameter `created_by` with type `SQLCoreOperations[str] | str` in function `models.model.MessageAgentThought.__init__` [bad-argument-type]
    --> tests/e2e_tests/containers/services/test_agent_service.py:953:24
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:959:18
 ERROR Argument `str | None` is not assignable to parameter `created_by` with type `SQLCoreOperations[str] | str` in function `models.model.MessageAgentThought.__init__` [bad-argument-type]
    --> tests/e2e_tests/containers/services/test_agent_service.py:993:24
+ERROR Class `AgentService` has no class attribute `get_agent_logs` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_agent_service.py:999:18
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `access_mode` with type `str | None` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `has_draft_trigger` with type `bool` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `is_starred` with type `bool` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `tenant_id` with type `SQLCoreOperations[str] | str` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `name` with type `SQLCoreOperations[str] | str` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` 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_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `enable_site` with type `SQLCoreOperations[bool] | bool` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `enable_api` with type `SQLCoreOperations[bool] | bool` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `id` with type `SQLCoreOperations[str] | str` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `description` with type `SQLCoreOperations[str] | str` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` 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_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `icon` with type `SQLCoreOperations[str | None] | str | None` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `icon_background` with type `SQLCoreOperations[str | None] | str | None` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `app_model_config_id` with type `SQLCoreOperations[str | None] | str | None` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `workflow_id` with type `SQLCoreOperations[str | None] | str | None` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `status` with type `AppStatus | SQLCoreOperations[AppStatus]` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `api_rpm` with type `SQLCoreOperations[int] | int` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `api_rph` with type `SQLCoreOperations[int] | int` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `is_demo` with type `SQLCoreOperations[bool] | bool` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `is_public` with type `SQLCoreOperations[bool] | bool` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `is_universal` with type `SQLCoreOperations[bool] | bool` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `tracing` with type `SQLCoreOperations[str | None] | str | None` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `max_active_requests` with type `SQLCoreOperations[int | None] | int | None` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `created_by` with type `SQLCoreOperations[str | None] | str | None` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `maintainer` with type `SQLCoreOperations[str | None] | str | None` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `updated_by` with type `SQLCoreOperations[str | None] | str | None` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
 ERROR Unpacked keyword argument `AppMode | IconType | bool | str | Any` is not assignable to parameter `use_icon_as_answer_icon` with type `SQLCoreOperations[bool] | bool` in function `models.model.App.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:109:15
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:112:15
+WARN No attribute `WorkflowService` in module `services.app_dsl_service` [missing-attribute-patch-target]
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:129:19
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:185:42
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:190:42
 ERROR Argument `Literal['simple']` is not assignable to parameter `prompt_type` with type `PromptType | SQLCoreOperations[PromptType]` in function `models.model.AppModelConfig.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:974:25
+   --> tests/e2e_tests/containers/services/test_app_dsl_service.py:972:25
+ERROR Argument `Workflow` is not assignable to parameter `workflow` with type `WorkflowBindingScope` in function `services.agent.dsl_service.AgentDslService.import_workflow_packages` [bad-argument-type]
+    --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1065:22
 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/e2e_tests/containers/services/test_app_dsl_service.py:1123:13
+    --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1121:13
 ERROR Argument `Literal['workflow']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1263:20
+    --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1261:20
 ERROR Argument `Literal['workflow']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1296:20
+    --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1294:20
 ERROR Argument `Literal['workflow']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1336:20
+    --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1334:20
+ERROR No attribute `WorkflowService` in module `services.app_dsl_service` [missing-attribute]
+    --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1397:29
 ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `dsl_dependencies` with type `list[PluginDependency]` in function `services.app_dsl_service.AppDslService.get_leaked_dependencies` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1618:73
+    --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1616:73
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_app_generate_service.py:196:38
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:219:38
 ERROR Argument `str | None` is not assignable to parameter `created_by` with type `SQLCoreOperations[str] | str` in function `models.workflow.Workflow.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_generate_service.py:223:24
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:246:24
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_app_generate_service.py:497:23
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:599:23
 ERROR Argument `Literal['invalid_mode']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_generate_service.py:576:20
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:692:20
 WARN Module `sqlalchemy.exc` exists, but was not imported explicitly. You are relying on other modules to load it. [implicit-import]
-   --> tests/e2e_tests/containers/services/test_app_generate_service.py:583:41
-ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `services.app_generate_service.AppGenerateService.generate_single_loop` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_generate_service.py:837:18
-ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `services.app_generate_service.AppGenerateService.generate_single_loop` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_generate_service.py:869:18
-ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `services.app_generate_service.AppGenerateService.generate_single_loop` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_app_generate_service.py:900:22
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:699:41
 ERROR Argument `Literal['agent-chat']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_app_generate_service.py:1017:20
+    --> tests/e2e_tests/containers/services/test_app_generate_service.py:1215:20
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
   --> tests/e2e_tests/containers/services/test_app_service.py:86:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -719,17 +755,17 @@
 ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
   --> tests/e2e_tests/containers/services/test_dataset_service_create_dataset.py:36:18
 ERROR Argument `str` is not assignable to parameter `data_source_type` with type `DataSourceType | SQLCoreOperations[DataSourceType]` in function `models.dataset.Document.__init__` [bad-argument-type]
-  --> tests/e2e_tests/containers/services/test_dataset_service_document.py:71:30
+  --> tests/e2e_tests/containers/services/test_dataset_service_document.py:73:30
 ERROR Argument `str` is not assignable to parameter `doc_form` with type `IndexStructureType | SQLCoreOperations[IndexStructureType]` in function `models.dataset.Document.__init__` [bad-argument-type]
-  --> tests/e2e_tests/containers/services/test_dataset_service_document.py:77:22
+  --> tests/e2e_tests/containers/services/test_dataset_service_document.py:79:22
 ERROR Argument `str` is not assignable to parameter `value` with type `IndexingStatus | SQLCoreOperations[IndexingStatus]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-  --> tests/e2e_tests/containers/services/test_dataset_service_document.py:79:36
+  --> tests/e2e_tests/containers/services/test_dataset_service_document.py:81:36
 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_service_permissions.py:40:20
+  --> tests/e2e_tests/containers/services/test_dataset_service_permissions.py:41: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]
-  --> tests/e2e_tests/containers/services/test_dataset_service_permissions.py:42:58
+  --> tests/e2e_tests/containers/services/test_dataset_service_permissions.py:43:58
 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_service_permissions.py:69:20
+  --> tests/e2e_tests/containers/services/test_dataset_service_permissions.py:70:20
 ERROR Argument `str` is not assignable to parameter `value` with type `IndexingStatus | SQLCoreOperations[IndexingStatus]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
   --> tests/e2e_tests/containers/services/test_document_service_display_status.py:50:32
 ERROR Argument `Literal['completed']` is not assignable to parameter `value` with type `IndexingStatus | SQLCoreOperations[IndexingStatus]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
@@ -801,9 +837,9 @@
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
   --> tests/e2e_tests/containers/services/test_file_service.py:76:20
 ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
-  --> tests/e2e_tests/containers/services/test_human_input_delivery_test.py:45:18
+  --> tests/e2e_tests/containers/services/test_human_input_delivery_test.py:41: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_human_input_delivery_test.py:54:19
+  --> tests/e2e_tests/containers/services/test_human_input_delivery_test.py:50:19
 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_message_export_service.py:53: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]
@@ -1039,15 +1075,9 @@
 ERROR Argument `str` is not assignable to parameter `model_type` with type `ModelType | SQLCoreOperations[ModelType]` in function `models.provider.ProviderModelSetting.__init__` [bad-argument-type]
    --> tests/e2e_tests/containers/services/test_model_provider_service.py:184:24
 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_schedule_service.py:30:20
+  --> tests/e2e_tests/containers/services/test_schedule_service.py:32: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]
-  --> tests/e2e_tests/containers/services/test_schedule_service.py:32:58
-ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `events.event_handlers.sync_workflow_schedule_when_app_published.sync_schedule_from_workflow` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_schedule_service.py:319:26
-ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `events.event_handlers.sync_workflow_schedule_when_app_published.sync_schedule_from_workflow` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_schedule_service.py:353:26
-ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `events.event_handlers.sync_workflow_schedule_when_app_published.sync_schedule_from_workflow` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_schedule_service.py:382:22
+  --> tests/e2e_tests/containers/services/test_schedule_service.py:34:58
 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_webapp_auth_service.py:45: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]
@@ -1055,13 +1085,11 @@
 ERROR Argument `Literal['workflow']` 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_webhook_service.py:62:14
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
-  --> tests/e2e_tests/containers/services/test_webhook_service_relationships.py:68:72
+  --> tests/e2e_tests/containers/services/test_webhook_service_relationships.py:69:72
 ERROR Argument `Literal['workflow']` 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_webhook_service_relationships.py:90:18
+  --> tests/e2e_tests/containers/services/test_webhook_service_relationships.py:91: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_webhook_service_relationships.py:91:23
-ERROR Class `WebhookServiceRelationshipFactory` has no class attribute `_read_cache` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_webhook_service_relationships.py:544:26
+  --> tests/e2e_tests/containers/services/test_webhook_service_relationships.py:92:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/e2e_tests/containers/services/test_workflow_app_service.py:126:38
 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]
@@ -1127,233 +1155,223 @@
 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_app_service.py:1493:28
 ERROR Argument `Literal['workflow']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-  --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:72:20
+  --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:73:20
 ERROR Argument `Literal['emoji']` is not assignable to parameter `value` with type `IconType | SQLCoreOperations[IconType | None] | None` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-  --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:73:25
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.get_draft_variables_by_selectors` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:269:99
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.list_variables_without_values` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:307:89
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.list_node_variables` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:358:71
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.list_conversation_variables` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:400:70
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.delete_user_workflow_variables` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:578:64
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.list_conversation_variables` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:633:75
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.delete_user_workflow_variables` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:638:64
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.delete_node_variables` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:709:64
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService._get_conversation_id_from_draft_variable` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:797:86
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService._get_conversation_id_from_draft_variable` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:813:86
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.list_system_variables` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:854:64
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.get_conversation_variable` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:901:97
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.get_system_variable` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:905:89
-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:909:102
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.get_conversation_variable` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:927:105
-ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.get_\n\n... (truncated) ...

@41tair
41tair added this pull request to stack #43700 October 8, 2026 10:47
@github-actions github-actions Bot added the web This relates to changes on the web. label Oct 8, 2026
@github-actions github-actions Bot removed the web This relates to changes on the web. label Oct 8, 2026
@41tair
41tair force-pushed the refactor/api-76-10-13 branch from e7bfbf6 to d2ca045 Compare October 9, 2026 06:22
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 39.62264% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.59%. Comparing base (1d749c8) to head (d272fdd).

Files with missing lines Patch % Lines
api/services/app/generation/adapters/completion.py 20.00% 12 Missing ⚠️
api/services/message_more_like_this_generator.py 33.33% 10 Missing ⚠️
...ervices/workflow/execution/adapters/persistence.py 18.18% 9 Missing ⚠️
api/core/tools/mcp_tool/tool.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           refactor/api-76-10-12   #43696      +/-   ##
=========================================================
+ Coverage                  64.60%   65.59%   +0.99%     
=========================================================
  Files                       6263     6203      -60     
  Lines                     382407   375068    -7339     
  Branches                   80134    79013    -1121     
=========================================================
- Hits                      247035   246025    -1010     
+ Misses                    132888   126563    -6325     
+ Partials                    2484     2480       -4     
Flag Coverage Δ
api 52.61% <39.62%> (+1.29%) ⬆️

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.

@41tair
41tair removed this pull request from stack #43700 October 9, 2026 09:41
@41tair
41tair added this pull request to stack #43755 October 9, 2026 09:42
@41tair
41tair marked this pull request as ready for review October 9, 2026 09:49
@dosubot

dosubot Bot commented Oct 9, 2026

Copy link
Copy Markdown

📄 Knowledge review

✏️ Suggested updates

1 page suggestion needs review.

Page Library Status
Dify Agent Server 模块分析 (Commit 55f95dbc) dify 🟡 Review
📝 Dify Agent Server 模块分析 (Commit 55f95db)
@@ -25,9 +25,9 @@
 
 ## 与 Dify 现有架构的关系
 
-### 旧版 Agent 系统
-
-在 `dify-agent` 包引入之前,Dify 的 Agent 执行依赖于主应用(`api/`)中的一套同步 runner 体系:
+### 旧版 Agent 系统(已在 PR #43696 中移除)
+
+在 `dify-agent` 包引入之前,Dify 的 Agent 执行依赖于主应用(`api/`)中的一套同步 runner 体系。**这套 runner 体系(`BaseAgentRunner`、`CotAgentRunner`、`CotChatAgentRunner`、`CotCompletionAgentRunner`、`FunctionCallAgentRunner`)以及 `AgentChatAppRunner` 已在 [PR #43696](https://github.com/langgenius/dify/pull/43696) `refactor(api): remove superseded App and Agent execution paths` 中被移除(superseded)**,以下仅作历史背景说明,不再是当前架构的组成部分:
 
 **`BaseAgentRunner`** [[2]](https://github.com/langgenius/dify/blob/7210f856c9c07ae03d7c2e5def96c949efee6397/api/core/agent/base_agent_runner.py) 是所有 Agent runner 的抽象基类,负责工具初始化与转换、Agent 思考链条(AgentThought)的数据库持久化、对话历史组织,以及与 `QueueManager` 的事件发布集成。
 
@@ -35,7 +35,7 @@
 
 **`FunctionCallAgentRunner`** [[4]](https://github.com/langgenius/dify/blob/7210f856c9c07ae03d7c2e5def96c949efee6397/api/core/agent/fc_agent_runner.py) 同样继承自 `BaseAgentRunner`,利用 LLM 的原生函数调用能力(`tool_calls`),支持流式和非流式两种工具调用提取路径,每次迭代动态更新工具参数。
 
-此外还有 `CotChatAgentRunner` [[5]](https://github.com/langgenius/dify/blob/7210f856c9c07ae03d7c2e5def96c949efee6397/api/core/agent/cot_chat_agent_runner.py) 和 `CotCompletionAgentRunner` [[6]](https://github.com/langgenius/dify/blob/7210f856c9c07ae03d7c2e5def96c949efee6397/api/core/agent/cot_completion_agent_runner.py) 两个针对不同对话模式的 CoT 变体。
+此外还有(同样已移除)`CotChatAgentRunner` [[5]](https://github.com/langgenius/dify/blob/7210f856c9c07ae03d7c2e5def96c949efee6397/api/core/agent/cot_chat_agent_runner.py) 和 `CotCompletionAgentRunner` [[6]](https://github.com/langgenius/dify/blob/7210f856c9c07ae03d7c2e5def96c949efee6397/api/core/agent/cot_completion_agent_runner.py) 两个针对不同对话模式的 CoT 变体。
 
 ### 工作流 Agent 节点
 
@@ -55,7 +55,7 @@
 
 ### 新模块的定位
 
-`dify-agent` 包并不替换上述现有组件,而是在其旁边建立了一个**独立的微服务边界**:
+`dify-agent` 包在 `api/` 旁边建立了一个**独立的微服务边界**。上述旧版同步 runner(CoT / Function-Calling runner、`BaseAgentRunner`、`AgentChatAppRunner`)已在 PR #43696 中移除,Agent 执行统一委托给 `dify-agent` 后端:
 
 - **集成方式**:PR #36284 将 `dify-agent` 从开发依赖提升至生产依赖 [[10]](https://github.com/langgenius/dify/blob/7210f856c9c07ae03d7c2e5def96c949efee6397/api/pyproject.toml),API 端通过 `DifyAgentBackendRunClient` 实现完整的 Agent 后端集成
 - **与 Plugin Daemon 的关系**:新模块直接与 Plugin Daemon(端口 5002)通信,复用了同一个 LLM 提供者运行时基础设施
@@ -64,21 +64,21 @@
 ```
 ┌─────────────────────────────────────────────────────┐
 │                  Dify API (api/)                    │
-│  ┌──────────────┐   ┌──────────────────────────┐   │
-│  │ 旧版 Runner  │   │  dify-agent Client       │   │
-│  │ (CoT / FC)  │   │  (HTTP → Agent Server)   │   │
-│  └──────┬───────┘   └──────────┬───────────────┘   │
-└─────────┼─────────────────────┼─────────────────────┘
-          │                     │
-          ▼                     ▼
-   ┌─────────────┐      ┌──────────────────┐
-   │Plugin Daemon│      │  dify-agent      │
-   │  :5002      │◄─────│  Server :8000    │
-   └─────────────┘      └────────┬─────────┘
-                                 │
-                            ┌────▼─────┐
-                            │  Redis   │
-                            └──────────┘
+│  ┌──────────────────────────┐                       │
+│  │  dify-agent Client       │                       │
+│  │  (HTTP → Agent Server)   │                       │
+│  └──────────┬───────────────┘                       │
+└─────────────┼───────────────────────────────────────┘
+              │
+              ▼
+   ┌──────────────────┐      ┌─────────────┐
+   │  dify-agent      │─────►│Plugin Daemon│
+   │  Server :8000    │      │  :5002      │
+   └────────┬─────────┘      └─────────────┘
+            │
+       ┌────▼─────┐
+       │  Redis   │
+       └──────────┘
 ```
 
 这一设计标志着 Dify 从**单体同步执行模型**向**异步微服务化 Agent 执行**的架构演进。
@@ -2011,11 +2011,11 @@
 
 ### 与现有系统的关系
 
-新模块与旧版 `BaseAgentRunner` / `CotAgentRunner` / `FunctionCallAgentRunner` 体系**并存而非替代**:
-
-- 旧版 runner 仍承担现有会话式 Agent 的同步执行
-- `dify-agent` 服务器提供了面向微服务架构的新执行路径,PR #36284 通过 `DifyAgentBackendRunClient` 完成了 API 端的生产集成,工作流节点现已能够创建 run、流式消费事件并管理 Agent 配置
-- 两者共用同一个 Plugin Daemon 基础设施(端口 5002),无需重复部署
+新模块最初与旧版 `BaseAgentRunner` / `CotAgentRunner` / `FunctionCallAgentRunner` 体系并存;该旧版 runner 体系已在 PR #43696 中移除(superseded),Agent 执行委托给 `dify-agent` 后端:
+
+- 旧版同步 runner(CoT / Function-Calling runner、`BaseAgentRunner`、`AgentChatAppRunner`)已在 PR #43696 中移除,不再承担 Agent 执行
+- `dify-agent` 服务器提供了面向微服务架构的执行路径,PR #36284 通过 `DifyAgentBackendRunClient` 完成了 API 端的生产集成,工作流节点现已能够创建 run、流式消费事件并管理 Agent 配置
+- 新模块与 Plugin Daemon(端口 5002)通信,复用同一个 Plugin Daemon 基础设施,无需重复部署
 
 ### 架构演进的意义
 

Accept · Edit · Decline


Leave Feedback Ask Dosu about dify

# Conflicts:
#	api/core/agent/base_agent_runner.py
#	api/core/agent/cot_agent_runner.py
#	api/core/agent/fc_agent_runner.py
#	api/core/app/apps/advanced_chat/app_generator.py
#	api/core/app/apps/advanced_chat/generate_response_converter.py
#	api/core/app/apps/advanced_chat/generate_task_pipeline.py
#	api/core/app/apps/agent_app/app_generator.py
#	api/core/app/apps/agent_app/app_runner.py
#	api/core/app/apps/agent_app/errors.py
#	api/core/app/apps/agent_app/runtime_request_builder.py
#	api/core/app/apps/agent_chat/app_generator.py
#	api/core/app/apps/base_app_generator.py
#	api/core/app/apps/base_app_runner.py
#	api/core/app/apps/chat/app_generator.py
#	api/core/app/apps/common/workflow_response_converter.py
#	api/core/app/apps/completion/app_generator.py
#	api/core/app/apps/message_based_app_generator.py
#	api/core/app/apps/message_generator.py
#	api/core/app/apps/pipeline/generate_response_converter.py
#	api/core/app/apps/pipeline/pipeline_generator.py
#	api/core/app/apps/workflow/app_generator.py
#	api/core/app/apps/workflow/generate_response_converter.py
#	api/core/app/apps/workflow/generate_task_pipeline.py
#	api/core/app/apps/workflow_app_runner.py
#	api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py
#	api/core/app/task_pipeline/message_cycle_manager.py
#	api/core/app/workflow/layers/persistence.py
#	api/core/plugin/backwards_invocation/app.py
#	api/core/plugin/backwards_invocation/tool.py
#	api/core/tools/tool_engine.py
#	api/core/tools/tool_manager.py
#	api/core/tools/workflow_as_tool/tool.py
#	api/services/tools/legacy_tools_transform_service.py
#	api/tests/unit_tests/core/app/task_pipeline/test_based_generate_task_pipeline.py
@41tair
41tair requested a review from crazywoola as a code owner October 27, 2026 05:26
# Conflicts:
#	api/.importlinter
#	api/core/app/apps/base_app_generator.py
#	api/core/app/apps/common/workflow_response_converter.py
#	api/core/tools/tool_manager.py
#	api/extensions/ext_application_services.py
#	api/services/agent/composer_service.py
#	api/services/agent_tool_inner_service.py
#	api/services/annotation_service.py
#	api/services/workflow_event_snapshot_service.py
# Conflicts:
#	api/services/tools/legacy_tools_transform_service.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: top ghfind author score; see https://ghfind.com size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant