Accept id alias for MCP attempt lookup#916
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR extends the Changesid alias support for bounty selection
Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/mcp_tools.py (1)
140-163:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winInconsistent error message when alias is rejected alongside issue_number.
The error on line 155 always references
internal_id_field("bounty_id"), even when the user provided the "id" alias. For example, if the user sends{"id": 11, "issue_number": 404}, the error says "use bounty_id or issue_number, not both" even though they never used "bounty_id".For consistency with the mixed-alias error on line 152, consider using the actual field name the user provided:
if has_internal_id and has_issue_number: - raise ValueError(f"use {internal_id_field} or issue_number, not both") + raise ValueError(f"use {provided_internal_id_fields[0]} or issue_number, not both")This matches the pattern on line 152 and makes the error message directly actionable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 971df2e7-a75c-4146-963c-dc541361fc62
📒 Files selected for processing (5)
app/mcp.pyapp/mcp_tools.pydocs/agent-guide.mddocs/api-examples.mdtests/test_api_mcp.py
|
Follow-up for CodeRabbit's selector-message note. Updated head: Change since initial claim:
Updated validation:
Scope remains read-only MCP |
szx19970521
left a comment
There was a problem hiding this comment.
Reviewed current head $head for #838.
The change is narrowly scoped to MCP bounty-attempt lookup ergonomics: list_bounty_attempts now accepts id as an alias for �ounty_id, rejects mixed �ounty_id/id selectors, and keeps the existing issue_number path separate. I checked the follow-up commit as well: CodeRabbit's earlier error-message consistency note is addressed by reporting the actual provided selector when id is combined with issue_number.
Validation performed locally on this exact head:
` ext
python -m pytest tests/test_api_mcp.py::test_mcp_tools_list_and_call tests/test_api_mcp.py::test_mcp_list_bounty_attempts_reports_active_and_expired tests/test_api_mcp.py::test_mcp_list_bounty_attempts_accepts_issue_number_selector tests/test_api_mcp.py::test_mcp_list_bounty_attempts_accepts_id_alias tests/test_api_mcp.py::test_mcp_list_bounty_attempts_rejects_invalid_arguments tests/test_api_mcp.py::test_mcp_list_bounty_attempts_rejects_mixed_id_aliases -q
6 passed, 1 existing warning
python -m pytest tests/test_api_mcp.py tests/test_mcp_tools.py tests/test_docs_public_urls.py -q
150 passed, 1 existing warning
python -m ruff check app/mcp_tools.py app/mcp.py tests/test_api_mcp.py docs/api-examples.md docs/agent-guide.md
All checks passed
python -m ruff format --check app/mcp_tools.py app/mcp.py tests/test_api_mcp.py
3 files already formatted
python -m mypy app/mcp_tools.py app/mcp.py
Success: no issues found in 2 source files
python scripts/docs_smoke.py
docs smoke ok
`
I also rechecked hosted status before approval: mergeable clean, Quality/readiness/docs/image check success, and CodeRabbit success. No blocker found.
Bounty #844
Summary
list_bounty_attemptsacceptidas an alias for the existing internalbounty_idselector;bounty_id+idselectors to keep internal bounty lookup unambiguous;tools/listwording and agent/API docs so agents can reuse theidfield returned bylist_bountiesorget_bountybefore opening overlapping work.Duplicate / Scope Check
get_bounty; it coverslist_bounty_attemptsselector usability.tools/listinput schema work.Validation
uv run --python 3.12 --extra dev python -m pytest tests/test_api_mcp.py::test_mcp_tools_list_and_call tests/test_api_mcp.py::test_mcp_list_bounty_attempts_reports_active_and_expired tests/test_api_mcp.py::test_mcp_list_bounty_attempts_accepts_issue_number_selector tests/test_api_mcp.py::test_mcp_list_bounty_attempts_accepts_id_alias tests/test_api_mcp.py::test_mcp_list_bounty_attempts_rejects_invalid_arguments tests/test_api_mcp.py::test_mcp_list_bounty_attempts_rejects_mixed_id_aliases -q-> 6 passed, 1 existing warning.uv run --python 3.12 --extra dev python -m pytest tests/test_api_mcp.py tests/test_mcp_tools.py tests/test_docs_public_urls.py -q-> 149 passed, 1 existing warning.uv run --python 3.12 --extra dev ruff check app/mcp_tools.py app/mcp.py tests/test_api_mcp.py docs/api-examples.md docs/agent-guide.md-> passed.uv run --python 3.12 --extra dev ruff format --check app/mcp_tools.py app/mcp.py tests/test_api_mcp.py-> 3 files already formatted.uv run --python 3.12 --extra dev mypy app/mcp_tools.py app/mcp.py-> success.uv run --python 3.12 --extra dev python scripts/docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean treeabda6f4c7b8cc6d19c1ef4bc0fd2711b121cfce1.Summary by CodeRabbit
New Features
id) as an alternative tobounty_idfor selecting a bounty.issue_number.Documentation
bounty_idoridwhen listing bounty attempts.Tests
idalias acceptance and rejection of ambiguous/mixed selectors.