Skip to content

Add MCP bounty award details#289

Merged
ramimbo merged 1 commit into
ramimbo:mainfrom
g8rr5dg2p7-svg:codex/mcp-bounty-awards
May 25, 2026
Merged

Add MCP bounty award details#289
ramimbo merged 1 commit into
ramimbo:mainfrom
g8rr5dg2p7-svg:codex/mcp-bounty-awards

Conversation

@g8rr5dg2p7-svg
Copy link
Copy Markdown

@g8rr5dg2p7-svg g8rr5dg2p7-svg commented May 25, 2026

Summary

  • Bounty MRWK bounty: agent-facing MCP bounty workflow #284: Add an optional include_awards flag to the MCP get_bounty tool.
  • Keep the default get_bounty response unchanged unless an agent explicitly asks for award details.
  • When requested, include accepted-award proof hashes, proof URLs, ledger links, account, amount, submission URL, accepted-by, and created-at fields from the existing public award data.
  • Reject non-boolean include_awards values through the existing MCP invalid-arguments path.

Validation

  • PYTHONPATH=. .venv/bin/pytest tests/test_api_mcp.py::test_mcp_tools_list_and_call tests/test_api_mcp.py::test_mcp_get_bounty_can_include_accepted_awards tests/test_api_mcp.py::test_mcp_get_bounty_rejects_non_boolean_include_awards -q -> 5 passed.
  • PYTHONPATH=. .venv/bin/pytest -q -> 222 passed, 2 existing warnings.
  • .venv/bin/ruff format --check . -> passed.
  • .venv/bin/ruff check . -> passed.
  • PYTHONPATH=. .venv/bin/mypy app -> passed.
  • PYTHONPATH=. .venv/bin/python scripts/docs_smoke.py -> passed.
  • PYTHONPATH=. .venv/bin/python scripts/check_agents.py -> passed.
  • git diff --check -> passed.

Safety

  • No private keys, wallet material, deployment credentials, payout details, private vulnerability details, or price claims are included.

Summary by CodeRabbit

  • New Features

    • The get_bounty tool now supports an optional parameter to include accepted awards in the response, enabling retrieval of award and proof details when requested.
  • Tests

    • Added test coverage for the awards parameter, including validation of non-boolean input handling.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 654c453a-da5d-424f-87cb-63d5519db76e

📥 Commits

Reviewing files that changed from the base of the PR and between 1eb4c77 and 12aff5c.

📒 Files selected for processing (2)
  • app/main.py
  • tests/test_api_mcp.py
✨ Finishing Touches
🧪 Generate unit tests (beta)

❌ Error creating Unit Test PR.

  • Create PR with unit tests
  • Commit unit tests in branch codex/mcp-bounty-awards

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

Tip

CodeRabbit can use your project's `ruff` configuration to improve the quality of Python code reviews.

Add a Ruff configuration file to your project to customize how CodeRabbit runs ruff.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Note

Unit test generation is a public access feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

❌ Failed to create PR with unit tests: AGENT_CHAT: Failed to open pull request

Copy link
Copy Markdown
Contributor

@TateLyman TateLyman left a comment

Choose a reason for hiding this comment

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

Reviewed the MCP bounty award details change. I do not see blockers.

What I checked:

  • tools/list now advertises get_bounty can include accepted awards.
  • Default get_bounty behavior remains unchanged and does not include awards unless requested.
  • include_awards: true adds the same accepted-award structure exposed by the existing bounty detail API, including proof, ledger, account, amount, submission URL, accepted_by, and created_at fields.
  • Non-boolean include_awards values are rejected through the MCP invalid-arguments path.

Verification run locally on this branch:

  • uv run pytest tests/test_api_mcp.py -q -> 47 passed, 1 existing httpx deprecation warning.
  • uv run ruff check app/main.py tests/test_api_mcp.py -> passed.
  • uv run ruff format --check app/main.py tests/test_api_mcp.py -> passed.
  • git diff --check -> passed.

Hosted quality check is green.

Copy link
Copy Markdown

@Karry2019web Karry2019web left a comment

Choose a reason for hiding this comment

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

Review ✅ APPROVED

FILES INSPECTED: app/main.py, tests/test_api_mcp.py

BEHAVIOR CHECKED:

  • New optional_bool_arg() helper for MCP argument parsing with proper isinstance(bool) validation.
  • get_bounty MCP tool now accepts optional include_awards boolean flag. When true, includes bounty_awards_to_dict result as awards key.
  • Default behavior unchanged when include_awards omitted — backward compatible.

TESTS VERIFIED:

  • test_mcp_tools_list_and_call updated to assert "accepted awards" in get_bounty tool description.
  • test_mcp_get_bounty_can_include_accepted_awards — full integration: creates bounty, pays award, verifies default response has no awards key, then verifies with include_awards=True returns complete award details including proof_hash, proof_url, ledger_sequence, account, amount_mrwk, submission_url, accepted_by, created_at.
  • test_mcp_get_bounty_rejects_non_boolean_include_awards — parametrized with "true", 1, [] — all correctly return MCP invalid-arguments error.

DOCS: Tool description updated to mention optional award details.

Thorough, well-tested PR for #284.

@ramimbo ramimbo merged commit 749252b into ramimbo:main May 25, 2026
2 checks passed
@ramimbo ramimbo added mrwk:accepted Maintainer accepted for payout mrwk:paid Ledger payment recorded labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mrwk:accepted Maintainer accepted for payout mrwk:paid Ledger payment recorded

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants