fix(tasks): preserve empty task json outputs#5838
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR updates TaskOutput serialization methods to use explicit ChangesTaskOutput empty-value handling
🎯 1 (Trivial) | ⏱️ ~3 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
TaskOutput.json_dictwhen converting task output to a dict{}instead of falling back to raw textValidation
uv run pytest lib/crewai/tests/test_task.py::test_task_output_str_with_json_dict lib/crewai/tests/test_task.py::test_task_output_str_with_empty_json_dict lib/crewai/tests/test_task.py::test_task_output_to_dict_prefers_empty_json_dict lib/crewai/tests/test_task.py::test_task_output_str_with_pydantic_and_json_dict -quv run ruff check lib/crewai/src/crewai/tasks/task_output.py lib/crewai/tests/test_task.pyContributor Note
This PR was authored with an AI coding assistant. The repository requires the
llm-generatedlabel for AI-authored contributions, but GitHub rejected applying that label from this fork withAddLabelsToLabelablepermission denied.Summary by CodeRabbit
Bug Fixes
Tests