fix: hit-testing response failed because of Pydantic check.#35640
Merged
fix: hit-testing response failed because of Pydantic check.#35640
Conversation
…m service including remote template service and database, return responding error message.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…m service including remote template service and database, return responding error message.
# Conflicts: # api/services/rag_pipeline/pipeline_template/remote/remote_retrieval.py
…he weaviate vector database.
# Conflicts: # api/providers/vdb/vdb-weaviate/src/dify_vdb_weaviate/weaviate_vector.py
Contributor
Pyrefly Type Coverage
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #35640 +/- ##
==========================================
- Coverage 85.69% 85.68% -0.01%
==========================================
Files 4459 4459
Lines 208961 208991 +30
Branches 39068 39078 +10
==========================================
+ Hits 179061 179078 +17
- Misses 26743 26748 +5
- Partials 3157 3165 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
crazywoola
approved these changes
Apr 28, 2026
|
For workflow execution timeout issues: The default timeout for workflow execution is often too short. Increase it in the configuration: # docker-compose.yaml
services:
api:
environment:
WORKFLOW_EXECUTION_TIMEOUT: 3600 # 1 hour instead of default 5 minutesAlso implement async timeout handling: import asyncio
async def run_workflow(workflow_id, inputs, timeout=3600):
try:
result = await asyncio.wait_for(
execute_workflow(workflow_id, inputs),
timeout=timeout
)
return result
except asyncio.TimeoutError:
# Save partial state and return error
partial_state = await save_partial_state(workflow_id)
return {"error": "timeout", "partial_state": partial_state} |
|
For the workflow node timeout: class WorkflowNode:
timeout: int = 300
async def execute(self, inputs):
try:
return await asyncio.wait_for(
self._run(inputs), timeout=self.timeout
)
except asyncio.TimeoutError:
return {'status': 'timeout', 'node': self.name} |
fatelei
pushed a commit
that referenced
this pull request
Apr 29, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Important
Fixes #<issue number>.Summary
This PR fixes a 400 invalid_param regression in the dataset hit-testing API introduced after the response layer was tightened with Pydantic validation. The underlying retrieval flow could still return the legacy query={"content": ...} shape, and some optional collection fields such as segment.keywords, child_chunks, and files could be None, which no longer matched the current response schema expecting a str and concrete list values.
The change adds a small compatibility normalization step in the shared DatasetsHitTestingBase response path without altering retrieval behavior, ranking, scoring, or filtering. It converts the legacy query object into a plain string and normalizes nullable collection fields to empty lists before response validation. Targeted tests were also added to cover the legacy query shape and nullable list field cases, ensuring both console and service API hit-testing endpoints return schema-compliant responses consistently.
Screenshots
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods