You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds TaskMarketToolset, a first-party Haystack Toolset for discovering and requesting external TaskMarket work from an agent workflow.
Adds read-only tools for listing tasks, retrieving task status, and reviewing submissions through the public API.
Adds a preview tool that canonicalizes the request, calculates the Base USDC maximum spend including platform and relay fees, and returns a short-lived confirmation token.
Adds a confirmation-gated create tool. It requires confirm=True, a matching preview, an application-provided approval callback, Base/USDC wallet preflight, and sufficient USDC balance.
Uses the first-party taskmarket CLI without accepting private keys, shell interpolation, automatic submission acceptance/rejection, or retries of ambiguous writes.
Adds serialization that preserves only safe read-capable configuration; runtime approval callbacks and wallet state are never serialized.
Adds user documentation and a release note.
How did you test it?
hatch run fmt
hatch run test:types
hatch run test:unit test/tools -q — 294 passed, 12 deselected
hatch -e test run python -c 'from haystack.tools import TaskMarketToolset; ...' against the live public TaskMarket API — read-only listing succeeded.
Manual taskmarket deposit and taskmarket stats output checks confirmed the Base chain, USDC contract, and balanceUsdc fields consumed by the preflight path.
Notes for the reviewer
The write path intentionally stops at an application approval callback and never handles private keys. A CLI timeout is reported as status="unknown" so callers reconcile live status before deciding whether to do anything else.
This PR was fully generated with an AI assistant. I have reviewed the changes and run the relevant tests.
Checklist
I have read the contributors guidelines and the code of conduct.
I have updated the related issue with the implementation and test evidence.
I have added unit tests and updated the docstrings.
I've used a conventional commit type for the PR title.
I have documented the code and user-facing behavior.
I have added a release note file.
I have run the repository formatter and type checks.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You have signed the CLA already but the status is still pending? Let us recheck it.
Hi @a1271981054, thanks a lot for your contribution! 🙏
We noticed that the Contributor License Agreement (CLA) check (license/cla) hasn't passed yet, so we've temporarily moved this PR to draft and paused the review assignment.
To get your PR reviewed, please sign the CLA via the link in the license/cla check below (or in the CLA bot comment). As soon as the check turns green, this PR will automatically be marked ready for review again and a reviewer will be re-assigned.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Proposed Changes
This PR adds
TaskMarketToolset, a first-party HaystackToolsetfor discovering and requesting external TaskMarket work from an agent workflow.confirm=True, a matching preview, an application-provided approval callback, Base/USDC wallet preflight, and sufficient USDC balance.taskmarketCLI without accepting private keys, shell interpolation, automatic submission acceptance/rejection, or retries of ambiguous writes.How did you test it?
hatch run fmthatch run test:typeshatch run test:unit test/tools -q— 294 passed, 12 deselectedhatch -e test run python -c 'from haystack.tools import TaskMarketToolset; ...'against the live public TaskMarket API — read-only listing succeeded.taskmarket depositandtaskmarket statsoutput checks confirmed the Base chain, USDC contract, andbalanceUsdcfields consumed by the preflight path.Notes for the reviewer
The write path intentionally stops at an application approval callback and never handles private keys. A CLI timeout is reported as
status="unknown"so callers reconcile live status before deciding whether to do anything else.This PR was fully generated with an AI assistant. I have reviewed the changes and run the relevant tests.
Checklist