Skip to content

chore(api): upgrade graphon to v0.6.0, migrate HITL logic back to Dify#38247

Merged
QuantumGhost merged 25 commits into
langgenius:mainfrom
QuantumGhost:codex/hitl-graphon-v060-migration
Jul 3, 2026
Merged

chore(api): upgrade graphon to v0.6.0, migrate HITL logic back to Dify#38247
QuantumGhost merged 25 commits into
langgenius:mainfrom
QuantumGhost:codex/hitl-graphon-v060-migration

Conversation

@QuantumGhost

Copy link
Copy Markdown
Contributor

Summary

Closes #38224
Supersedes #38225

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-07-02 06:17:53.891634249 +0000
+++ /tmp/pyrefly_pr.txt	2026-07-02 06:17:38.228600123 +0000
@@ -724,10 +724,12 @@
    --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:593:23
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:603:23
+ERROR Argument `core.workflow.nodes.human_input.entities.HumanInputNodeData` is not assignable to parameter `data` with type `graphon.nodes.human_input.entities.HumanInputNodeData` in function `graphon.nodes.human_input.human_input_node.HumanInputNode.__init__` [bad-argument-type]
+   --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:126:14
 ERROR Argument `Connection | Engine` is not assignable to parameter `session_factory` with type `Engine | sessionmaker[Unknown]` in function `core.repositories.sqlalchemy_workflow_execution_repository.SQLAlchemyWorkflowExecutionRepository.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:265:29
+   --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:269:29
 ERROR Argument `Connection | Engine` is not assignable to parameter `session_factory` with type `Engine | sessionmaker[Unknown]` in function `core.repositories.sqlalchemy_workflow_node_execution_repository.SQLAlchemyWorkflowNodeExecutionRepository.__init__` [bad-argument-type]
-   --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:271:29
+   --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:275:29
 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/test_containers_integration_tests/helpers/execution_extra_content.py:48:14
 ERROR Returned type `int | str` is not assignable to declared return type `str` [bad-return]
@@ -745,9 +747,9 @@
 ERROR Cannot instantiate `DifyAPISQLAlchemyWorkflowNodeExecutionRepository` because the following members are abstract: `save`, `save_execution_data`, `get_by_workflow_execution` [bad-instantiation]
    --> tests/test_containers_integration_tests/repositories/test_sqlalchemy_api_workflow_node_execution_repository.py:122:70
 ERROR Class member `_TestWorkflowRunRepository.save` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-  --> tests/test_containers_integration_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:44:9
+  --> tests/test_containers_integration_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:45:9
 ERROR Generator function should return `Generator` [bad-return]
-   --> tests/test_containers_integration_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:138:56
+   --> tests/test_containers_integration_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:139:56
 ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `str` in function `_create_node_execution_model` [bad-argument-type]
    --> tests/test_containers_integration_tests/repositories/test_sqlalchemy_workflow_node_execution_repository.py:181:23
 ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `str` in function `_create_node_execution_model` [bad-argument-type]
@@ -3682,89 +3684,89 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `pause_state_config` with type `PauseStateLayerConfig | None` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator.resume` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_workflow_app_generator.py:321:28
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:52:55
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:53:55
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:59:55
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:60:55
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:91:55
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:92:55
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:120:55
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:121:55
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._prepare_single_node_execution` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:125:51
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:126:51
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:128:55
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:129:55
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._get_graph_and_variable_pool_for_single_node_run` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:167:22
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:168:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:182:55
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:183:55
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._get_graph_and_variable_pool_for_single_node_run` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:218:22
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:219:22
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:247:27
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:248:27
 ERROR Argument `SimpleNamespace` is not assignable to parameter `variable_loader` with type `VariableLoader` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:248:29
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:249:29
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._get_graph_and_variable_pool_for_single_node_run` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:311:22
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:312:22
 ERROR Object of class `NoneType` has no attribute `value` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:320:16
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:321:16
 ERROR Argument `TestWorkflowBasedAppRunner.test_handle_graph_run_events_and_pause_notifications._QueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:329:55
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:330:55
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:355:30
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:366:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:356:30
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:367:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:357:30
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:368:30
 ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:359:69
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:370:69
 ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:360:71
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:371:71
 ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:361:39
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:372:39
 ERROR Argument `TestWorkflowBasedAppRunner.test_handle_node_events_publishes_queue_events._QueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:372:55
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:383:55
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:380:13
-ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:390:13
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:391:13
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:401:13
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
    --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:412:13
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:428:13
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:423:13
+ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:439:13
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:442:13
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:453:13
 ERROR Argument `TestWorkflowBasedAppRunner.test_handle_human_input_form_filled_event_preserves_submitted_data._QueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:470:55
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:481:55
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:482:13
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:493:13
 ERROR Argument `TestWorkflowBasedAppRunner.test_handle_start_node_result_events_project_outputs._QueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:559:55
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:570:55
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:577:30
+   --> tests/unit_tests/core/app/apps/test_workflow_app_runner_core.py:588:30
 ERROR Argument `_DummyQueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_notifications.py:36:51
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_notifications.py:39:51
 ERROR Argument `_DummyWorkflowEntry` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
-  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_notifications.py:52:26
+  --> tests/unit_tests/core/app/apps/test_workflow_app_runner_notifications.py:60:26
 ERROR Class member `_RecordingWorkflowAppRunner._publish_event` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-  --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:54:9
+  --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:55:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_entry` with type `WorkflowEntry` in function `core.app.apps.workflow_app_runner.WorkflowBasedAppRunner._handle_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:110:26
+   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:123:26
 ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AdvancedChatAppGenerateEntity | WorkflowAppGenerateEntity` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:138:37
+   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:151:37
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:259:12
+   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:272:12
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:260:12
+   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:273:12
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:263:12
+   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:276:12
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:280:12
+   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:293:12
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:281:12
+   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:294:12
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:284:12
+   --> tests/unit_tests/core/app/apps/test_workflow_pause_events.py:297:12
 ERROR Object of class `FileInputConfig` has no attribute `option_source`
 ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.workflow.app_config_manager.WorkflowAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/workflow/test_app_config_manager.py:23:66
@@ -5777,27 +5779,37 @@
 ERROR Cannot set item in `dict[str, str]` [unsupported-operation]
    --> tests/unit_tests/core/workflow/graph_engine/test_mock_nodes.py:866:52
 ERROR Class member `StaticForm.id` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-  --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:89:9
-ERROR Class member `StaticForm.submission_token` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:93:9
-ERROR Class member `StaticForm.recipients` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `StaticForm.submission_token` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:97:9
-ERROR Class member `StaticForm.rendered_content` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `StaticForm.recipients` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:101:9
-ERROR Class member `StaticForm.selected_action_id` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `StaticForm.rendered_content` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:105:9
-ERROR Class member `StaticForm.submitted_data` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `StaticForm.selected_action_id` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:109:9
-ERROR Class member `StaticForm.submitted` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `StaticForm.created_at` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:113:9
-ERROR Class member `StaticForm.status` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `StaticForm.submitted_data` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:117:9
-ERROR Class member `StaticForm.expiration_time` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `StaticForm.submitted` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:121:9
-ERROR Class member `StaticRepo.get_form` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `StaticForm.status` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+   --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:125:9
+ERROR Class member `StaticForm.expiration_time` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:129:9
+ERROR Class member `StaticRepo.get_form` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+   --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:137:9
 ERROR Class member `StaticRepo.create_form` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-   --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:135:9
