Add MCP bounty award details#289
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)❌ Error creating Unit Test PR.
Comment 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 |
|
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. |
|
❌ Failed to create PR with unit tests: AGENT_CHAT: Failed to open pull request |
TateLyman
left a comment
There was a problem hiding this comment.
Reviewed the MCP bounty award details change. I do not see blockers.
What I checked:
tools/listnow advertisesget_bountycan include accepted awards.- Default
get_bountybehavior remains unchanged and does not includeawardsunless requested. include_awards: trueadds 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_awardsvalues 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.
Karry2019web
left a comment
There was a problem hiding this comment.
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_bountyMCP tool now accepts optionalinclude_awardsboolean flag. When true, includesbounty_awards_to_dictresult asawardskey.- Default behavior unchanged when
include_awardsomitted — backward compatible.
TESTS VERIFIED:
test_mcp_tools_list_and_callupdated 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 noawardskey, then verifies withinclude_awards=Truereturns 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.
Summary
include_awardsflag to the MCPget_bountytool.get_bountyresponse unchanged unless an agent explicitly asks for award details.include_awardsvalues 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
Summary by CodeRabbit
New Features
get_bountytool now supports an optional parameter to include accepted awards in the response, enabling retrieval of award and proof details when requested.Tests