Skip to content

fix(api): stop accumulating duplicate extracted PDF images on repeated previews - #44684

Merged
fatelei merged 6 commits into
langgenius:mainfrom
uhhgxg:fix-pdf-preview-duplicate-images
Oct 29, 2026
Merged

fatelei merged 6 commits into
langgenius:mainfrom
uhhgxg:fix-pdf-preview-duplicate-images

Conversation

@uhhgxg

@uhhgxg uhhgxg commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #44682.

PdfExtractor._extract_images persisted every embedded PDF image under a fresh random storage key with a new UploadFile row on each run, so repeated text previews of an unchanged source accumulated identical image rows and objects and returned a different markdown link every time.

This change mirrors the deterministic-key strategy ExcelExtractor already uses:

  • ExtractProcessor now passes upload_file.id to PdfExtractor as a new optional source_file_id argument (both the Unstructured and default ETL branches).
  • With a source_file_id present, extracted images are stored under deterministic keys derived from tenant, source upload id, page number, object index, and SHA-256 content hash (image_files/{tenant}/{source}/p{page}_{index}_{hash}.{ext}). Existing UploadFile rows are looked up by key and reused, so storage objects and rows are written exactly once and preview links stay stable.
  • Without a source_file_id (e.g. extraction without an upload context), the previous unique-key behavior is kept, so there is no behavior change for URL-loaded sources (which already skip image persistence).
  • Storage failures remain isolated per image: a failed save skips that image and does not abort the page.

The optional file_cache_key parameter remains untouched; this PR does not change text-cache behavior.

Verification

Latest follow-up (2a6d24d): removed the redundant i prefix while retaining the object index; updated the existing key assertions. Targeted PDF extractor suite: 17 passed on Python 3.13.16. ruff check and ruff format --check passed for both changed files. The new upstream workflow run is awaiting maintainer approval (action_required).

Local, against main at 2b35144b2098f8f6ad6af31bf72356a42f813d58 (no HTTP server, no mocks for parser/storage/ORM):

  • End-to-end with the real service call chain: generated a real PDF with an embedded image, drove PdfExtractor.extract() twice with real pypdfium2 parsing, real SQLAlchemy rows (SQLite), and a filesystem-like storage shim. Row count after the first extraction = 1, after the second extraction = 1 (previously 1 -> 2), both markdown links identical, storage written once.
  • Behavior harness over the patched extractor (13 checks, all pass): deterministic reuse across runs, page-scoped distinct assets, legacy random-key path unchanged, injected-session semantics preserved (no commit when a session is provided), per-image extraction/storage failure isolation.
  • New unit tests: test_extract_images_with_source_file_id_reuses_existing_assets, test_extract_images_with_source_file_id_keeps_unique_keys_per_page; existing PDF extractor tests keep passing with the legacy path.
  • ruff check and ruff format --check clean on all touched files. Full make lint && make type-check and the complete test suite were not run in this environment; CI is the gate.

Screenshots

Before After
Repeated previews add one duplicate image row and a new URL each time Repeated previews reuse the existing asset; row count and link stay stable

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 WorkBuddy Agent

@uhhgxg
uhhgxg requested a review from JohnJyong as a code owner October 24, 2026 01:36
@github-actions github-actions Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 79.89% 79.89% +0.00%
Strict coverage 79.58% 79.58% +0.00%
Typed symbols 76,592 76,606 +14
Untyped symbols 19,357 19,358 +1
Modules 3978 3978 0

@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.53%. Comparing base (1f500e5) to head (22297c2).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #44684   +/-   ##
=======================================
  Coverage   89.52%   89.53%           
=======================================
  Files        6009     6009           
  Lines      376843   376871   +28     
  Branches    76238    76243    +5     
=======================================
+ Hits       337380   337418   +38     
+ Misses      33465    33455   -10     
  Partials     5998     5998           
Flag Coverage Δ
api 89.41% <100.00%> (+0.02%) ⬆️

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.

@fatelei

fatelei commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

python style check failed

@uhhgxg

uhhgxg commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @fatelei for the pointer. The failure came from the check_no_new_test_doubles guard: two net-new MagicMock usages in test_pdf_extractor.py (old lines 217-218) pushed the file's mock-constructor count above baseline (11 -> 13).