+   --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:143:9
+ERROR Argument `_TestFileReferenceFactory` is not assignable to parameter `file_reference_factory` with type `DifyFileReferenceFactory | None` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:202:32
+ERROR Argument `core.workflow.nodes.human_input.entities.HumanInputNodeData` is not assignable to parameter `data` with type `graphon.nodes.human_input.entities.HumanInputNodeData` in function `graphon.nodes.human_input.human_input_node.HumanInputNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:206:14
+ERROR Argument `_TestFileReferenceFactory` is not assignable to parameter `file_reference_factory` with type `DifyFileReferenceFactory | None` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:218:32
+ERROR Argument `core.workflow.nodes.human_input.entities.HumanInputNodeData` is not assignable to parameter `data` with type `graphon.nodes.human_input.entities.HumanInputNodeData` in function `graphon.nodes.human_input.human_input_node.HumanInputNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:222:14
 ERROR Argument `Sequence[type[GraphEngineEvent]]` is not assignable to parameter `expected_sequence` with type `list[type[GraphEngineEvent]]` in function `TableTestRunner._validate_event_sequence` [bad-argument-type]
    --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:403:21
 ERROR `graph` is uninitialized [unbound-name]
@@ -6007,47 +6019,57 @@
 ERROR Argument `Response` is not assignable to parameter `response` with type `HttpResponse` in function `graphon.nodes.http_request.entities.Response.__init__` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/http_request/test_http_request_node.py:161:17
 ERROR Class member `_InMemoryFormEntity.id` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-  --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:75:9
