Skip to content

fix: honor file input defaults across app execution - #44780

Merged
hjlarry merged 8 commits into
langgenius:mainfrom
hjlarry:codex/fix-file-input-defaults
Oct 28, 2026
Merged

hjlarry merged 8 commits into
langgenius:mainfrom
hjlarry:codex/fix-file-input-defaults

Conversation

@hjlarry

@hjlarry hjlarry commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #41727
also fix #44797

fix https://linear.app/dify/issue/CUS-1740/workflowchatflow%E6%96%87%E4%BB%B6%E5%8F%98%E9%87%8F%E9%85%8D%E7%BD%AE%E9%BB%98%E8%AE%A4%E5%80%BC%E5%9C%A8-web-%E7%AB%AF%E5%92%8C-api-%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BD%BB%E5%BA%95%E5%A4%B1%E6%95%88%E6%8A%A5%E9%94%99-transfer-method-is

Configured file and file-list defaults can work in Studio but be missing or rejected in published apps and API execution. Clearing an optional file can omit the input and unintentionally restore the default; resetting a conversation can also leave the displayed file out of sync with the submitted value.

  • Preserve file-default metadata through parameter types and conversions, including Try App.
  • Convert editor file objects to execution mappings. Grant access to configured default uploads within the current execution while retaining tenant checks and persistent ownership.
  • Display and submit defaults in Workflow debug, text generation Run Once, and published Chat/Chatflow.
  • Distinguish omitted inputs from explicit clears: optional single files submit '', and cleared lists submit []. Treat empty required lists as missing for Start Chat and the main composer.
  • Restore defaults on new/reset conversations while retaining Try App's selected files.
  • Ignore stale local/remote upload callbacks and stop progress timers after the uploader unmounts, preventing stale state writes and error notifications. Closing only the upload popover still allows current-session uploads to finish.

Screenshots

Follow-up

Unify required-input and upload-state validation across suggested questions, regeneration, edited resends, and Markdown actions. These alternative send paths remain outside this PR's scope; the required-input checks described above apply to Start Chat and the main composer.

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

@github-actions github-actions Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. web This relates to changes on the web. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-10-28 13:33:08.911705580 +0000
+++ /tmp/pyrefly_pr.txt	2026-10-28 13:32:56.995497463 +0000
@@ -2997,113 +2997,115 @@
 ERROR Expected a mapping, got object | None [invalid-argument]
   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_config_manager.py:41:29
 ERROR Argument `SimpleNamespace` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator.single_loop_generate` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:221:22
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:225:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator.single_loop_generate` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:232:22
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:236:22
 ERROR Object of class `object` has no attribute `files` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:333:16
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:337:16
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `RuntimeState` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator.resume` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:376:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:380:33
 ERROR Object of type `Generator[Mapping[str, Any] | str] | Mapping[str, Any]` has no attribute `resumed` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:380:16
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:384:16
 ERROR Object of class `object` has no attribute `single_iteration_run` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:445:16
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:449:16
 ERROR Object of class `object` has no attribute `extras` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:446:16
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:450:16
 ERROR Argument `SimpleNamespace` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator.single_loop_generate` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:498:18
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:502:18
 ERROR Object of class `object` has no attribute `single_loop_run` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:508:16
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:512:16
 ERROR Object of class `object` has no attribute `extras` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:509:16
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:513:16
 ERROR Argument `SimpleNamespace` is not assignable to parameter `pause_state_config` with type `PauseStateLayerConfig | None` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:608:32
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:612:32
 ERROR Cannot index into `Generator[Mapping[str, Any] | str]` [bad-index]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:611:16
-ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:615:16
+ERROR Cannot index into `object` [bad-index]
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:619:16
 ERROR Argument `str | None` is not assignable to parameter `s` with type `bytearray | bytes | str` in function `json.loads` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:620:27
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:624:27
+ERROR Cannot index into `object` [bad-index]
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:749:13
 ERROR Argument `SimpleNamespace` is not assignable to parameter `flask_app` with type `Flask` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:767:27
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:791:27
 ERROR Argument `SimpleNamespace` is not assignable to parameter `context` with type `Context` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:772:25
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:796:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `flask_app` with type `Flask` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:818:27
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:842:27
 ERROR Argument `SimpleNamespace` is not assignable to parameter `context` with type `Context` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:823:25
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:847:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `flask_app` with type `Flask` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:880:23
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:904:23
 ERROR Argument `SimpleNamespace` is not assignable to parameter `context` with type `Context` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:885:21
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:909:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `RuntimeState | None` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:889:33
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:913:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `flask_app` with type `Flask` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:953:23
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:977:23
 ERROR Argument `SimpleNamespace` is not assignable to parameter `context` with type `Context` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:958:21
+   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:982:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `flask_app` with type `Flask` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1021:27
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1045:27
 ERROR Argument `SimpleNamespace` is not assignable to parameter `context` with type `Context` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1026:25
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1050:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._handle_advanced_chat_response` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1077:31
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1101:31
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._handle_advanced_chat_response` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1087:41
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1111:41
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._handle_advanced_chat_response` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1125:35
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1149:35
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._handle_advanced_chat_response` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1135:45
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1159:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `flask_app` with type `Flask` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1199:23
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1223:23
 ERROR Argument `SimpleNamespace` is not assignable to parameter `context` with type `Context` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator._generate_worker` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1204:21
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1228:21
 ERROR Object of class `NoneType` has no attribute `show_retrieve_source` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1285:16
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1309:16
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `RuntimeState` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator.resume` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1426:33
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1450:33
 ERROR Object of type `Generator[Mapping[str, Any] | str] | Mapping[str, Any]` has no attribute `ok` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1429:16
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1453:16
 ERROR Object of class `NoneType` has no attribute `app_id` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1433:16
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1457:16
 ERROR Object of class `NoneType` has no attribute `user_id` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1434:16
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1458:16
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `RuntimeState` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator.resume` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1474:33
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1498:33
 ERROR Object of type `Generator[Mapping[str, Any] | str] | Mapping[str, Any]` has no attribute `ok` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1477:16
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1501:16
 ERROR Argument `Literal['advanced-chat', 'agent', 'agent-chat', 'channel', 'chat', 'completion', 'rag-pipeline', 'workflow']` is not assignable to parameter `mode` with type `AppMode | SQLCoreOperations[AppMode]` in function `models.model.Conversation.__init__` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1571:14
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1595: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/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1577:16
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1601:16
 ERROR Argument `Literal['web-app']` is not assignable to parameter `invoke_from` with type `InvokeFrom | SQLCoreOperations[InvokeFrom | None] | None` in function `models.model.Conversation.__init__` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1578:21
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1602:21
 WARN Identity comparison `True is False` is always False [unnecessary-comparison]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1697:42
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1721:42
 ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1707:5
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1731:5
 ERROR Class member `_StubToolNode._get_error_strategy` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1739:9
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1763:9
 ERROR Class member `_StubToolNode._get_retry_config` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1742:9
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1766:9
 ERROR Class member `_StubToolNode._get_title` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1745:9
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1769:9
 ERROR Class member `_StubToolNode._get_description` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1748:9
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1772:9
 ERROR Class member `_StubToolNode._get_default_value_dict` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1751:9
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1775:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `WorkflowAppGenerateEntity` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1959:37
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1983:37
 ERROR `+` is not supported between `list[str]` and `Generator[Mapping[str, Any] | str]` [unsupported-operation]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1969:12
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1993:12
 ERROR `+` is not supported between `list[str]` and `Mapping[str, Any]` [unsupported-operation]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1969:12
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:1993:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AdvancedChatAppGenerateEntity` in function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator.resume` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:2006:37
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:2030:37
 ERROR `+` is not supported between `list[str]` and `Generator[Mapping[str, Any] | str]` [unsupported-operation]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:2016:12
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:2040:12
 ERROR `+` is not supported between `list[str]` and `Mapping[str, Any]` [unsupported-operation]
-    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:2016:12
+    --> tests/unit_tests/core/app/apps/advanced_chat/test_app_generator.py:2040:12
 ERROR Argument `list[object]` is not assignable to parameter `value` with type `Sequence[VariableBase]` in function `models.workflow.Workflow.conversation_variables` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/advanced_chat/test_app_runner.py:62:39
 ERROR Argument `object` is not assignable to parameter `variable` with type `VariableBase` in function `models.workflow.ConversationVariable.from_variable` [bad-argument-type]
@@ -3493,7 +3495,9 @@
 ERROR Class `PipelineRunner` has no class attribute `call_args` [missing-attribute]
    --> tests/unit_tests/core/app/apps/pipeline/test_pipeline_generator.py:444:21
 ERROR Object of class `Account` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/test_base_app_generator.py:602:9
+   --> tests/unit_tests/core/app/apps/test_base_app_generator.py:609:9
+ERROR `list[str]` is not assignable to attribute `allowed_file_types` with type `Sequence[FileType] | None` [bad-assignment]
+   --> tests/unit_tests/core/app/apps/test_base_app_generator.py:770:35
 ERROR Argument `object` is not assignable to parameter `task_id` with type `str` in function `core.app.apps.base_app_queue_manager.AppQueueManager.__init__` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/test_base_app_queue_manager.py:23:26
 ERROR Argument `object` is not assignable to parameter `user_id` with type `str` in function `core.app.apps.base_app_queue_manager.AppQueueManager.__init__` [bad-argument-type]
@@ -3657,51 +3661,53 @@
 ERROR Cannot set item in `object` [unsupported-operation]
   --> tests/unit_tests/core/app/apps/workflow/test_app_config_manager.py:47:17
 ERROR Argument `tuple[Literal['layer']]` is not assignable to parameter `graph_engine_layers` with type `Sequence[Layer]` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:395:33
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:398:33
 ERROR Argument `tuple[Literal['base-layer']]` is not assignable to parameter `graph_engine_layers` with type `Sequence[Layer]` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator._generate` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:482:37
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:485:37
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:491:31
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:494:31
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:493:16
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:496:16
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:494:16
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:497:16
+ERROR Argument `RuntimeState | None` is not assignable to parameter `graph_runtime_state` with type `RuntimeState` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:641:35
 ERROR No matching overload found for function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.generate` called with arguments: (app_model=App, workflow=Workflow, user=Account | EndUser, execution_identity=WorkflowExecutionIdentity, args=dict[str, dict[@_, @_]], invoke_from=Literal[InvokeFrom.SERVICE_API], streaming=Literal[False]) [no-matching-overload]
-   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:847:31
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:896:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.single_loop_generate` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1023:26
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1072:26
 ERROR Object of class `object` has no attribute `extras` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1085:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1134:20
 ERROR Argument `SimpleNamespace` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.single_loop_generate` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1143:22
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1192:22
 ERROR Object of class `object` has no attribute `extras` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1148:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1197:20
 ERROR Argument `SimpleNamespace` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.single_loop_generate` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1161:26
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1210:26
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator._handle_response` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1209:35
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1258:35
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator._handle_response` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1211:45
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1260:45
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `RuntimeState` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1365:37
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1414:37
 ERROR Object of type `Generator[Mapping[str, Any] | str] | Mapping[str, Any]` has no attribute `ok` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1370:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1419:20
 ERROR Object of class `NoneType` has no attribute `app_id` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1374:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1423:20
 ERROR Object of class `NoneType` has no attribute `user_id` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1375:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1424:20
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `RuntimeState` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1416:37
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1465:37
 ERROR Object of type `Generator[Mapping[str, Any] | str] | Mapping[str, Any]` has no attribute `ok` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1421:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1470:20
 ERROR Argument `SimpleNamespace` is not assignable to parameter `flask_app` with type `Flask` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator._generate_worker` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1477:27
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1526:27
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator._generate_worker` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1479:31
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1528:31
 ERROR Argument `SimpleNamespace` is not assignable to parameter `context` with type `Context` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator._generate_worker` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1480:25
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1529:25
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `RuntimeState | None` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator._generate_worker` [bad-argument-type]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1484:37
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1533:37
 ERROR Cannot index into `str` [bad-index]
   --> tests/unit_tests/core/app/apps/workflow/test_generate_response_converter.py:75:16
 ERROR Cannot index into `str` [bad-index]

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 79.90% 79.90% -0.00%
Strict coverage 79.59% 79.59% -0.00%
Typed symbols 76,667 76,700 +33
Untyped symbols 19,356 19,369 +13
Modules 3981 3983 +2

