Skip to content

fix(workflow): preserve caller identity for scheduled Agent files - #44796

Merged
Stream29 merged 5 commits into
langgenius:mainfrom
ZombieBlue:fix/scheduled-agent-file-identity-44792
Oct 28, 2026
Merged

Stream29 merged 5 commits into
langgenius:mainfrom
ZombieBlue:fix/scheduled-agent-file-identity-44792

Conversation

@ZombieBlue

@ZombieBlue ZombieBlue commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #44792 for new workflow executions.

Scheduled workflows invoke the workflow generator with an Account and SERVICE_API. Inferring the caller type from the invocation source labels that Account as an EndUser in the graph's Agent execution context, so file upload and download can resolve different owners and fail with ToolFile ... not found.

  • Require user_from on the workflow execution entity. New execution entry points pass an immutable, ORM-free WorkflowExecutionIdentity DTO, built from the resolved caller at the calling boundary; the workflow generator no longer derives or overwrites the role from ORM objects.

  • Remove worker/runner identity fallbacks. Keep Account IDs as sys.user_id and real EndUser session IDs for EndUser executions, with tenant-scoped EndUser lookup.

  • Preserve explicit identity across pause/resume. Normalize older snapshots without user_from only in the persisted snapshot wrapper, using the previous runner rule (including single-node debugger behavior).

  • Update dependent constructors and fixtures for the required field, including the inherited RAG pipeline entity.

  • Normalize pre-upgrade RAG queue payloads at the serialized queue boundary so both normal and priority consumers can load them with the required identity field.

Compatibility

Already-paused scheduled runs whose snapshots lack user_from deliberately retain the historical EndUser role, including the known Agent file-owner mismatch. This change fixes new runs and their subsequent resumptions without reclassifying old API callers. Explicit invalid/null roles are rejected rather than inferred.

Validation

  • CI follow-up: 123 focused tests passed after adding queue-payload compatibility and merging current main (1f500e52cc). The no-new-getattr guard passes against this updated base; the earlier Style failure came from an upstream change included in the merge checkout but absent from the older comparison base. CI completed successfully on 4ce7179f6b: 35 checks passed and 14 were skipped, including passing API integration tests, Python Style, and both Codecov checks.

  • 859 passed across affected workflow generation, runner, pause serialization, service, task, pipeline, tool, and file endpoint unit tests.

  • After strengthening the legacy-snapshot regression to exercise actual EndUser owner remapping and the expected download failure, 102 focused tests passed across workflow generation, pause compatibility, identity adapters, and pipeline generation/runners.

  • Regression coverage includes Account and EndUser callers for fresh runs, explicit-identity snapshots, and legacy snapshots; required identity validation; invalid identity rejection; all invocation sources; single-node legacy debugging; signed file downloads; and tenant/owner isolation.

  • make lint passed, including all 75 import contracts. make type-check passed.

  • Staged test-double and BaseModel guards and git diff --check passed.

  • Docker-backed integration tests remain CI-owned; external Agent services and a deployed scheduled workflow were not exercised locally.

Checklist

  • Associated issue, fix, and legacy compatibility behavior are documented above.
  • Added regression coverage and updated affected callers and fixtures.
  • Ran relevant unit tests, make lint, and make type-check.

From Codex

@github-actions github-actions Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label 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 06:45:20.743708796 +0000
+++ /tmp/pyrefly_pr.txt	2026-10-28 06:45:09.891700959 +0000
@@ -293,7 +293,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:187: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]
@@ -2497,19 +2497,19 @@
 ERROR Argument value `Literal[101]` violates Pydantic `le` constraint `Literal[100]` for field `limit` [bad-argument-type]
    --> tests/unit_tests/controllers/service_api/app/test_conversation.py:130:39
 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/unit_tests/controllers/service_api/app/test_workflow_events.py:277:24
+   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:283:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:520:27
+   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:527:27
 WARN `datetime.datetime.utcnow` is deprecated [deprecated]