-ERROR Class member `_InMemoryFormEntity.submission_token` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:79:9
-ERROR Class member `_InMemoryFormEntity.recipients` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `_InMemoryFormEntity.submission_token` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:83:9
-ERROR Class member `_InMemoryFormEntity.rendered_content` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `_InMemoryFormEntity.recipients` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:87:9
-ERROR Class member `_InMemoryFormEntity.selected_action_id` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `_InMemoryFormEntity.rendered_content` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:91:9
-ERROR Class member `_InMemoryFormEntity.submitted_data` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `_InMemoryFormEntity.selected_action_id` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:95:9
-ERROR Class member `_InMemoryFormEntity.submitted` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `_InMemoryFormEntity.created_at` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:99:9
-ERROR Class member `_InMemoryFormEntity.status` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `_InMemoryFormEntity.submitted_data` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:103:9
-ERROR Class member `_InMemoryFormEntity.expiration_time` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+ERROR Class member `_InMemoryFormEntity.submitted` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:107:9
+ERROR Class member `_InMemoryFormEntity.status` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:111:9
+ERROR Class member `_InMemoryFormEntity.expiration_time` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:115:9
 ERROR Class member `InMemoryHumanInputFormRepository.create_form` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:120:9
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:128:9
 ERROR Class member `InMemoryHumanInputFormRepository.get_form` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:133:9
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:141:9
 ERROR Class member `_TestFileReferenceFactory.build_from_mapping` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:149:9
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:157:9
+ERROR Argument `_TestFileReferenceFactory` is not assignable to parameter `file_reference_factory` with type `DifyFileReferenceFactory | None` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:188:32
+ERROR Argument `core.workflow.nodes.human_input.entities.HumanInputNodeData` is not assignable to parameter `data` with type `graphon.nodes.human_input.entities.HumanInputNodeData` in function `graphon.nodes.human_input.human_input_node.HumanInputNode.__init__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:192:14
 ERROR Object of class `HumanInputNodeData` has no attribute `delivery_methods` [missing-attribute]
-   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:325:20
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:339:20
 ERROR Object of class `HumanInputNodeData` has no attribute `delivery_methods` [missing-attribute]
-   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:348:20
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:362:20
 ERROR Object of class `ExternalRecipient` has no attribute `reference_id` [missing-attribute]
-   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:441:16
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:455:16
 ERROR Object of class `BoundRecipient` has no attribute `email` [missing-attribute]
-   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:442:16
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:456:16
 ERROR Missing argument `reference_id` in function `core.workflow.human_input_adapter.BoundRecipient.__init__` [missing-argument]
-   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:446:28
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:460:28
 ERROR Unexpected keyword argument `user_id` in function `core.workflow.human_input_adapter.BoundRecipient.__init__` [unexpected-keyword]
-   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:446:61
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:460:61
 ERROR Unexpected keyword argument `whole_workspace` in function `core.workflow.human_input_adapter.EmailRecipients.__init__` [unexpected-keyword]
-   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:448:38
-ERROR Object of class `SchedulingPause` has no attribute `resolved_default_values` [missing-attribute]
-   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:526:16
+   --> tests/unit_tests/core/workflow/nodes/human_input/test_entities.py:462:38
 ERROR Class member `_TestFileReferenceFactory.build_from_mapping` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-  --> tests/unit_tests/core/workflow/nodes/human_input/test_human_input_form_filled_event.py:44:9
+  --> tests/unit_tests/core/workflow/nodes/human_input/test_human_input_form_filled_event.py:45:9
+ERROR Argument `_FakeFormRepository` is not assignable to parameter `form_repository` with type `HumanInputFormRepository` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__init__` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/nodes/human_input/test_human_input_form_filled_event.py:72:25
+ERROR Argument `_TestFileReferenceFactory` is not assignable to parameter `file_reference_factory` with type `DifyFileReferenceFactory | None` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__init__` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/nodes/human_input/test_human_input_form_filled_event.py:74:32
+ERROR Argument `core.workflow.nodes.human_input.entities.HumanInputNodeData` is not assignable to parameter `data` with type `graphon.nodes.human_input.entities.HumanInputNodeData` in function `graphon.nodes.human_input.human_input_node.HumanInputNode.__init__` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/nodes/human_input/test_human_input_form_filled_event.py:78:14
 ERROR Argument `dict[str, list[str] | str]` is not assignable to parameter `node_data` with type `KnowledgeIndexNodeData | dict[str, object]` in function `_build_node` [bad-argument-type]
    --> tests/unit_tests/core/workflow/nodes/knowledge_index/test_knowledge_index_node.py:140:23
 ERROR Argument `dict[str, bool]` is not assignable to parameter `summary_index_setting` with type `SummaryIndexSettingDict | None` in function `core.workflow.nodes.knowledge_index.knowledge_index_node.KnowledgeIndexNode._invoke_knowledge_index` [bad-argument-type]
@@ -6163,11 +6185,11 @@
 ERROR Cannot index into `object` [bad-index]
    --> tests/unit_tests/core/workflow/nodes/webhook/test_webhook_node.py:107:12
 ERROR Argument `list[str]` is not assignable to parameter `approval_channels` with type `list[ApprovalChannel]` in function `core.workflow.human_input_policy.FormDisposition.__new__` [bad-argument-type]
-  --> tests/unit_tests/core/workflow/test_enrich_pause_reasons.py:12:68
+  --> tests/unit_tests/core/workflow/test_enrich_pause_reasons.py:17:68
 ERROR Argument `list[str]` is not assignable to parameter `approval_channels` with type `list[ApprovalChannel]` in function `core.workflow.human_input_policy.FormDisposition.__new__` [bad-argument-type]
-  --> tests/unit_tests/core/workflow/test_enrich_pause_reasons.py:34:92
+  --> tests/unit_tests/core/workflow/test_enrich_pause_reasons.py:39:92
 ERROR Argument `TypeAlias[FormInputConfig, Annotated[FileInputConfig | FileListInputConfig | ParagraphInputConfig | SelectInputConfig]]` is not assignable to parameter `model_class` with type `type[Any]` in function `_validate_legacy_json` [bad-argument-type]
-  --> tests/unit_tests/core/workflow/test_form_input_serialization_compat.py:94:38
+  --> tests/unit_tests/core/workflow/test_form_input_serialization_compat.py:95:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `variable_pool` with type `VariablePool | None` in function `core.workflow.human_input_adapter.EmailDeliveryConfig.render_body_template` [bad-argument-type]
   --> tests/unit_tests/core/workflow/test_human_input_adapter.py:31:23
 ERROR Object of class `_InteractiveSurfaceDeliveryConfig` has no attribute `recipients` [missing-attribute]
@@ -6182,6 +6204,31 @@
    --> tests/unit_tests/core/workflow/test_human_input_adapter.py:367:35
 ERROR Argument `Literal[123]` is not assignable to parameter `node_config` with type `BaseModel | Mapping[str, Any]` in function `core.workflow.human_input_adapter.adapt_node_config_for_graph` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_human_input_adapter.py:372:37
+ERROR Argument `_Context` is not assignable to parameter `ctx` with type `HITLContext` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__call__` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/test_human_input_callback.py:54:25
+ERROR Argument `_Context` is not assignable to parameter `ctx` with type `HITLContext` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__call__` [bad-argument-type]
+  --> tests/unit_tests/core/workflow/test_human_input_callback.py:83:25
+ERROR Object of class `PauseRequested` has no attribute `selected_handle` [missing-attribute]
+  --> tests/unit_tests/core/workflow/test_human_input_callback.py:85:12
+ERROR Object of class `Expired` has no attribute `inputs`
+ERROR Object of class `PauseRequested` has no attribute `outputs` [missing-attribute]
+  --> tests/unit_tests/core/workflow/test_human_input_callback.py:87:12
+ERROR Argument `_Context` is not assignable to parameter `ctx` with type `HITLContext` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__call__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/test_human_input_callback.py:112:25
+ERROR Object of class `PauseRequested` has no attribute `selected_handle` [missing-attribute]
+   --> tests/unit_tests/core/workflow/test_human_input_callback.py:114:12
+ERROR Object of class `PauseRequested` has no attribute `outputs` [missing-attribute]
+   --> tests/unit_tests/core/workflow/test_human_input_callback.py:115:12
+ERROR Argument `_Context` is not assignable to parameter `ctx` with type `HITLContext` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__call__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/test_human_input_callback.py:139:25
+ERROR Object of class `PauseRequested` has no attribute `selected_handle` [missing-attribute]
+   --> tests/unit_tests/core/workflow/test_human_input_callback.py:141:12
+ERROR Object of class `PauseRequested` has no attribute `outputs` [missing-attribute]
+   --> tests/unit_tests/core/workflow/test_human_input_callback.py:142:12
+ERROR Argument `_Context` is not assignable to parameter `ctx` with type `HITLContext` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__call__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/test_human_input_callback.py:167:18
+ERROR Argument `_Context` is not assignable to parameter `ctx` with type `HITLContext` in function `core.workflow.nodes.human_input.callback.DifyHITLCallback.__call__` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/test_human_input_callback.py:188:18
 ERROR Argument `_FakeSession` is not assignable to parameter `session` with type `Session | None` in function `core.workflow.human_input_forms.load_form_tokens_by_form_id` [bad-argument-type]
   --> tests/unit_tests/core/workflow/test_human_input_forms.py:47:60
 ERROR Argument `_FakeSession` is not assignable to parameter `session` with type `Session | None` in function `core.workflow.human_input_forms.load_form_tokens_by_form_id` [bad-argument-type]
@@ -6220,18 +6267,16 @@
    --> tests/unit_tests/core/workflow/test_node_factory.py:486:39
 ERROR `SimpleNamespace` is not assignable to attribute `_dify_context` with type `DifyRunContext` [bad-assignment]
    --> tests/unit_tests/core/workflow/test_node_factory.py:487:33
-ERROR `form_repository` may be uninitialized [unbound-name]
-   --> tests/unit_tests/core/workflow/test_node_factory.py:633:49
 ERROR Argument `SimpleNamespace` is not assignable to parameter `node_data` with type `LLMNodeData | ParameterExtractorNodeData | QuestionClassifierNodeData` in function `core.workflow.node_factory.DifyNodeFactory._wrap_model_instance_for_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/test_node_factory.py:789:23
