Files
crewAI/lib/crewai/tests
Devin AI 1c59ff8b96 Fix output file writes outdated task result after guardrail execution
The output file was being written with pre-guardrail output instead of
post-guardrail output. This was because the file save logic used the
original variables (json_output, pydantic_output, result) instead of
the updated task_output object after guardrails executed.

Fixed by using task_output.json_dict, task_output.pydantic, and
task_output.raw in the file save logic for both sync (_execute_core)
and async (_aexecute_core) execution paths.

Added 5 tests to verify output file contains post-guardrail results:
- test_output_file_contains_guardrail_modified_raw_result
- test_output_file_contains_guardrail_modified_json_result
- test_output_file_contains_guardrail_modified_pydantic_result
- test_output_file_with_single_guardrail_modification
- test_output_file_with_multiple_guardrails_chained_modifications

Fixes #4156

Co-Authored-By: João <joao@crewai.com>
2025-12-29 17:37:07 +00:00
..
2025-10-20 14:10:19 -07:00
2025-12-04 16:53:19 -05:00
2025-12-04 12:54:49 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-12-04 13:34:29 -08:00
2025-12-05 13:23:26 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-12-01 18:56:56 -05:00
2025-12-04 17:08:08 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00