-   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:525:28
+   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:532:28
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:532:37
+   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:539:37
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:612:27
+   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:619:27
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:615:37
+   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:622:37
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `RuntimeState` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter.workflow_pause_to_stream_response` [bad-argument-type]
-   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:705:33
+   --> tests/unit_tests/controllers/service_api/app/test_workflow_events.py:712:33
 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/controllers/service_api/conftest.py:39:16
 ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `AppStatus | SQLCoreOperations[AppStatus]` in function `models.model.App.__init__` [bad-argument-type]
@@ -3445,23 +3445,23 @@
 ERROR `SimpleNamespace` is not assignable to attribute `_base_task_pipeline` with type `BasedGenerateTaskPipeline[Unknown]` [bad-assignment]
   --> tests/unit_tests/core/app/apps/common/test_graph_runtime_state_support.py:20:36
 ERROR Object of class `NoneType` has no attribute `data` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1171:20
+    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1175:20
 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/common/test_workflow_response_converter.py:1473:9
+    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1477:9
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1739:16
+    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1744:16
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1740:16
+    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1745:16
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1743:16
+    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1748:16
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1761:16
+    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1766:16
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1762:16
+    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1767:16
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1765:16
+    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1770:16
 ERROR Object of type `FileInputConfig | FileListInputConfig | ParagraphInputConfig | SelectInputConfig` has no attribute `option_source` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1817:16
+    --> tests/unit_tests/core/app/apps/common/test_workflow_response_converter.py:1822:16
 ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.completion.app_config_manager.CompletionAppConfigManager.get_app_config` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/completion/test_app_config_manager.py:49:34
 ERROR Argument `dict[str, bool]` is not assignable to parameter `annotation_reply` with type `AnnotationReplyDisabledConfig | AnnotationReplyEnabledConfig | None` in function `core.app.apps.completion.app_config_manager.CompletionAppConfigManager.get_app_config` [bad-argument-type]
@@ -3657,49 +3657,51 @@
 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:379:33
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:395: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:466:37
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:482:37
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:475:31
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:491:31
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:477:16
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:493:16
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:478:16
+   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:494:16
+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
 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:871:26
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1023:26
 ERROR Object of class `object` has no attribute `extras` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:932:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1085: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:989:22
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1143:22
 ERROR Object of class `object` has no attribute `extras` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:994:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1148: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:1006:26
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1161: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:1053:35
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1209: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:1055:45
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1211: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:1205:37
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1365: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:1210:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1370:20
 ERROR Object of class `NoneType` has no attribute `app_id` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1214:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1374:20
 ERROR Object of class `NoneType` has no attribute `user_id` [missing-attribute]