+   --> tests/unit_tests/core/workflow/test_node_factory.py:780:23
 ERROR Argument `_ModelInstanceStub` is not assignable to parameter `model_instance` with type `ModelInstance` in function `core.workflow.node_factory.DifyNodeFactory._wrap_model_instance_for_node` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/test_node_factory.py:790:28
+   --> tests/unit_tests/core/workflow/test_node_factory.py:781:28
 ERROR `SimpleNamespace` is not assignable to attribute `graph_runtime_state` with type `GraphRuntimeState` [bad-assignment]
-    --> tests/unit_tests/core/workflow/test_node_factory.py:1007:39
+   --> tests/unit_tests/core/workflow/test_node_factory.py:998:39
 ERROR `SimpleNamespace` is not assignable to attribute `_dify_context` with type `DifyRunContext` [bad-assignment]
-    --> tests/unit_tests/core/workflow/test_node_factory.py:1137:33
+    --> tests/unit_tests/core/workflow/test_node_factory.py:1128:33
 ERROR `SimpleNamespace` is not assignable to attribute `graph_runtime_state` with type `GraphRuntimeState` [bad-assignment]
-    --> tests/unit_tests/core/workflow/test_node_factory.py:1138:39
+    --> tests/unit_tests/core/workflow/test_node_factory.py:1129:39
 ERROR `object | None` is not assignable to attribute `model_runtime` with type `LLMModelRuntime` [bad-assignment]
   --> tests/unit_tests/core/workflow/test_node_runtime.py:68:30
 ERROR Class member `_ModelTypeInstanceStub.get_model_schema` overrides parent class `LargeLanguageModel` in an inconsistent manner [bad-override-param-name]
@@ -6613,17 +6658,19 @@
 ERROR Class member `TestVolcengineTos.setup_method` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> tests/unit_tests/oss/volcengine_tos/test_volcengine_tos.py:17:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `reason_model` with type `WorkflowPauseReason` in function `repositories.sqlalchemy_api_workflow_run_repository._build_human_input_required_reason` [bad-argument-type]
-  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:38:9
+  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:45:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `form_model` with type `HumanInputForm | None` in function `repositories.sqlalchemy_api_workflow_run_repository._build_human_input_required_reason` [bad-argument-type]
-  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:39:9
+  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:46:9
 ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `recipients` with type `Sequence[HumanInputFormRecipient]` in function `repositories.sqlalchemy_api_workflow_run_repository._build_human_input_required_reason` [bad-argument-type]
-  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:40:9
+  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:47:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `reason_model` with type `WorkflowPauseReason` in function `repositories.sqlalchemy_api_workflow_run_repository._build_human_input_required_reason` [bad-argument-type]
-  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:54:9
+  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:62:9
 ERROR Argument `SimpleNamespace` is not assignable to parameter `form_model` with type `HumanInputForm | None` in function `repositories.sqlalchemy_api_workflow_run_repository._build_human_input_required_reason` [bad-argument-type]
-  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:55:9
+  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:63:9
 ERROR Argument `list[SimpleNamespace]` is not assignable to parameter `recipients` with type `Sequence[HumanInputFormRecipient]` in function `repositories.sqlalchemy_api_workflow_run_repository._build_human_input_required_reason` [bad-argument-type]
-  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:56:9
+  --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:64:9
+ERROR Argument `SimpleNamespace` is not assignable to parameter `pause_model` with type `WorkflowPause` in function `repositories.sqlalchemy_api_workflow_run_repository._PrivateWorkflowPauseEntity.__init__` [bad-argument-type]
+   --> tests/unit_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:121:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `binding` with type `WorkflowAgentNodeBinding` in function `services.agent.composer_service.AgentComposerService._workflow_inline_debug_conversation_id` [bad-argument-type]
    --> tests/unit_tests/services/agent/test_agent_services.py:257:17
 ERROR Argument `SimpleNamespace` is not assignable to parameter `agent` with type `Agent | None` in function `services.agent.composer_service.AgentComposerService._workflow_inline_debug_conversation_id` [bad-argument-type]
@@ -7618,12 +7665,10 @@
    --> tests/unit_tests/services/test_workflow_run_service.py:132:103
 ERROR Argument `dict[str, dict[str, str | dict[str, str]] | str]` is not assignable to parameter `object` with type `dict[str, dict[str, list[Unknown] | str] | str]` in function `list.append` [bad-argument-type]
    --> tests/unit_tests/services/test_workflow_service.py:225:13