Commit 88aaa4c rewrites the added tests to use real PDF images and the real storage harness, bringing the file back to the baseline count (11, all MagicMock, same as base 2b35144b); pdf_extractor.py and extract_processor.py add none. The new head's CI runs are currently action_required awaiting maintainer approval for fork workflows - once approved, the style check should pass.

Comment thread api/core/rag/extractor/pdf_extractor.py Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-10-27 02:05:41.910413775 +0000
+++ /tmp/pyrefly_pr.txt	2026-10-27 02:05:31.754334767 +0000
@@ -167,19 +167,17 @@
 ERROR Object of class `NoneType` has no attribute `loader` [missing-attribute]
   --> tests/unit_tests/migrations/versions/test_2025_07_02_2332-1c9ba48be8e4_add_uuidv7_function_in_sql.py:32:5
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
-  --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:75:16
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-  --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:91:24
+  --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:74:16
 ERROR Argument `float` is not assignable to parameter `message_unit_price` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:120:28
+   --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:119:28
 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/controllers/console/app/test_chat_conversation_status_count_api.py:121:27
+   --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:120:27
 ERROR Argument `float` is not assignable to parameter `message_price_unit` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:122:28
+   --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:121:28
 ERROR Argument `float` is not assignable to parameter `answer_price_unit` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:123:27
+   --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:122:27
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `MessageStatus | SQLCoreOperations[MessageStatus]` in function `models.model.Message.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:125:16
+   --> tests/e2e_tests/containers/controllers/console/app/test_chat_conversation_status_count_api.py:124:16
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
   --> tests/e2e_tests/containers/controllers/console/app/test_conversation_read_timestamp.py:28:16
 ERROR Returned type `set[str | None]` is not assignable to declared return type `set[str]` [bad-return]
@@ -293,7 +291,7 @@
 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
 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:186:23
+   --> tests/e2e_tests/containers/core/workflow/test_human_input_resume_node_execution.py:185: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
 ERROR Argument `Literal['chat']` is not assignable to parameter `mode` with type `AppMode | SQLCoreOperations[AppMode]` in function `models.model.App.__init__` [bad-argument-type]
@@ -316,10 +314,8 @@
    --> tests/e2e_tests/containers/models/test_types_enum_text.py:147:20
 ERROR Object of class `NoneType` has no attribute `user_type_nullable` [missing-attribute]
    --> tests/e2e_tests/containers/models/test_types_enum_text.py:148:20
-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:151:56
+   --> tests/e2e_tests/containers/repositories/test_sqlalchemy_api_workflow_run_repository.py:150:56
 ERROR Argument `Literal['chat']` is not assignable to parameter `mode` with type `AppMode | SQLCoreOperations[AppMode]` in function `models.model.App.__init__` [bad-argument-type]
    --> tests/e2e_tests/containers/repositories/test_sqlalchemy_execution_extra_content_repository.py:103:14
 ERROR Argument `Literal['emoji']` is not assignable to parameter `icon_type` with type `IconType | SQLCoreOperations[IconType | None] | None` in function `models.model.App.__init__` [bad-argument-type]
@@ -510,22 +506,22 @@
     --> tests/e2e_tests/containers/services/test_app_dsl_service.py:1611:73
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/e2e_tests/containers/services/test_app_generate_service.py:199: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:226:24
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_app_generate_service.py:500:23
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:496: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:579:20
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:575: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:586:41
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:582: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:840:18
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:836: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:872:18
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:868: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:903:22
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:899:22
+ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
+   --> tests/e2e_tests/containers/services/test_app_generate_service.py:951:23
 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:1020:20
+    --> tests/e2e_tests/containers/services/test_app_generate_service.py:1087: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]
@@ -801,21 +797,21 @@
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
   --> tests/e2e_tests/containers/services/test_message_export_service.py:96:20
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-  --> tests/e2e_tests/containers/services/test_message_service.py:70:38
+   --> tests/e2e_tests/containers/services/test_message_service.py:117:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-  --> tests/e2e_tests/containers/services/test_message_service.py:73:81
+   --> tests/e2e_tests/containers/services/test_message_service.py:120:81
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_message_service.py:102:20
+   --> tests/e2e_tests/containers/services/test_message_service.py:149:20
 ERROR Argument `Literal[0]` is not assignable to parameter `message_unit_price` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_message_service.py:131:32
+   --> tests/e2e_tests/containers/services/test_message_service.py:178:32
 ERROR Argument `float` is not assignable to parameter `message_price_unit` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_message_service.py:132:32
+   --> tests/e2e_tests/containers/services/test_message_service.py:179:32
 ERROR Argument `Literal[0]` 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_message_service.py:135:31
+   --> tests/e2e_tests/containers/services/test_message_service.py:182:31
 ERROR Argument `float` is not assignable to parameter `answer_price_unit` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_message_service.py:136:31
+   --> tests/e2e_tests/containers/services/test_message_service.py:183:31
 ERROR Argument `Literal[0]` is not assignable to parameter `total_price` with type `Decimal | SQLCoreOperations[Decimal | None] | None` in function `models.model.Message.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_message_service.py:139:25
+   --> tests/e2e_tests/containers/services/test_message_service.py:186:25
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `MessageStatus | SQLCoreOperations[MessageStatus]` in function `models.model.Message.__init__` [bad-argument-type]
   --> tests/e2e_tests/containers/services/test_message_service_extra_contents.py:40:16
 ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
@@ -901,79 +897,23 @@
 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_webapp_auth_service.py:46:19
 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
+  --> tests/e2e_tests/containers/services/test_webhook_service.py:61: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:67: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:89: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
+  --> tests/e2e_tests/containers/services/test_webhook_service_relationships.py:90: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:543:26
 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]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:228:28
-ERROR Argument `Literal['succeeded']` is not assignable to parameter `status` with type `SQLCoreOperations[WorkflowExecutionStatus] | WorkflowExecutionStatus` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:233:20
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:367:28
-ERROR Argument `Literal['succeeded']` is not assignable to parameter `status` with type `SQLCoreOperations[WorkflowExecutionStatus] | WorkflowExecutionStatus` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:370:20
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:409:28
-ERROR Argument `Literal['succeeded']` is not assignable to parameter `status` with type `SQLCoreOperations[WorkflowExecutionStatus] | WorkflowExecutionStatus` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:412:20
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:451:28
-ERROR Argument `Literal['succeeded']` is not assignable to parameter `status` with type `SQLCoreOperations[WorkflowExecutionStatus] | WorkflowExecutionStatus` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:454:20
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:527:32
-ERROR Argument `str` 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:532:24
+   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:125:38
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:573:16
+   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:572:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:580:16
+   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:579:16
 ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:587:16
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:633:32
-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:638:24
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:738:32
-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:743:24
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:866:32
-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:871:24
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:908:32
-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:913:24
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_workflow_app_service.py:1042:28
-ERROR Argument `Literal['succeeded']` is not assignable to parameter `status` with type `SQLCoreOperations[WorkflowExecutionStatus] | WorkflowExecutionStatus` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_workflow_app_service.py:1047:20
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_workflow_app_service.py:1130:28
-ERROR Argument `Literal['succeeded']` is not assignable to parameter `status` with type `SQLCoreOperations[WorkflowExecutionStatus] | WorkflowExecutionStatus` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_workflow_app_service.py:1135:20
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_workflow_app_service.py:1284:32
-ERROR Argument `Literal['failed', '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:1287:24
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_workflow_app_service.py:1384:32
-ERROR Argument `Literal['failed', 'running', '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:1387:24
-ERROR Argument `Literal['app-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-    --> tests/e2e_tests/containers/services/test_workflow_app_service.py:1490:36
-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
+   --> tests/e2e_tests/containers/services/test_workflow_app_service.py:586:16
 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
 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]
@@ -1013,37 +953,29 @@
 ERROR Argument `str | None` is not assignable to parameter `user_id` with type `str` in function `services.workflow_draft_variable_service.WorkflowDraftVariableService.get_node_variable` [bad-argument-type]
    --> tests/e2e_tests/containers/services/test_workflow_draft_variable_service.py:935:21
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:123:38
-ERROR Argument `str | Unknown` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:152:28
-ERROR Argument `Literal['succeeded']` is not assignable to parameter `status` with type `SQLCoreOperations[WorkflowExecutionStatus] | WorkflowExecutionStatus` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:156:20
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:121:38
 ERROR Argument `float` is not assignable to parameter `value` with type `Decimal | SQLCoreOperations[Decimal]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:209:38
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:207:38
 ERROR Argument `float` is not assignable to parameter `value` with type `Decimal | SQLCoreOperations[Decimal]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:210:37
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:208:37
 ERROR Argument `float` is not assignable to parameter `value` with type `Decimal | SQLCoreOperations[Decimal]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:211:38
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:209:38
 ERROR Argument `float` is not assignable to parameter `value` with type `Decimal | SQLCoreOperations[Decimal]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:212:37
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:210:37
 ERROR Argument `Literal['normal']` is not assignable to parameter `value` with type `MessageStatus | SQLCoreOperations[MessageStatus]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:214:26
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:212:26
 ERROR Argument `dict[str, int | None]` is not assignable to parameter `args` with type `WorkflowRunListArgs` in function `services.workflow_run_service.WorkflowRunService.get_paginate_workflow_runs` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:255:18
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:253:18
 ERROR Argument `dict[Unknown, Unknown]` is not assignable to parameter `args` with type `WorkflowRunListArgs` in function `services.workflow_run_service.WorkflowRunService.get_paginate_workflow_runs` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:348:18
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:346:18
 ERROR Argument `dict[str, int | None]` is not assignable to parameter `args` with type `WorkflowRunListArgs` in function `services.workflow_run_service.WorkflowRunService.get_paginate_advanced_chat_workflow_runs` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:399:18
-ERROR Argument `Literal['workflow-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowNodeExecutionTriggeredFrom] | WorkflowNodeExecutionTriggeredFrom` in function `models.workflow.WorkflowNodeExecutionModel.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:518:32
-ERROR Argument `Literal['workflow-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowNodeExecutionTriggeredFrom] | WorkflowNodeExecutionTriggeredFrom` in function `models.workflow.WorkflowNodeExecutionModel.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:540:28
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:397:18
 ERROR Object of class `NoneType` has no attribute `startswith` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:580:20
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:578:20
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:618:38
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:616:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:670:38
+   --> tests/e2e_tests/containers/services/test_workflow_run_service.py:668:38
 ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
   --> tests/e2e_tests/containers/services/test_workflow_service.py:81:21
 ERROR Argument `Literal['emoji']` is not assignable to parameter `icon_type` with type `IconType | SQLCoreOperations[IconType | None] | None` in function `models.model.App.__init__` [bad-argument-type]
@@ -1091,101 +1023,101 @@
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/e2e_tests/containers/services/tools/test_tools_transform_service.py:805:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:109:38
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:108:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:113:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:112:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:188:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:187:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:208:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:207:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:223:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:222:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:257:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:256:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:273:27
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:272:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:290:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:289:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:323:27
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:322:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:340:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:339:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:369:27
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:368:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:395:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:394:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:425:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:424:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:442:27
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:441:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:459:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:458:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:494:27
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:493:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:510:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:509:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:546:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:545:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:559:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:558:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:592:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:591:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:606:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:605:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:624:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:623:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:625:30
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:624:30
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:671:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:670:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:683:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:682:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:704:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:703:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:705:30
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:704:30
 ERROR Object of class `NoneType` has no attribute `name` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:715:16
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:714:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:743:27
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:742:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:760:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:759:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:790:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:789:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:804:51
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:803:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:813:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:812:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:814:30
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:813:30
 ERROR Object of class `NoneType` has no attribute `name` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:827:16
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:826:16
 ERROR Object of class `NoneType` has no attribute `updated_at` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:828:16
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:827:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:892:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:891:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:970:23
+   --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:969:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1014:27
+    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1013:27
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1031:51
+    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1030:51
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1055:23
+    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1054:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1066:54
+    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1065:54
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1071:77
+    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1070:77
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1088:83
+    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1087:83
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1102:80
+    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1101:80
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1114:79
+    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1113:79
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1126:78
+    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1125:78
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1139:23
+    --> tests/e2e_tests/containers/services/tools/test_workflow_tools_manage_service.py:1138:23
 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/workflow/test_workflow_converter.py:107: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]
@@ -1203,13 +1135,11 @@
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/e2e_tests/containers/services/workflow/test_workflow_converter.py:659:16
 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/workflow/test_workflow_deletion.py:39:18
+  --> tests/e2e_tests/containers/services/workflow/test_workflow_deletion.py:38:18
 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/workflow/test_workflow_deletion.py:51:18
+  --> tests/e2e_tests/containers/services/workflow/test_workflow_deletion.py:50: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/workflow/test_workflow_deletion.py:52:23
-ERROR Argument `Literal['workflow-run']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowNodeExecutionTriggeredFrom] | WorkflowNodeExecutionTriggeredFrom` in function `models.workflow.WorkflowNodeExecutionModel.__init__` [bad-argument-type]
-  --> tests/e2e_tests/containers/services/workflow/test_workflow_node_execution_service_repository.py:43:28
+  --> tests/e2e_tests/containers/services/workflow/test_workflow_deletion.py:51:23
 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/tasks/test_add_document_to_index_task.py:56: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]
