Repository navigation
fix(workflow): restore structured output fallback and boolean types - #44962
Merged
Merged
Conversation
Contributor
Pyrefly Type Coverage
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-10-28 10:30:05.237203594 +0000
+++ /tmp/pyrefly_pr.txt 2026-10-28 10:29:54.377055484 +0000
@@ -3947,23 +3947,19 @@
ERROR Object of class `NoneType` has no attribute `split` [missing-attribute]
--> tests/unit_tests/core/helper/test_trace_id_helper.py:361:21
ERROR Class member `_ModelInstance.invoke_llm` overrides parent class `ModelInstance` in an inconsistent manner [bad-override]
- --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:66:9
+ --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:68:9
ERROR Class member `_ModelInstance.invoke_llm` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:66:9
+ --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:68:9
ERROR Argument `None` is not assignable to parameter `schema` with type `dict[str, Any]` in function `core.llm_generator.output_parser.structured_output.remove_additional_properties` [bad-argument-type]
- --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:86:38
+ --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:89:38
ERROR Argument `list[@_]` is not assignable to parameter `schema` with type `dict[str, Any]` in function `core.llm_generator.output_parser.structured_output.remove_additional_properties` [bad-argument-type]
- --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:87:38
-ERROR Argument `None` is not assignable to parameter `schema` with type `dict[str, Any]` in function `core.llm_generator.output_parser.structured_output.convert_boolean_to_string` [bad-argument-type]
- --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:104:35
-ERROR Argument `list[@_]` is not assignable to parameter `schema` with type `dict[str, Any]` in function `core.llm_generator.output_parser.structured_output.convert_boolean_to_string` [bad-argument-type]
- --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:105:35
+ --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:90:38
ERROR `in` is not supported between `Literal['Existing system prompt']` and `None` [not-iterable]
- --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:285:16
+ --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:390:16
ERROR `in` is not supported between `str` and `None` [not-iterable]
- --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:286:16
+ --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:391:16
ERROR `in` is not supported between `str` and `None` [not-iterable]
- --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:297:16
+ --> tests/unit_tests/core/llm_generator/output_parser/test_structured_output.py:402:16
ERROR Argument `() -> Session` is not assignable to parameter `session_factory` with type `sessionmaker[@_]` in function `sqlalchemy.orm.scoping.scoped_session.__init__` [bad-argument-type]
--> tests/unit_tests/core/llm_generator/test_llm_generator.py:159:35
ERROR Keyword argument `access_token` with type `Literal['at']` is not assignable to parameter `**kwargs` with type `dict[str, str]` in function `typing.MutableMapping.update` [bad-argument-type]
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44962 +/- ##
=======================================
Coverage 89.52% 89.53%
=======================================
Files 6009 6009
Lines 376843 376837 -6
Branches 76238 76232 -6
=======================================
+ Hits 337380 337390 +10
+ Misses 33465 33450 -15
+ Partials 5998 5997 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
zyssyz123
enabled auto-merge
October 28, 2026 10:53
1 task done
2 of 5 tasks
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Workflow LLM nodes using schema-prompt fallback can fail at Graphon's capability check after the 1.18.0 upgrade. Boolean fields can also fail final schema validation because Dify converts native boolean schemas to strings and instructs prompt-based responses to use strings.
Expose the prepared adapter's effective structured-output capability without mutating provider metadata, and keep native/prompt routing based on the original provider schema. Preserve boolean types in native schemas and prompt instructions. Polling retains provider-declared capabilities, and strict result validation remains enabled. Include the compatibility tests in KnowledgeFS's selective coverage suite so its changed-glue gate exercises the same adapter paths.
Related to CUS-1763.
Validation
bcb2364d0dad7b2cce71963c45e042bba9dfe265through the existingdeploy/saasbuild/deploy workflows. API and workflow workers run the same new image.gpt-6-solfailed boolean result validation, andgpt-4.1-nanofailed the capability check.gpt-6-solsucceeded through Start, two LLM nodes, and End (run71ebc9bd-7a2a-4764-b7af-7d5165b9bfa8, 4 steps, 250 tokens). Persisted node and workflow outputs preservedfalsein scalar/nested/array fields andtruein the array.gpt-6-solprovider call throughDifyPreparedLLMand Graphon's LLM node, with a process-local copy of provider metadata that omittedstructured-output. The request included the schema and boolean instructions in the system prompt, omitted nativejson_schema, and succeeded with all four values retaining boolean types. Original provider metadata was unchanged. This is a controlled capability fixture with a real provider, not a naturally non-native model end-to-end test.gpt-4.1-nanopassed the capability gate after deployment, but its upstream API returned a model-deprecated 404; that request is not counted as successful fallback output validation.Checklist
make lint && make type-check(backend) andvp staged(frontend). (targeted checks above; no frontend changes)From Codex