Skip to content

fix: fetch memory of LLM node may cause out of flask context#36253

Merged
asukaminato0721 merged 1 commit into
langgenius:mainfrom
hjlarry:p423
May 16, 2026
Merged

fix: fetch memory of LLM node may cause out of flask context#36253
asukaminato0721 merged 1 commit into
langgenius:mainfrom
hjlarry:p423

Conversation

@hjlarry
Copy link
Copy Markdown
Contributor

@hjlarry hjlarry commented May 16, 2026

Important

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

Summary

fix #36252

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

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 16, 2026
@hjlarry hjlarry requested a review from fatelei May 16, 2026 13:22
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-05-16 13:23:44.022073787 +0000
+++ /tmp/pyrefly_pr.txt	2026-05-16 13:23:31.875995907 +0000
@@ -5506,23 +5506,25 @@
 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:101:17
 ERROR Argument `object` is not assignable to parameter `node_data_memory` with type `MemoryConfig | None` in function `core.workflow.node_factory.fetch_memory` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/test_node_factory.py:119:30
+   --> tests/unit_tests/core/workflow/test_node_factory.py:118:30
 ERROR Argument `object` is not assignable to parameter `node_data_memory` with type `MemoryConfig | None` in function `core.workflow.node_factory.fetch_memory` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/test_node_factory.py:155:30
+   --> tests/unit_tests/core/workflow/test_node_factory.py:153:30
+ERROR Argument `object` is not assignable to parameter `node_data_memory` with type `MemoryConfig | None` in function `core.workflow.node_factory.fetch_memory` [bad-argument-type]
+   --> tests/unit_tests/core/workflow/test_node_factory.py:192:30
 ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_init_params` with type `GraphInitParams` in function `core.workflow.node_factory.DifyNodeFactory.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/workflow/test_node_factory.py:347:35
+   --> tests/unit_tests/core/workflow/test_node_factory.py:380:35
 ERROR `SimpleNamespace` is not assignable to attribute `graph_runtime_state` with type `GraphRuntimeState` [bad-assignment]
-   --> tests/unit_tests/core/workflow/test_node_factory.py:410:39
+   --> tests/unit_tests/core/workflow/test_node_factory.py:443:39
 ERROR `SimpleNamespace` is not assignable to attribute `_dify_context` with type `DifyRunContext` [bad-assignment]
-   --> tests/unit_tests/core/workflow/test_node_factory.py:411:33
+   --> tests/unit_tests/core/workflow/test_node_factory.py:444:33
 ERROR `form_repository` may be uninitialized [unbound-name]
-   --> tests/unit_tests/core/workflow/test_node_factory.py:554:49
+   --> tests/unit_tests/core/workflow/test_node_factory.py:587:49
 ERROR `SimpleNamespace` is not assignable to attribute `graph_runtime_state` with type `GraphRuntimeState` [bad-assignment]
-   --> tests/unit_tests/core/workflow/test_node_factory.py:817:39
+   --> tests/unit_tests/core/workflow/test_node_factory.py:850:39
 ERROR `SimpleNamespace` is not assignable to attribute `_dify_context` with type `DifyRunContext` [bad-assignment]
-   --> tests/unit_tests/core/workflow/test_node_factory.py:947:33
+   --> tests/unit_tests/core/workflow/test_node_factory.py:980: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:948:39
+   --> tests/unit_tests/core/workflow/test_node_factory.py:981:39
 ERROR Object of class `ExternalRecipient` has no attribute `reference_id` [missing-attribute]
   --> tests/unit_tests/core/workflow/test_node_runtime.py:92:12
 ERROR Argument `object` is not assignable to parameter `method` with type `EmailDeliveryMethod | InteractiveSurfaceDeliveryMethod` in function `core.workflow.node_runtime.apply_dify_debug_email_recipient` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 0.00% 43.70% +43.70%
Strict coverage 0.00% 43.22% +43.22%
Typed symbols 0 22,132 +22,132
Untyped symbols 0 28,830 +28,830
Modules 0 2557 +2,557

@asukaminato0721 asukaminato0721 enabled auto-merge May 16, 2026 16:38
@asukaminato0721 asukaminato0721 added this pull request to the merge queue May 16, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 16, 2026
Merged via the queue into langgenius:main with commit 41b6f89 May 16, 2026
27 checks passed
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 size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetch memory of LLM node may cause out of flask context

2 participants