@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.16312% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.53%. Comparing base (b336b67) to head (ff3ef63).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
api/services/app/file_input_defaults.py 96.96% 0 Missing and 1 partial ⚠️
web/app/components/base/file-uploader/hooks.ts 88.88% 1 Missing ⚠️
...omponents/share/text-generation/run-once/index.tsx 95.83% 1 Missing ⚠️
web/service/console/app-parameters-select.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #44780    +/-   ##
========================================
  Coverage   89.53%   89.53%            
========================================
  Files        6010     6011     +1     
  Lines      376875   376985   +110     
  Branches    76238    76299    +61     
========================================
+ Hits       337425   337542   +117     
+ Misses      33454    33446     -8     
- Partials     5996     5997     +1     
Flag Coverage Δ
api 89.39% <97.50%> (+<0.01%) ⬆️
dify-ui 92.65% <ø> (ø)
web 89.49% <97.02%> (+0.01%) ⬆️

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

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

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

@github-actions github-actions Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Oct 26, 2026

@Stream29 Stream29 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please address the architecture-boundary concern in the inline comment before merging.

Comment thread api/core/app/apps/base_app_generator.py Resolved
@autofix-ci

autofix-ci Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm autofix logoautofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests.

I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:

  1. Allow edits by maintainers for your pull request, and then re-trigger CI (for example by pushing a new commit).
  2. Manually fix the issues identified for your pull request (see the GitHub Actions output for details on what I would like to change).

@hjlarry
hjlarry requested a review from a team October 28, 2026 01:27
Stream29
Stream29 previously approved these changes Oct 28, 2026
Stream29
Stream29 previously approved these changes Oct 28, 2026
@hjlarry
hjlarry added this pull request to the merge queue Oct 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 28, 2026
@hjlarry
hjlarry added this pull request to the merge queue Oct 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 28, 2026
@hjlarry
hjlarry added this pull request to the merge queue Oct 28, 2026
Merged via the queue into langgenius:main with commit 430d9af Oct 28, 2026
56 checks passed
@hjlarry
hjlarry deleted the codex/fix-file-input-defaults branch October 28, 2026 14:41
hjlarry added a commit to hjlarry/dify that referenced this pull request Oct 29, 2026
hjlarry added a commit that referenced this pull request Oct 29, 2026
@laipz8200 laipz8200 mentioned this pull request Nov 3, 2026
1 task done
WTW0313 added a commit that referenced this pull request Nov 4, 2026
Partially backport #44780 to lts/1.17.x for ENG-1415 issue 2. Restore form
inputs before switching conversations, recreate file uploaders during
reset and on conversation changes, and ignore uploads after their
provider unmounts.

Include regressions for single and multiple file inputs, input defaults,
unsent conversations, conversation switches, StrictMode, and delayed
upload callbacks.

(cherry picked from commit 430d9af)
WTW0313 added a commit that referenced this pull request Nov 4, 2026
Partially backport #44780 to the LTS frontend. Restore form inputs before
switching conversations, recreate file uploaders during reset and on
conversation changes, and ignore uploads after their provider unmounts.

Include only the chat-with-history reset and shared upload lifecycle fixes,
with regressions for file defaults, unsent conversations, conversation
switches, StrictMode, and delayed upload callbacks.

(cherry picked from commit 430d9af)
xhdnoah pushed a commit that referenced this pull request Nov 6, 2026
Partially backport #44780 to lts/1.17.x for ENG-1415 issue 2. Restore form
inputs before switching conversations, recreate file uploaders during
reset and on conversation changes, and ignore uploads after their
provider unmounts.

Include regressions for single and multiple file inputs, input defaults,
unsent conversations, conversation switches, StrictMode, and delayed
upload callbacks.

(cherry picked from commit 430d9af)
wylswz pushed a commit that referenced this pull request Nov 10, 2026
wylswz pushed a commit that referenced this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

2 participants