Repository navigation
Conversation
Strix Security ReviewWarning This pull request has 23 commits after the last Strix review ( ✅ No open security findings. PR summary: Fixes `CrewOutput.json` so a `CrewOutput` constructed without task outputs (the field default) raises the intended guided `ValueError` instead of an unhandled `IndexError`, by checking `tasks_output` before reading the last element. Adds one unit test covering the empty case. Review summaryReviewed the single-line change in Review 1 on this PR · Reviewed by Strix |
a25ee0b to
78b4aae
Compare
|
While rebasing onto current main, this branch conflicted with #8702, which already converted the non-JSON-format case into the guided The diff is now a one-line guard plus a regression test; |
|
Friendly ping for a review when you have a moment. All bot checks are green and the PR is mergeable; happy to adjust anything. |
…tput.json on empty tasks
78b4aae to
4fdc6e0
Compare
Related issue
Fixes #8737
Summary
CrewOutput.jsonindexedtasks_output[-1]before checking the output format, so aCrewOutputbuilt outside a kickoff (emptytasks_output, the field default) raised a bareIndexErrorinstead of the guidedValueError. This raises the intendedValueErrorwhentasks_outputis empty. (#3185 reported the same defect; its two fix attempts were closed unmerged.)Verification
New
lib/crewai/tests/test_crew_output.py::test_json_raises_value_error_when_tasks_output_is_emptyfails withIndexErroron the old code and passes now.ruff checkclean on changed files.Disclosure: this PR was produced with AI assistance (ZCode agent) and human-reviewed — please apply the
llm-generatedlabel.Additional context
None
From ZCode
Note
Low Risk
Narrow guard-clause change to error handling on an edge case; normal kickoff paths with populated tasks_output are unchanged.
Overview
CrewOutput.jsonnow treats an emptytasks_outputlist (e.g. aCrewOutputconstructed outsidekickoff) the same as a final task without JSON format: it raises the existing guidedValueErrorwith the “No JSON output found…” message instead of failing withIndexErrorontasks_output[-1].A regression test in
test_crew_output.pyasserts that accessing.jsononCrewOutput(raw="no tasks")raisesValueError, matching the intended developer-facing error.Reviewed by Cursor Bugbot for commit 4fdc6e0. Bugbot is set up for automated code reviews on this repo. Configure here.