-ERROR Missing required key `id` for TypedDict `NodeConfigDict` [bad-typed-dict-key]
-    --> tests/unit_tests/services/test_workflow_service.py:2848:71
-ERROR Missing required key `data` for TypedDict `NodeConfigDict` [bad-typed-dict-key]
-    --> tests/unit_tests/services/test_workflow_service.py:2848:71
+ERROR `dict[@_, @_]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
+    --> tests/unit_tests/services/test_workflow_service.py:2852:54
 ERROR Argument `dict[str, str | dict[str, str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.workflow_service.WorkflowService._build_human_input_node_for_debugging` [bad-argument-type]
-    --> tests/unit_tests/services/test_workflow_service.py:2936:65
+    --> tests/unit_tests/services/test_workflow_service.py:2931:65
 ERROR Argument `Literal['api_key']` is not assignable to parameter `credential_type` with type `CredentialType` in function `services.tools.builtin_tools_manage_service.BuiltinToolManageService.list_builtin_provider_credentials_schema` [bad-argument-type]
   --> tests/unit_tests/services/tools/test_builtin_tools_manage_service.py:91:89
 ERROR Object of class `Mapping` has no attribute `startswith` [missing-attribute]

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 51.85% 51.94% +0.08%
Strict coverage 51.37% 51.46% +0.09%
Typed symbols 31,521 31,633 +112
Untyped symbols 29,542 29,546 +4
Modules 2951 2961 +10

@QuantumGhost QuantumGhost force-pushed the codex/hitl-graphon-v060-migration branch from ae59cfb to 99d1cf3 Compare July 1, 2026 08:44
@QuantumGhost QuantumGhost marked this pull request as ready for review July 2, 2026 06:25
@QuantumGhost QuantumGhost requested a review from a team July 2, 2026 06:25
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. refactor labels Jul 2, 2026
@QuantumGhost QuantumGhost marked this pull request as draft July 2, 2026 06:29
@QuantumGhost QuantumGhost marked this pull request as ready for review July 2, 2026 08:30
@QuantumGhost QuantumGhost enabled auto-merge July 3, 2026 02:55
@QuantumGhost QuantumGhost added this pull request to the merge queue Jul 3, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 3, 2026
Merged via the queue into langgenius:main with commit f4ec608 Jul 3, 2026
34 checks passed
@QuantumGhost QuantumGhost deleted the codex/hitl-graphon-v060-migration branch July 3, 2026 04:00
@dosubot

dosubot Bot commented Jul 3, 2026

Copy link
Copy Markdown

📄 Knowledge review

✏️ Documentation updates

1 page was updated by changes in this PR.

Page Library Status
Dify Agent Server 模块分析 (Commit 55f95dbc) dify ✅ Updated
📝 Dify Agent Server 模块分析 (Commit 55f95db) — changes
@@ -80,6 +80,53 @@
 ```
 
 这一设计标志着 Dify 从**单体同步执行模型**向**异步微服务化 Agent 执行**的架构演进。
+
+## graphon 升级与 HITL 逻辑迁移
+
+**PR #38247** 将 graphon 依赖从 **0.5.3** 升级至 **0.6.0**,并将 Human-in-the-Loop(HITL)表单定义和验证逻辑从 graphon 迁移回 Dify。graphon v0.6.0 保留了最小 HITL 回调契约(`HITLContext`、`HITLDecision`、`PauseRequested`、`Completed`、`Expired`),而 Dify 现在拥有工作流专用的表单 schema、字段类型(Paragraph、Select、File、FileList)、超时语义和 `DifyHITLCallback` 实现。这一重构明确了架构边界:graphon 提供通用暂停/恢复基础设施,Dify 管理具体的人工输入表单业务逻辑。
+
+### HITL 逻辑迁移详情
+
+新增模块 `api/core/workflow/nodes/human_input/` 包含 Dify 拥有的 HITL 实现:
+
+- **`entities.py`** (374 行):表单 schema 定义,包括 `HumanInputNodeData`、`FormInputConfig` 类型(`ParagraphInputConfig`、`SelectInputConfig`、`FileInputConfig`、`FileListInputConfig`)、`UserActionConfig`、`FormDefinition`,以及 `validate_human_input_submission` 验证函数
+- **`callback.py`** (329 行):`DifyHITLCallback` 类,桥接 Dify 人工输入语义到 graphon HITL 决策。该回调处理表单创建、状态规范化、超时判断、提交数据恢复和占位符渲染
+- **`enums.py`**:`FormInputType`、`HumanInputFormStatus`(WAITING、EXPIRED、SUBMITTED、TIMEOUT)、`ButtonStyle`、`TimeoutUnit`、`ValueSourceType`
+- **`pause_reason.py`**:Dify 的 `HumanInputRequired` 暂停原因和 `DifyHITLEventType`
+- **`boundary.py`**、**`session_binding.py`**、**`_exc.py`**:边界协议、会话绑定和异常定义
+
+### 超时语义变更
+
+新的超时处理区分**节点级超时**和**全局过期**:
+
+- `HumanInputFormStatus.TIMEOUT`:节点级超时到达,通过 `Expired(selected_handle="__timeout__")` 返回 graphon 超时分支
+- `HumanInputFormStatus.EXPIRED`:全局过期(由 `HUMAN_INPUT_GLOBAL_TIMEOUT_SECONDS` 控制),视为无效恢复状态,抛出 `AssertionError`
+- `HumanInputFormStatus.WAITING` 且全局截止时间已过:同样视为无效,抛出 `AssertionError`
+- `HumanInputFormStatus.WAITING` 且仅节点级截止时间已过:仍返回超时分支
+
+`HumanInputFormEntity` 新增 `created_at` 属性,用于计算全局截止时间(`created_at + HUMAN_INPUT_GLOBAL_TIMEOUT_SECONDS`)。
+
+### Agent V2 节点集成
+
+Agent v2 节点现已集成新的 Dify 拥有的 HITL 实体和回调:
+
+- `api/core/workflow/nodes/agent_v2/agent_node.py`:使用 `DifyHITLCallback` 构建人工输入暂停,通过 `default_session_binding` 转换暂停原因为 graphon `HitlRequired`
+- `api/core/workflow/nodes/agent_v2/ask_human_hitl.py` 和 `ask_human_resume.py`:与新的 `HumanInputRequired` 暂停原因和表单实体协作
+
+### Repository 和 Service 层变更
+
+- **`human_input_repository.py`**:增强 `HumanInputFormEntity` 协议(新增 `created_at` 属性),新增 `get_by_form_id()` 方法(17 行新增)
+- **`workflow_service.py`**:重构调试人工输入节点构建逻辑(66 行新增、40 行删除),现使用 `_DebugHumanInputNode` 数据类和 `DifyHITLCallback` 的静态渲染方法
+- **`pause_state_persist_layer.py`**:更新以支持新的暂停状态处理(11 行新增)
+
+### Node Factory 和 Runtime 更新
+
+- **`node_factory.py`**:`create_node` 方法现为 `BuiltinNodeTypes.HUMAN_INPUT` 实例化 `DifyHITLCallback`,并传递表单仓库、节点数据、对话 ID、投递方法、显示标志和文件引用工厂(19 行新增)
+- **`node_runtime.py`**:修改以使用新的暂停/恢复语义(15 行新增、17 行删除)
+
+### 架构意义
+
+此变更实现了更清晰的架构边界:graphon 保留通用的 HITL 决策协议(`PauseRequested`、`Completed`、`Expired`),而 Dify 拥有工作流特定的表单定义、验证规则、超时语义和兼容性载荷形状。这种分离使 graphon 保持轻量级和通用,同时给予 Dify 对人工输入节点业务逻辑的完全控制。
 
 ## 核心架构设计
 

Leave Feedback Ask Dosu about dify

GareArc added a commit that referenced this pull request Jul 8, 2026
…his branch's HITL API

This branch pre-dates the graphon 0.6.0 HITL migration (#38247), so
HumanInputNode here takes a runtime/form_repository protocol instead of
DifyHITLCallback. The existing unit tests in test_pause_state_persist_layer.py
and test_workflow_entry_helpers.py already cover the fix's invariant without
depending on that module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor/Chore] Migrate HITL logic back to Dify

2 participants