fix(tools): raise tool usage error for invalid arguments#6436
fix(tools): raise tool usage error for invalid arguments#6436sjsjsjjs534 wants to merge 1 commit into
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)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughFixed ChangesToolUsageError raise fix
Related Issues: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
d336ec8 to
a6c62a5
Compare
a6c62a5 to
add5c32
Compare
|
Same one-line fix as #6486, #6512, #6511, #6499, #6495 — that is now six open PRs (this one included) independently fixing the same bare- |
Summary
ToolUsageErrorexplicitly when parsed tool arguments are not a dictionaryraise_error=Truepath so it no longer falls through to a bareraiseCloses #6430.
Tests
UV_CACHE_DIR=/private/tmp/uv-cache-crewai UV_PYTHON_INSTALL_DIR=/private/tmp/uv-python-crewai uv run pytest lib/crewai/tests/tools/test_tool_usage.py::test_original_tool_calling_raises_tool_usage_error_for_non_dict_argumentsUV_CACHE_DIR=/private/tmp/uv-cache-crewai UV_PYTHON_INSTALL_DIR=/private/tmp/uv-python-crewai uv run pytest lib/crewai/tests/tools/test_tool_usage.pyUV_CACHE_DIR=/private/tmp/uv-cache-crewai UV_PYTHON_INSTALL_DIR=/private/tmp/uv-python-crewai uv run ruff check lib/crewai/src/crewai/tools/tool_usage.py lib/crewai/tests/tools/test_tool_usage.pyUV_CACHE_DIR=/private/tmp/uv-cache-crewai UV_PYTHON_INSTALL_DIR=/private/tmp/uv-python-crewai uv run ruff format --check lib/crewai/src/crewai/tools/tool_usage.py lib/crewai/tests/tools/test_tool_usage.py