Skip to content

feat(tools): add read-only TaskMarket discovery tools - #6874

Open
cldgsu8-max wants to merge 7 commits into
crewAIInc:mainfrom
cldgsu8-max:main
Open

feat(tools): add read-only TaskMarket discovery tools#6874
cldgsu8-max wants to merge 7 commits into
crewAIInc:mainfrom
cldgsu8-max:main

Conversation

@cldgsu8-max

Copy link
Copy Markdown

Summary

  • add TaskMarketSearchTool for bounded discovery of open public jobs
  • add TaskMarketGetTaskTool for read-only task details
  • normalize TaskMarket USDC base-unit rewards and document the wallet/signing boundary
  • add mocked tests for filtering, reward normalization, and path traversal rejection

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.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ca109bd-8920-4581-97d0-890444490e62

📥 Commits

Reviewing files that changed from the base of the PR and between 2f489f9 and c7508f4.

📒 Files selected for processing (6)
  • lib/crewai-tools/README.md
  • lib/crewai-tools/src/crewai_tools/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/taskmarket_tool.py
  • lib/crewai-tools/tests/tools/taskmarket_tool_test.py
💤 Files with no reviewable changes (1)
  • lib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/init.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • lib/crewai-tools/README.md
  • lib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/taskmarket_tool.py

📝 Walkthrough

Walkthrough

Summary

This 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.

Changes

TaskMarket discovery

Layer / File(s) Summary
Read-only tools, validation, and tests
lib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/taskmarket_tool.py, lib/crewai-tools/tests/tools/taskmarket_tool_test.py
Adds validated search and retrieval inputs, GET-based HTTP helpers, reward normalization, task filtering, error handling, and tests for read-only access and opaque task IDs.
Public package exports
lib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/__init__.py, lib/crewai-tools/src/crewai_tools/__init__.py, lib/crewai-tools/src/crewai_tools/tools/__init__.py
Exports TaskMarketSearchTool and TaskMarketGetTaskTool from the TaskMarket package and imports them into the main package namespaces.
README usage documentation
lib/crewai-tools/README.md
Documents read-only TaskMarket discovery, agent configuration, and prohibited write operations.

Suggested reviewers: lorenzejay

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the addition of read-only TaskMarket discovery tools.
Description check ✅ Passed The description accurately covers the new tools, safety boundaries, reward normalization, tests, and validation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 92012ae and 2f489f9.

📒 Files selected for processing (6)
  • lib/crewai-tools/README.md
  • lib/crewai-tools/src/crewai_tools/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/taskmarket_tool.py
  • lib/crewai-tools/tests/tools/taskmarket_tool_test.py

Comment thread lib/crewai-tools/README.md
Comment thread lib/crewai-tools/README.md Outdated
Comment thread lib/crewai-tools/src/crewai_tools/__init__.py
Comment thread lib/crewai-tools/src/crewai_tools/tools/taskmarket_tool/taskmarket_tool.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant