Lorenze Jay
f53bdb28ac
feat: implement before and after tool call hooks in CrewAgentExecutor… ( #4287 )
...
* feat: implement before and after tool call hooks in CrewAgentExecutor and AgentExecutor
- Added support for before and after tool call hooks in both CrewAgentExecutor and AgentExecutor classes.
- Introduced ToolCallHookContext to manage context for hooks, allowing for enhanced control over tool execution.
- Implemented logic to block tool execution based on before hooks and to modify results based on after hooks.
- Added integration tests to validate the functionality of the new hooks, ensuring they work as expected in various scenarios.
- Enhanced the overall flexibility and extensibility of tool interactions within the CrewAI framework.
* Potential fix for pull request finding 'Unused local variable'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Potential fix for pull request finding 'Unused local variable'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* test: add integration test for before hook blocking tool execution in Crew
- Implemented a new test to verify that the before hook can successfully block the execution of a tool within a crew.
- The test checks that the tool is not executed when the before hook returns False, ensuring proper control over tool interactions.
- Enhanced the validation of hook calls to confirm that both before and after hooks are triggered appropriately, even when execution is blocked.
- This addition strengthens the testing coverage for tool call hooks in the CrewAI framework.
* drop unused
* refactor(tests): remove OPENAI_API_KEY check from tool hook tests
- Eliminated the check for the OPENAI_API_KEY environment variable in the test cases for tool hooks.
- This change simplifies the test setup and allows for running tests without requiring the API key to be set, improving test accessibility and flexibility.
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-01-27 14:56:50 -08:00
..
2026-01-07 11:36:36 -05:00
2026-01-23 15:13:25 -05:00
2026-01-21 11:12:10 -05:00
2026-01-23 15:13:25 -05:00
2026-01-27 14:56:50 -08:00
2025-12-10 20:32:10 -05:00
2026-01-26 11:03:33 -08:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-26 14:55:03 -08:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2026-01-22 17:44:03 -08:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2026-01-22 17:44:03 -08:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-22 17:44:03 -08:00
2025-10-20 14:10:19 -07:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-22 17:44:03 -08:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -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
2025-10-20 14:10:19 -07:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-22 17:44:03 -08:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-22 17:44:03 -08:00
2026-01-22 17:44:03 -08:00
2026-01-22 17:44:03 -08:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-10-20 14:10:19 -07:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2025-10-21 13:48:21 -04:00
2025-10-21 13:48:21 -04:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2026-01-20 21:44:45 -08:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-22 17:44:03 -08:00
2025-12-10 20:32:10 -05:00
2026-01-22 17:44:03 -08:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2026-01-22 17:44:03 -08:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2025-10-21 13:48:21 -04:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2025-10-21 13:48:21 -04:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-20 21:44:45 -08:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2026-01-23 15:13:25 -05:00
2025-10-21 13:48:21 -04:00
2026-01-22 17:44:03 -08:00
2026-01-22 17:44:03 -08:00
2026-01-22 17:44:03 -08:00
2026-01-22 17:44:03 -08:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-07 10:42:27 -08:00
2026-01-07 10:42:27 -08:00
2026-01-07 10:42:27 -08:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2026-01-23 15:13:25 -05:00
2025-12-10 20:32:10 -05:00
2025-12-10 20:32:10 -05:00
2025-11-24 15:43:48 -05:00
2025-11-24 15:43:48 -05:00
2025-11-24 15:43:48 -05:00
2025-11-24 15:43:48 -05:00
2025-11-24 15:43:48 -05:00
2025-11-24 15:43:48 -05:00
2025-11-24 15:43:48 -05:00