feat(tools): add read-only TaskMarket discovery tools - #6874
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 (6)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughSummaryThis change adds read-only TaskMarket search and task retrieval tools. It validates inputs, performs bounded GET requests, normalizes task data, exports the tools through CrewAI, adds tests, and documents agent usage. ChangesTaskMarket discovery
Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Agent
participant TaskMarketTools
participant TaskMarketAPI
Agent->>TaskMarketTools: Submit search or task retrieval input
TaskMarketTools->>TaskMarketAPI: Send validated GET request
TaskMarketAPI-->>TaskMarketTools: Return task JSON
TaskMarketTools-->>Agent: Return normalized task data
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/crewai-tools/README.md`:
- Around line 41-48: Add the missing `from crewai import Agent` import to the
README example before the `Agent` construction, while preserving the existing
`crewai_tools` imports and example usage.
- Line 246: Replace the mojibake sequence “—” in the README’s closing sentence
with the proper em dash character “—”, preserving the surrounding text.
In `@lib/crewai-tools/src/crewai_tools/__init__.py`:
- Line 211: Update the public __all__ lists in
lib/crewai-tools/src/crewai_tools/__init__.py (lines 211-211) and
lib/crewai-tools/src/crewai_tools/tools/__init__.py (lines 198-198) to include
both TaskMarketGetTaskTool and TaskMarketSearchTool, preserving their existing
imports and making them available through wildcard imports.
In `@lib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/taskmarket_tool.py`:
- Around line 133-145: In the task result processing flow, slice rows to
args.limit before the for loop so _public_row only processes and returns at most
the requested number of entries, while preserving existing filtering. Add a
behavior-focused unit test covering a response with more qualifying rows than
limit and assert the result is capped at that limit.
- Around line 159-162: Update _run to reject task_id values "." and "..", then
URL-encode the validated ID with urllib.parse.quote(task_id, safe="") before
interpolating it into the tasks/{id} request path. Preserve the existing
non-empty and literal separator validation, and add tests covering query,
fragment, and encoded-separator inputs.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b31b132d-da3f-4c0c-9653-1269e8ad37e4
📒 Files selected for processing (6)
lib/crewai-tools/README.mdlib/crewai-tools/src/crewai_tools/__init__.pylib/crewai-tools/src/crewai_tools/tools/__init__.pylib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/__init__.pylib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/taskmarket_tool.pylib/crewai-tools/tests/tools/taskmarket_tool_test.py
Summary
Safety
These tools use only public GET endpoints. They do not claim tasks, submit artifacts, sign wallet messages, access credentials, or move funds.
Validation
The new modules compile with Python 3. The tests are isolated from the network and use a fake HTTP response.