@@ -1452,44 +1382,36 @@
   --> tests/e2e_tests/containers/tasks/test_mail_owner_transfer_task.py:82:18
 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/tasks/test_remove_app_and_related_data_task.py:41:14
-ERROR Argument `Literal['debugging']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:276:28
-ERROR Argument `Literal['account']` is not assignable to parameter `created_by_role` with type `CreatorUserRole | SQLCoreOperations[CreatorUserRole]` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:280:29
 ERROR Object of class `NoneType` has no attribute `resumed_at` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:512:9
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:511:9
 ERROR Object of class `NoneType` has no attribute `created_at` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:584:9
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:583:9
 ERROR Object of class `NoneType` has no attribute `resumed_at` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:595:13
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:594:13
 ERROR Object of class `NoneType` has no attribute `created_at` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:610:36
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:609:36
 ERROR Object of class `NoneType` has no attribute `resumed_at` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:611:36
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:610:36
 ERROR Object of class `NoneType` has no attribute `resumed_at` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:622:32
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:621:32
 ERROR Object of class `NoneType` has no attribute `created_at` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:625:32
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:624:32
 ERROR Object of class `NoneType` has no attribute `created_at` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:664:13
-ERROR Argument `Literal['debugging']` is not assignable to parameter `triggered_from` with type `SQLCoreOperations[WorkflowRunTriggeredFrom] | WorkflowRunTriggeredFrom` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:746:28
-ERROR Argument `Literal['account']` is not assignable to parameter `created_by_role` with type `CreatorUserRole | SQLCoreOperations[CreatorUserRole]` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:750:29
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:663:13
 ERROR Object of class `NoneType` has no attribute `workflow_id` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:803:16
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:802:16
 ERROR Object of class `NoneType` has no attribute `state_object_key` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:824:16
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:823:16
 ERROR No matching overload found for function `extensions.ext_storage.Storage.load` called with arguments: (object | str) [no-matching-overload]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:829:39
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:828:39
 ERROR Object of class `NoneType` has no attribute `state_object_key` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:851:20
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:850:20
 ERROR Object of class `NoneType` has no attribute `state_object_key` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:896:16
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:895:16
 ERROR No matching overload found for function `extensions.ext_storage.Storage.load` called with arguments: (object | str) [no-matching-overload]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:897:36
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:896:36
 ERROR Object of class `NoneType` has no attribute `pause` [missing-attribute]
-   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:930:27
+   --> tests/e2e_tests/containers/test_workflow_pause_integration.py:929:27
 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/trigger/conftest.py:36:79
 ERROR Argument `Literal['workflow']` is not assignable to parameter `mode` with type `AppMode | SQLCoreOperations[AppMode]` in function `models.model.App.__init__` [bad-argument-type]
@@ -1577,43 +1499,43 @@
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.fetch_model_schema` [bad-argument-type]
    --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:354:53
 ERROR Argument `list[TextPromptMessageContent]` is not assignable to parameter `contents` with type `list[PromptMessageContentUnionTypes] | str | None` in function `graphon.nodes.llm.llm_utils.combine_message_content_with_role` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:649:65
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:610:65
 ERROR Argument `list[TextPromptMessageContent]` is not assignable to parameter `contents` with type `list[PromptMessageContentUnionTypes] | str | None` in function `graphon.nodes.llm.llm_utils.combine_message_content_with_role` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:652:65
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:613:65
 ERROR Argument `list[TextPromptMessageContent]` is not assignable to parameter `contents` with type `list[PromptMessageContentUnionTypes] | str | None` in function `graphon.nodes.llm.llm_utils.combine_message_content_with_role` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:655:65
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:616:65
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.calculate_rest_token` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:684:28
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:645:28
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.handle_memory_chat_mode` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:699:28
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:660:28
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.handle_memory_chat_mode` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:708:28
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:669:28
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.handle_memory_completion_mode` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:728:28
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:689:28
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.handle_memory_completion_mode` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:740:28
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:701:28
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.handle_memory_completion_mode` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:750:28
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:711:28
 ERROR Argument `list[UserPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:772:29
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:733:29
 ERROR Argument `list[SystemPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `graphon.nodes.llm.llm_utils._append_file_prompts` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:788:29
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:749:29
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.fetch_prompt_messages` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:831:28
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:792:28
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.fetch_prompt_messages` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:873:24
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:834:24
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.fetch_prompt_messages` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:906:24
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:867:24
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.fetch_prompt_messages` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:960:28
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:921:28
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.fetch_prompt_messages` [bad-argument-type]
-   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:992:28
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:953:28
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.fetch_prompt_messages` [bad-argument-type]
-    --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:1014:28
+   --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:975:28
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.fetch_prompt_messages` [bad-argument-type]
-    --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:1042:28
+    --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:1003:28
 ERROR Argument `ModelInstance` is not assignable to parameter `model_instance` with type `LLMProtocol` in function `graphon.nodes.llm.llm_utils.fetch_prompt_messages` [bad-argument-type]
-    --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:1070:28
+    --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_llm_utils.py:1031:28
 ERROR Argument `Iterator[LLMResultChunk | LLMResultChunkWithStructuredOutput]` is not assignable to parameter `invoke_result` with type `Generator[LLMResultChunk | LLMStructuredOutput] | LLMResult` in function `graphon.nodes.llm.node.LLMNode.handle_invoke_result` [bad-argument-type]
     --> tests/e2e_tests/contracts/core/workflow/nodes/llm/test_node.py:1630:31
 ERROR Argument `Generator[None, Unknown]` is not assignable to parameter `invoke_result` with type `Generator[LLMResultChunk | LLMStructuredOutput] | LLMResult` in function `graphon.nodes.llm.node.LLMNode.handle_invoke_result` [bad-argument-type]
@@ -1969,9 +1891,9 @@
 ERROR Object of class `object` has no attribute `options_override` [missing-attribute]
    --> tests/unit_tests/commands/test_data_migration.py:219:16
 ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
-   --> tests/unit_tests/commands/test_retention.py:188:20
+   --> tests/unit_tests/commands/test_retention.py:189:20
 ERROR Expected a callable, got `None` [not-callable]
-   --> tests/unit_tests/commands/test_retention.py:353:13
+   --> tests/unit_tests/commands/test_retention.py:354:13
 ERROR Object of class `ModuleType` has no attribute `upgrade` [missing-attribute]
    --> tests/unit_tests/commands/test_system.py:323:5
 ERROR Expected a callable, got `None` [not-callable]
@@ -2025,19 +1947,19 @@
 ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `page` [bad-argument-type]
    --> tests/unit_tests/controllers/console/app/test_app.py:843:55
 ERROR Object of class `App` has no attribute `create_user_name` [missing-attribute]
-   --> tests/unit_tests/controllers/console/app/test_app.py:937:5
+   --> tests/unit_tests/controllers/console/app/test_app.py:936:5
 ERROR Object of class `App` has no attribute `permission_keys` [missing-attribute]
-   --> tests/unit_tests/controllers/console/app/test_app.py:939:5
+   --> tests/unit_tests/controllers/console/app/test_app.py:938:5
 ERROR Object of class `App` has no attribute `permission_keys` [missing-attribute]
-    --> tests/unit_tests/controllers/console/app/test_app.py:1137:82
+    --> tests/unit_tests/controllers/console/app/test_app.py:1136:82
 ERROR Object of class `App` has no attribute `permission_keys` [missing-attribute]
-    --> tests/unit_tests/controllers/console/app/test_app.py:1168:9
+    --> tests/unit_tests/controllers/console/app/test_app.py:1167:9
 ERROR Object of class `App` has no attribute `permission_keys` [missing-attribute]
-    --> tests/unit_tests/controllers/console/app/test_app.py:1181:37
+    --> tests/unit_tests/controllers/console/app/test_app.py:1180:37
 ERROR Object of class `App` has no attribute `permission_keys` [missing-attribute]
-    --> tests/unit_tests/controllers/console/app/test_app.py:1253:9
+    --> tests/unit_tests/controllers/console/app/test_app.py:1252:9
 ERROR `str` is not assignable to dict key `strategy` with type `bool | list[Unknown]` [bad-assignment]
-    --> tests/unit_tests/controllers/console/app/test_app.py:1291:38
+    --> tests/unit_tests/controllers/console/app/test_app.py:1290:38
 ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `SQLCoreOperations[str] | str` in function `models.model.App.__init__` [bad-argument-type]
    --> tests/unit_tests/controllers/console/app/test_app_import.py:135:31
 ERROR Cannot index into `object` [bad-index]
@@ -2059,29 +1981,29 @@
 WARN Module `sqlalchemy.sql.selectable` exists, but was not imported explicitly. You are relying on other modules to load it. [implicit-import]
    --> tests/unit_tests/controllers/console/app/test_conversation.py:325:27
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `ConversationStatus | SQLCoreOperations[ConversationStatus]` in function `models.model.Conversation.__init__` [bad-argument-type]
-  --> tests/unit_tests/controllers/console/app/test_message.py:59:16
+   --> tests/unit_tests/controllers/console/app/test_message.py:113:16
 ERROR Argument `Literal[core.app.entities.app_invoke_entities.InvokeFrom.DEBUGGER]` is not assignable to parameter `invoke_from` with type `models.enums.InvokeFrom | SQLCoreOperations[models.enums.InvokeFrom | None] | None` in function `models.model.Conversation.__init__` [bad-argument-type]
-  --> tests/unit_tests/controllers/console/app/test_message.py:60:21
+   --> tests/unit_tests/controllers/console/app/test_message.py:114:21
 ERROR Argument `Literal[0]` is not assignable to parameter `message_unit_price` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
-  --> tests/unit_tests/controllers/console/app/test_message.py:73:28
+   --> tests/unit_tests/controllers/console/app/test_message.py:127:28
 ERROR Argument `Literal[0]` is not assignable to parameter `message_price_unit` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
-  --> tests/unit_tests/controllers/console/app/test_message.py:74:28
+   --> tests/unit_tests/controllers/console/app/test_message.py:128:28
 ERROR Argument `Literal[0]` is not assignable to parameter `answer_unit_price` with type `Decimal | SQLCoreOperations[Dec\n\n... (truncated) ...

@fatelei

fatelei commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

python style check failed

uhhgxg commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @fatelei. I checked the latest Python Style failure on 2a6d24d: Run No New Getattr Guard reports dify-agent/src/dify_agent/runtime/observability.py:108: no-new-getattr net-new getattr() in added code.

Failing job

That file is outside this PR's three changed files. The job checks synthetic merge commit b74138c8 against 2b35144b using base..HEAD, so this appears to include an upstream change. API tests, E2E tests, and Codecov checks passed.

Could you confirm whether the comparison baseline needs updating or the upstream getattr() needs addressing, then rerun Python Style once resolved? I'm happy to update this branch if needed.

@fatelei

fatelei commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

you can rebase upstream/main

@uhhgxg

uhhgxg commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Updated the branch with upstream/main (1f500e52, merge commit 22297c23), so the net-new getattr() in dify-agent/src/dify_agent/runtime/observability.py is now part of the PR's history and no longer reported as introduced by this PR — that file is untouched by this change (the PR still only modifies extract_processor.py, pdf_extractor.py and test_pdf_extractor.py).

CI is re-running on the new head; I'll follow up if anything fails there.

@uhhgxg

uhhgxg commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

One more thing: all workflows on the new head (22297c23) are action_required — fork PR runs need a maintainer to approve them. Could you hit "Approve and run" when convenient? Thanks!

@fatelei
fatelei added this pull request to the merge queue Oct 29, 2026
Merged via the queue into langgenius:main with commit e08b084 Oct 29, 2026
192 of 212 checks passed
@laipz8200 laipz8200 mentioned this pull request Nov 3, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeated PDF text previews create duplicate persisted images and change image URLs

2 participants