-    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1215:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1375: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:1255:37
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1416: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:1260:20
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1421: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:1315:27
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1477: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:1317:31
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1479: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:1318:25
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1480: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:1322:37
+    --> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1484: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]
@@ -3713,113 +3715,113 @@
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/app/apps/workflow/test_generate_response_converter.py:133:16
 ERROR `sessionmaker[Session]` is not assignable to attribute `_database_session` with type `() -> _GeneratorContextManager[Session]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:120:34
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:121:34
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:197:23
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:198:23
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:200:33
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:201:33
 ERROR Argument `SimpleNamespace` is not assignable to parameter `publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._listen_audio_msg` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:286:61
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:287:61
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:301:69
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:302:69
 ERROR `(**kwargs: Sequence[NodeExecutionSnapshot] | str) -> Literal['started']` is not assignable to attribute `workflow_start_to_stream_response` with type `(*, task_id: str, workflow_run_id: str, workflow_id: str, reason: WorkflowStartReason, node_execution_snapshots: Sequence[NodeExecutionSnapshot] = ...) -> WorkflowStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:316:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:317:87
 ERROR `(**kwargs: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent | str) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(*, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:331:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:332:93
 ERROR `(**kwargs: RuntimeState | int | str | None) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(*, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: RuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:359:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:360:88
 ERROR `(err: Unknown) -> Unknown` is not assignable to attribute `error_to_stream_response` with type `(e: Exception) -> ErrorStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:361:69
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:362:69
 ERROR Argument `TestGenerateTaskPipelineCoreCases.TestWorkflowGenerateTaskPipeline.test_handle_text_chunk_event_publishes_tts._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:383:72
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:384:72
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_message` with type `MessageQueueMessage | WorkflowQueueMessage | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._handle_text_chunk_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:383:100
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:384:100
 ERROR Object of class `StreamResponse` has no attribute `data` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:386:20
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:387:20
 ERROR `(**kwargs: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent | str) -> Literal['done']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(*, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:426:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:427:93
 ERROR `(**kwargs: RuntimeState | int | str | None) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(*, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: RuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:451:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:452:88
 ERROR `(**kwargs: QueueIterationStartEvent | str) -> Literal['iter']` is not assignable to attribute `workflow_iteration_start_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueIterationStartEvent) -> IterationNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:477:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:478:97
 ERROR `(**kwargs: QueueIterationNextEvent | str) -> Literal['next']` is not assignable to attribute `workflow_iteration_next_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueIterationNextEvent) -> IterationNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:478:96
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:479:96
 ERROR `(**kwargs: QueueIterationCompletedEvent | str) -> Literal['done']` is not assignable to attribute `workflow_iteration_completed_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueIterationCompletedEvent) -> IterationNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:479:101
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:480:101
 ERROR `(**kwargs: QueueLoopStartEvent | str) -> Literal['loop']` is not assignable to attribute `workflow_loop_start_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueLoopStartEvent) -> LoopNodeStartStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:482:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:483:92
 ERROR `(**kwargs: QueueLoopNextEvent | str) -> Literal['loop_next']` is not assignable to attribute `workflow_loop_next_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueLoopNextEvent) -> LoopNodeNextStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:483:91
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:484:91
 ERROR `(**kwargs: QueueLoopCompletedEvent | str) -> Literal['loop_done']` is not assignable to attribute `workflow_loop_completed_to_stream_response` with type `(*, task_id: str, workflow_execution_id: str, event: QueueLoopCompletedEvent) -> LoopNodeCompletedStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:484:96
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:485:96
 ERROR `(**kwargs: QueueHumanInputFormFilledEvent | str) -> Literal['filled']` is not assignable to attribute `human_input_form_filled_to_stream_response` with type `(*, event: QueueHumanInputFormFilledEvent, task_id: str) -> HumanInputFormFilledResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:487:96
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:488:96
 ERROR `(**kwargs: QueueHumanInputFormTimeoutEvent | str) -> Literal['timeout']` is not assignable to attribute `human_input_form_timeout_to_stream_response` with type `(*, event: QueueHumanInputFormTimeoutEvent, task_id: str) -> HumanInputFormTimeoutResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:488:97
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:489:97
 ERROR `(**kwargs: Unknown) -> Literal['log']` is not assignable to attribute `handle_agent_log` with type `(task_id: str, event: QueueAgentLogEvent) -> AgentLogStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:491:70
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:492:70
 ERROR `(**kwargs: Unknown) -> Iterator[PingStreamResponse]` is not assignable to attribute `_process_stream_response` with type `(tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:579:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:580:49
 ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:641:31
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:642:31
 ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:644:41
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:645:41
 ERROR `(**kwargs: Unknown) -> Iterator[PingStreamResponse]` is not assignable to attribute `_wrapper_process_stream_response` with type `(trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:653:57
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:654:57
 ERROR Object of class `tuple` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:657:20
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:658:20
 ERROR `(**kwargs: Unknown) -> Iterator[WorkflowFinishStreamResponse]` is not assignable to attribute `_wrapper_process_stream_response` with type `(trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:660:57
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:661:57
 ERROR Object of class `Generator` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:682:20
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:683:20
 ERROR `(**kwargs: Unknown) -> Iterator[PingStreamResponse]` is not assignable to attribute `_process_stream_response` with type `(tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:726:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:727:49
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:737:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:738:49
 ERROR `(**kwargs: Unknown) -> Iterator[Any]` is not assignable to attribute `_process_stream_response` with type `(tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:773:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:774:49
 ERROR `(**kwargs: QueueNodeRetryEvent | str) -> Literal['retry']` is not assignable to attribute `workflow_node_retry_to_stream_response` with type `(*, event: QueueNodeRetryEvent, task_id: str) -> NodeRetryStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:850:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:851:92
 ERROR `(**kwargs: QueueNodeStartedEvent | str) -> Literal['started']` is not assignable to attribute `workflow_node_start_to_stream_response` with type `(*, event: QueueNodeStartedEvent, task_id: str) -> NodeStartStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:855:92
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:856:92
 ERROR `(**kwargs: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent | str) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(*, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:861:93
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:862:93
 ERROR `(**kwargs: RuntimeState | int | str | None) -> Literal['finish']` is not assignable to attribute `workflow_finish_to_stream_response` with type `(*, task_id: str, workflow_id: str, status: WorkflowExecutionStatus, graph_runtime_state: RuntimeState, error: str | None = None, exceptions_count: int = 0) -> WorkflowFinishStreamResponse` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:890:88
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:891:88
 ERROR `(**kwargs: QueueWorkflowPausedEvent | RuntimeState | str) -> list[str]` is not assignable to attribute `workflow_pause_to_stream_response` with type `(*, event: QueueWorkflowPausedEvent, task_id: str, graph_runtime_state: RuntimeState) -> list[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:900:87
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:901:87
 ERROR `(event: QueuePingEvent, **kwargs: Unknown) -> Iterator[str]` is not assignable to attribute `_handle_ping_event` with type `(event: QueuePingEvent, **kwargs: Unknown) -> Generator[PingStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:922:43
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:923:43
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: TraceQueueManager | None) -> Iterator[str]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:925:64
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:926:64
 ERROR Argument `SimpleNamespace` is not assignable to parameter `event` with type `AppQueueEvent` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._dispatch_event` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:930:50
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:931:50
 ERROR `() -> Iterator[SimpleNamespace]` is not assignable to attribute `listen` with type `() -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:941:65
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:942:65
 ERROR `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Iterator[str]` is not assignable to attribute `_handle_workflow_started_event` with type `(event: QueueWorkflowStartedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:949:55
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:950:55
 ERROR `(event: QueueTextChunkEvent, **kwargs: AppGeneratorTTSPublisher | MessageQueueMessage | WorkflowQueueMessage | None) -> Iterator[str]` is not assignable to attribute `_handle_text_chunk_event` with type `(event: QueueTextChunkEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:950:49
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:951:49
 ERROR `(event: AppQueueEvent, **kwargs: AppGeneratorTTSPublisher | MessageQueueMessage | TraceQueueManager | WorkflowQueueMessage | None) -> Iterator[str]` is not assignable to attribute `_dispatch_event` with type `(event: AppQueueEvent, *, tts_publisher: AppGeneratorTTSPublisher | None = None, trace_manager: TraceQueueManager | None = None, queue_message: MessageQueueMessage | WorkflowQueueMessage | None = None) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:951:40
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:952:40
 ERROR `(event: QueueErrorEvent, **kwargs: Unknown) -> Iterator[str]` is not assignable to attribute `_handle_error_event` with type `(event: QueueErrorEvent, **kwargs: Unknown) -> Generator[ErrorStreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:952:44
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:953:44
 ERROR Argument `TestGenerateTaskPipelineCoreCases.TestWorkflowGenerateTaskPipeline.test_process_stream_response_main_match_paths_and_cleanup._Publisher` is not assignable to parameter `tts_publisher` with type `AppGeneratorTTSPublisher | None` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline._process_stream_response` [bad-argument-type]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:959:78
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:960:78
 ERROR `() -> Iterator[SimpleNamespace]` is not assignable to attribute `listen` with type `() -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:966:65
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:967:65
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: TraceQueueManager | None) -> Iterator[str]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:969:64
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:970:64
 ERROR `() -> Iterator[SimpleNamespace]` is not assignable to attribute `listen` with type `() -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:972:65
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:973:65
 ERROR `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Iterator[str]` is not assignable to attribute `_handle_workflow_paused_event` with type `(event: QueueWorkflowPausedEvent, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:975:54
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:976:54
 ERROR `() -> Iterator[SimpleNamespace]` is not assignable to attribute `listen` with type `() -> Generator[MessageQueueMessage | WorkflowQueueMessage, Unknown]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:978:65
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:979:65
 ERROR `(event: QueueStopEvent | QueueWorkflowFailedEvent, **kwargs: TraceQueueManager | None) -> Iterator[str]` is not assignable to attribute `_handle_workflow_failed_and_stop_events` with type `(event: QueueStopEvent | QueueWorkflowFailedEvent, *, trace_manager: TraceQueueManager | None = None, **kwargs: Unknown) -> Generator[StreamResponse]` [bad-assignment]
-   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:981:64
+   --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:982:64
 ERROR `(**kwargs: Unknown) -> TestGenerateTaskPipelineCoreCases.TestWorkflowGenerateTaskPipeline.test_save_output_for_event_writes_draft_variables._Saver` is not assignable to attribute `_draft_var_saver_factory` with type `DraftVariableSaverFactory` [bad-assignment]
-    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:1022:49
+    --> tests/unit_tests/core/app/apps/workflow/test_generate_task_pipeline.py:1023:49
 ERROR Object of class `Mapping` has no attribute `close` [missing-attribute]
    --> tests/unit_tests/core/app/features/rate_limiting/test_rate_limit.py:396:9
 ERROR Argument `TestRateLimitGenerator.test_should_handle_generator_without_close_method.SimpleGenerator` is not assignable to parameter `generator` with type `Generator[str] | Mapping[str, Any]` in function `core.app.features.rate_limiting.rate_limit.RateLimit.generate` [bad-argument-type]
@@ -3830,6 +3832,10 @@
    --> tests/unit_tests/core/app/features/rate_limiting/test_rate_limit.py:448:9
 ERROR Argument `Mapping[str, Any] | RateLimitGenerator` is not assignable to parameter `i` with type `SupportsNext[@_]` in function `next` [bad-argument-type]
    --> tests/unit_tests/core/app/features/rate_limiting/test_rate_limit.py:451:18
+ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `user_from` [missing-attribute]
+   --> tests/unit_tests/core/app/layers/test_pause_state_persist_layer.py:142:12
+ERROR Object of class `AdvancedChatAppGenerateEntity` has no attribute `user_from` [missing-attribute]
+   --> tests/unit_tests/core/app/layers/test_pause_state_persist_layer.py:157:12
 ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
   --> tests/unit_tests/core/app/layers/test_trigger_post_layer.py:33:66
 ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
@@ -6045,11 +6051,11 @@
 ERROR Argument `Literal['advanced-chat', 'agent', 'agent-chat', 'channel', 'chat', 'completion', 'rag-pipeline', 'workflow']` is not assignable to parameter `mode` with type `Literal['advanced-chat', 'agent', 'agent-chat', 'chat', 'completion', 'workflow']` in function `services.entities.app_entities.CreateAppParams.__init__` [bad-argument-type]
    --> tests/unit_tests/services/test_app_service.py:356:65
 ERROR Argument `Literal[graphon.enums.WorkflowType.WORKFLOW]` is not assignable to parameter `type` with type `SQLCoreOperations[models.workflow.WorkflowType] | models.workflow.WorkflowType` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-    --> tests/unit_tests/services/test_app_task_service.py:1125:18
+    --> tests/unit_tests/services/test_app_task_service.py:1131:18
 ERROR Argument `Literal[graphon.enums.WorkflowType.WORKFLOW]` is not assignable to parameter `type` with type `SQLCoreOperations[models.workflow.WorkflowType] | models.workflow.WorkflowType` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-    --> tests/unit_tests/services/test_app_task_service.py:1259:18
+    --> tests/unit_tests/services/test_app_task_service.py:1265:18
 ERROR Argument `Literal[graphon.enums.WorkflowType.WORKFLOW]` is not assignable to parameter `type` with type `SQLCoreOperations[models.workflow.WorkflowType] | models.workflow.WorkflowType` in function `models.workflow.WorkflowRun.__init__` [bad-argument-type]
-    --> tests/unit_tests/services/test_app_task_service.py:1313:18
+    --> tests/unit_tests/services/test_app_task_service.py:1319:18
 ERROR `in` is not supported between `Literal['Quota limit reached']` and `None` [not-iterable]
    --> tests/unit_tests/services/test_async_workflow_service.py:344:16
 WARN `services.billing_service.BillingService.get_model_provider_payment_link` is deprecated [deprecated]
@@ -6199,13 +6205,13 @@
 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/unit_tests/services/test_workflow_draft_variable_service.py:1754:32
 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/unit_tests/services/test_workflow_event_snapshot_service.py:97:24
+   --> tests/unit_tests/services/test_workflow_event_snapshot_service.py:102: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/unit_tests/services/test_workflow_event_snapshot_service.py:224:24
+   --> tests/unit_tests/services/test_workflow_event_snapshot_service.py:230:24
 ERROR Argument `None` is not assignable to parameter `value` with type `SQLCoreOperations[datetime] | datetime` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
-   --> tests/unit_tests/services/test_workflow_event_snapshot_service.py:513:26
+   --> tests/unit_tests/services/test_workflow_event_snapshot_service.py:520:26
 ERROR Unpacked keyword argument `bool` is not assignable to parameter `human_input_surface` with type `HumanInputSurface | None` in function `services.workflow_event_snapshot_service.build_workflow_event_stream` [bad-argument-type]
-   --> tests/unit_tests/services/test_workflow_event_snapshot_service.py:790:13
+   --> tests/unit_tests/services/test_workflow_event_snapshot_service.py:797:13
 ERROR No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, object]) [no-matching-overload]
   --> tests/unit_tests/services/test_workflow_node_execution_trace_service.py:41:18
 ERROR Argument `dict[str, list[dict[str, object]] | str]` is not assignable to parameter `process_data` with type `dict[str, object]` in function `_execution` [bad-argument-type]
@@ -6389,111 +6395,111 @@
 ERROR Argument `dict[str, list[dict[str, str | dict[str, str | Unknown] | None]] | list[Unknown]]` is not assignable to parameter `graph` with type `WorkflowGraph` in function `services.workflow.workflow_converter.WorkflowConverter._append_node` [bad-argument-type]
    --> tests/unit_tests/services/workflow/test_workflow_converter.py:864:44
 ERROR Argument `object` is not assignable to parameter `event` with type `BaseModel | Mapping[str, Any] | str` in function `tasks.app_generate.workflow_execute_task._get_event_name` [bad-argument-type]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:327:57
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:333:57
 ERROR Argument `object` is not assignable to parameter `event` with type `BaseModel | Mapping[str, Any] | str` in function `tasks.app_generate.workflow_execute_task._get_task_id` [bad-argument-type]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:343:54
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:349:54
 ERROR Argument `Iterator[dict[str, str | dict[str, str]] | dict[str, str]]` is not assignable to parameter `response_stream` with type `Generator[BaseModel | Mapping[str, Any] | str]` in function `tasks.app_generate.workflow_execute_task._publish_streaming_response` [bad-argument-type]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:381:9
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:387:9
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:390:13
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:396:13
 ERROR Argument `Iterator[dict[str, str]]` is not assignable to parameter `response_stream` with type `Generator[BaseModel | Mapping[str, Any] | str]` in function `tasks.app_generate.workflow_execute_task._publish_streaming_response` [bad-argument-type]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:398:9
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:404:9
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:407:13
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:413:13
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:429:13
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:435:13
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:430:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:436:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:430:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:436:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:431:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:437:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:431:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:437:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:432:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:438:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:432:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:438:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:433:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:439:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:433:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:439:12
 ERROR Argument `Iterator[dict[str, str]]` is not assignable to parameter `response_stream` with type `Generator[BaseModel | Mapping[str, Any] | str]` in function `tasks.app_generate.workflow_execute_task._publish_streaming_response` [bad-argument-type]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:459:13
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:465:13
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:467:13
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:473:13
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:468:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:474:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:469:23
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:475:23
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:469:23
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:475:23
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:470:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:476:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:471:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:477:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:471:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:477:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:472:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:478:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:472:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:478:12
 ERROR Argument `Iterator[dict[str, str | dict[str, dict[Any, Any] | int | str]] | dict[str, str]]` is not assignable to parameter `response_stream` with type `Generator[BaseModel | Mapping[str, Any] | str]` in function `tasks.app_generate.workflow_execute_task._publish_streaming_response` [bad-argument-type]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:505:13
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:511:13
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:513:13
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:519:13
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:514:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:520:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:515:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:521:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:515:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:521:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:516:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:522:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:516:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:522:12
 ERROR Argument `Iterator[dict[str, str | dict[str, str]] | dict[str, str]]` is not assignable to parameter `response_stream` with type `Generator[BaseModel | Mapping[str, Any] | str]` in function `tasks.app_generate.workflow_execute_task._publish_streaming_response` [bad-argument-type]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:549:13
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:555:13
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:557:13
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:563:13
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:558:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:564:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:559:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:565:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:559:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:565:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:560:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:566:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:560:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:566:12
 ERROR Argument `Iterator[dict[str, str | dict[str, dict[Any, Any] | int | str]]]` is not assignable to parameter `response_stream` with type `Generator[BaseModel | Mapping[str, Any] | str]` in function `tasks.app_generate.workflow_execute_task._publish_streaming_response` [bad-argument-type]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:582:9
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:588:9
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:591:13
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:597:13
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:592:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:598:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:593:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:599:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:593:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:599:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:594:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:600:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:594:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:600:12
 ERROR Argument `Iterator[dict[str, str | dict[str, dict[Any, Any] | int | str]] | dict[str, str | dict[str, WorkflowExecutionStatus | dict[Any, Any] | float | int | list[Any] | str | None]]]` is not assignable to parameter `response_stream` with type `Generator[BaseModel | Mapping[str, Any] | str]` in function `tasks.app_generate.workflow_execute_task._publish_streaming_response` [bad-argument-type]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:664:9
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:670:9
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:673:13
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:679:13
 ERROR Object of class `EndUser` has no attribute `current_tenant` [missing-attribute]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:753:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:759:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:801:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:807:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:801:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:807:12
 ERROR Cannot index into `str` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:802:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:808:12
 ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:802:12
+   --> tests/unit_tests/tasks/app_generate/test_workflow_execute_task.py:808:12
 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/tasks/test_clean_dataset_task.py:99:56
 ERROR Argument `Literal['upload_file']` is not assignable to parameter `value` with type `DataSourceType | SQLCoreOperations[DataSourceType]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 79.89% 79.90% +0.01%
Strict coverage 79.58% 79.58% +0.01%
Typed symbols 76,591 76,624 +33
Untyped symbols 19,358 19,357 -1
Modules 3978 3980 +2

@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.53%. Comparing base (1f500e5) to head (4ce7179).

Files with missing lines Patch % Lines
api/services/workflow_execution_identity.py 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #44796   +/-   ##
=======================================
  Coverage   89.52%   89.53%           
=======================================
  Files        6009     6010    +1     
  Lines      376843   376888   +45     
  Branches    76238    76244    +6     
=======================================
+ Hits       337380   337435   +55     
+ Misses      33465    33454   -11     
- Partials     5998     5999    +1     
Flag Coverage Δ
api 89.39% <96.42%> (+<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 size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 28, 2026

@Stream29 Stream29 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. The explicit execution identity and legacy snapshot/queue compatibility address my previous feedback. I independently reran 335 related unit tests; all passed.

@Stream29
Stream29 added this pull request to the merge queue Oct 28, 2026
Merged via the queue into langgenius:main with commit b336b67 Oct 28, 2026
51 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:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduled workflow: Agent node file output fails with "ToolFile not found" because runner marks the Account as end-user

2 participants