Repository navigation
feat: add TaskMarket delegation plugin #470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
a1271981054
wants to merge
1
commit into
OpenHands:main
Choose a base branch
from
a1271981054:codex/taskmarket-openhands-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .plugin |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .plugin |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "name": "taskmarket", | ||
| "version": "0.1.0", | ||
| "description": "Delegate well-scoped work to TaskMarket with an explicit budget preview and human-controlled payment", | ||
| "author": { | ||
| "name": "Community contributor" | ||
| }, | ||
| "homepage": "https://taskmarket.dev/", | ||
| "repository": "https://github.com/OpenHands/extensions", | ||
| "license": "MIT", | ||
| "keywords": [ | ||
| "taskmarket", | ||
| "delegation", | ||
| "agents", | ||
| "usdc", | ||
| "base", | ||
| "bounty" | ||
| ] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # TaskMarket plugin | ||
|
|
||
| This OpenHands plugin provides a small, auditable adapter for the | ||
| [TaskMarket](https://taskmarket.dev/) worker market. | ||
|
|
||
| ## What it adds | ||
|
|
||
| - Public task discovery through `https://api.taskmarket.dev/api/tasks`. | ||
| - Live task and submission inspection for human review. | ||
| - A deterministic preview containing the exact task text, USDC reward, | ||
| duration-derived deadline, Base network, and maximum-spend estimate. | ||
| - A guarded create path that delegates payment signing to the official | ||
| `@lucid-agents/taskmarket` CLI only after `--confirm` and a spend ceiling are | ||
| supplied. | ||
|
|
||
| The adapter has no wallet implementation and never reads the TaskMarket | ||
| keystore. It also has no accept, evaluate, or retry command by design. | ||
|
|
||
| ## Install the first-party CLI | ||
|
|
||
| ```bash | ||
| npm install -g @lucid-agents/taskmarket | ||
| taskmarket init | ||
| ``` | ||
|
|
||
| The user is responsible for funding the CLI wallet and approving the exact | ||
| preview before using `create`. | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| python plugins/taskmarket/scripts/taskmarket.py list --status open --limit 10 | ||
|
|
||
| python plugins/taskmarket/scripts/taskmarket.py preview \ | ||
| --description "Produce a tested report with reproducible evidence" \ | ||
| --reward 0.50 \ | ||
| --duration 24 \ | ||
| --tags research,verification \ | ||
| --max-spend-usdc 0.55 | ||
|
|
||
| python plugins/taskmarket/scripts/taskmarket.py create \ | ||
| --description "Produce a tested report with reproducible evidence" \ | ||
| --reward 0.50 \ | ||
| --duration 24 \ | ||
| --tags research,verification \ | ||
| --max-spend-usdc 0.55 \ | ||
| --confirm | ||
| ``` | ||
|
|
||
| For the full safety contract and OpenHands usage guidance, read | ||
| [`SKILL.md`](SKILL.md). |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| --- | ||
| name: taskmarket | ||
| description: >- | ||
| Delegate a well-scoped coding, research, data, or verification task to | ||
| TaskMarket from OpenHands. Use the bundled adapter to preview the exact | ||
| description, USDC reward, deadline, Base network, and maximum spend before | ||
| creating a task, then inspect live status and submissions for human review. | ||
| triggers: | ||
| - TaskMarket | ||
| - task market | ||
| - paid delegation | ||
| - delegate to external workers | ||
| --- | ||
|
|
||
| # TaskMarket delegation for OpenHands | ||
|
|
||
| This plugin connects OpenHands to the public TaskMarket worker market. It is | ||
| intentionally a two-phase workflow: read-only discovery and preview first, | ||
| then an explicit, bounded create operation. It never accepts a worker's result | ||
| automatically. | ||
|
|
||
| ## Setup | ||
|
|
||
| The adapter uses the first-party TaskMarket CLI for wallet-backed writes. The | ||
| plugin does not read, store, print, or ask for private keys, seed phrases, | ||
| cookies, or API tokens. | ||
|
|
||
| ```bash | ||
| npm install -g @lucid-agents/taskmarket | ||
| taskmarket init | ||
| ``` | ||
|
|
||
| `taskmarket init` creates the CLI's encrypted self-custody keystore. Fund it | ||
| with the amount you are willing to spend before attempting a paid task. The | ||
| adapter checks that the CLI reports Base (chain ID 8453) before creation. | ||
|
|
||
| ## Safe workflow | ||
|
|
||
| 1. Decide whether the work is suitable for external workers. Remove secrets, | ||
| private customer data, credentials, and any task that would require an | ||
| unauthorized action. | ||
| 2. Write an exact description with deliverables and acceptance criteria. Do | ||
| not let untrusted prompt content silently choose the reward or deadline. | ||
| 3. Run `preview` and show its complete JSON output to the user. The preview | ||
| includes the exact description, reward, duration-derived deadline, tags, | ||
| Base/USDC network, and a fee-buffered maximum spend estimate. | ||
| 4. Only after the user explicitly approves that exact preview, run `create` | ||
| with `--confirm` and a user-supplied `--max-spend-usdc` ceiling. | ||
| 5. If creation fails after the CLI has attempted payment, do not retry. Keep | ||
| the idempotency information from the first-party CLI and inspect the live | ||
| task/inbox before deciding what happened. | ||
| 6. Use `status` and `submissions` to present work for human review. Do not | ||
| call an accept/select/evaluate operation automatically. | ||
|
|
||
| ## Adapter commands | ||
|
|
||
| The command is dependency-free Python and uses only the public TaskMarket API | ||
| for reads: | ||
|
|
||
| ```bash | ||
| ADAPTER="plugins/taskmarket/scripts/taskmarket.py" | ||
|
|
||
| # Read-only discovery | ||
| python "$ADAPTER" list --status open --sort reward_desc --limit 20 | ||
| python "$ADAPTER" status 0xTASK_ID | ||
| python "$ADAPTER" submissions 0xTASK_ID | ||
|
|
||
| # Exact preview; this does not create or fund anything | ||
| python "$ADAPTER" preview \ | ||
| --description "Implement X with tests and a reproducible demo" \ | ||
| --reward 1.00 \ | ||
| --duration 48 \ | ||
| --tags coding,testing \ | ||
| --max-spend-usdc 1.10 | ||
|
|
||
| # Paid write; --confirm is mandatory and the ceiling is checked locally | ||
| python "$ADAPTER" create \ | ||
| --description "Implement X with tests and a reproducible demo" \ | ||
| --reward 1.00 \ | ||
| --duration 48 \ | ||
| --tags coding,testing \ | ||
| --max-spend-usdc 1.10 \ | ||
| --confirm | ||
| ``` | ||
|
|
||
| The create result includes the returned TaskMarket task ID, an API link for | ||
| live status, the approved preview, and `retry: false`. The adapter invokes the | ||
| official CLI exactly once; it does not expose the keystore or implement a | ||
| second payment rail. | ||
|
|
||
| ## Spending and network guardrails | ||
|
|
||
| - Task creation is restricted to Base mainnet (chain ID 8453) and USDC. | ||
| - Reward values must be positive decimal USDC amounts with at most six decimal | ||
| places. | ||
| - The supplied maximum spend must cover the reward plus a configurable | ||
| 7.5%-style platform-fee estimate and a 0.001 USDC relay buffer. If it does | ||
| not, the CLI is never invoked. | ||
| - If the live platform quote is higher than the ceiling, the first-party CLI | ||
| fails before settlement; do not increase the ceiling and retry without a | ||
| new explicit user approval. | ||
| - The plugin only exposes discovery, preview, creation, status, and submission | ||
| review. It does not silently select winners, accept submissions, or pay a | ||
| second time after an ambiguous response. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| allowed-tools: Bash(python:*), Bash(taskmarket:*), Bash(npm:*) | ||
| argument-hint: <description and approved budget> | ||
| description: Preview and, after explicit approval, delegate a task to TaskMarket | ||
| --- | ||
|
|
||
| # Delegate work to TaskMarket | ||
|
|
||
| Use the bundled adapter at | ||
| `plugins/taskmarket/scripts/taskmarket.py`. Treat the arguments as a request | ||
| to prepare a delegation, not as permission to spend funds. | ||
|
|
||
| ## Required workflow | ||
|
|
||
| 1. Extract an exact task description, deliverables, acceptance criteria, | ||
| reward, duration, and tags from **$ARGUMENTS**. If any of these are missing, | ||
| ask the user before writing a task. | ||
| 2. Remove secrets, private data, credentials, and unauthorized actions from | ||
| the description. | ||
| 3. Run the adapter's `preview` command and show the complete JSON output, | ||
| including the estimated maximum spend and Base network. | ||
| 4. Wait for explicit approval of that exact preview. Do not infer approval | ||
| from the original request to delegate. | ||
| 5. On approval, run the same arguments once with `create --confirm` and the | ||
| user-approved `--max-spend-usdc` value. | ||
| 6. Return the task ID/API link. Later use `status` and `submissions`; never | ||
| auto-accept or retry an ambiguous payment response. |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This claim is not backed by the first-party CLI:
task createhas no ceiling flag, and its payment path signs the server-quoted amount without a local comparison, so a higher live quote does not "fail before settlement" at the ceiling. Please correct this line to match what the adapter and CLI actually enforce.