Refs #576: Reject control chars in MCP clean filters#612
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)
📝 WalkthroughWalkthroughMCP tool input validation now rejects control characters. The ChangesControl character validation in MCP tools
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 |
barnacleagent-svg
left a comment
There was a problem hiding this comment.
Verdict: APPROVED
Scope: Rejects control characters in MCP clean filters. Uses existing CONTROL_CHAR_RE pattern. Consistent with prior validation PRs.
Checklist:
- Focused validation addition
- Uses established patterns
- CI passing
Conclusion: Clean input validation. Ready to merge.
eliasx45
left a comment
There was a problem hiding this comment.
Reviewed current head 0991b4483df4b35875b4c813c5369f59bd62ac08 for Refs #576.
Verdict: approve.
The PR is focused on MCP tool argument handling and uses the same established CONTROL_CHAR_RE validation before trimming optional string fields. That closes the path where raw tab/newline/carriage-return input could normalize into an accepted status, sort, q, or repo selector. The tests cover both list_bounties filters and submit_work_proof repo selection, and the change does not overlap the separate public/admin route validation PRs.
Validation on this checkout:
git diff --check origin/main...HEAD
# clean
git merge-tree --write-tree origin/main HEAD
# 9524e49edac32e65ef555b8af40942f8d5268b34
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ..\mergework\.venv\Scripts\python.exe -m pytest tests\test_mcp_tools.py -q
# 9 passed
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ..\mergework\.venv\Scripts\python.exe -m pytest tests\test_mcp_tools.py tests\test_api_mcp.py -q
# 91 passed
..\mergework\.venv\Scripts\python.exe -m ruff check app\mcp_tools.py tests\test_mcp_tools.py
# passed
..\mergework\.venv\Scripts\python.exe -m ruff format --check app\mcp_tools.py tests\test_mcp_tools.py
# 2 files already formatted
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ..\mergework\.venv\Scripts\python.exe -m mypy app\mcp_tools.py
# success
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ..\mergework\.venv\Scripts\python.exe scripts\docs_smoke.py
# docs smoke ok
GitHub readback: PR is open/non-draft, merge state is clean, project CI is green, and CodeRabbit has no actionable comments.
Summary
list_bountiesstatus/sort/qfilters andsubmit_work_proofrepo selector regressionsDistinctness
/wallets?q=...), PR Refs #576: Reject control chars in wallet type filters #609 (/wallets/{address}?type=...), PR Refs #576: Reject control chars in account transaction filters #610 (/accounts/{account}?tx_type=...), or public route/query validation workValidation
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_mcp_tools.py -q-> 9 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_mcp_tools.py tests/test_api_mcp.py -q-> 91 passed, 1 warningPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest -q-> 486 passed, 1 warninguv run --extra dev ruff check app/mcp_tools.py tests/test_mcp_tools.py-> passeduv run --extra dev ruff format --check app/mcp_tools.py tests/test_mcp_tools.py-> 2 files already formatteduv run --extra dev mypy app/mcp_tools.py-> successPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py-> docs smoke okgit diff --check-> cleanNo private data, wallet material, tokens, signatures, live mutations, admin access, price/liquidity/exchange/bridge/off-ramp claims, or fabricated payout claims were used.
Summary by CodeRabbit
Bug Fixes
Tests