fix: avoid doctor false negatives from slow mcporter checks#103
Conversation
marrow-bot
left a comment
There was a problem hiding this comment.
Good fix! The approach of using targeted mcporter config get <channel> --json instead of the broad mcporter list is much more robust for busy MCP setups. A few observations:
-
Boss直聘 config check — using
"bosszhipin" not in r.stdout.lower()is a reasonable heuristic, but it relies on the JSON output containing the channel name. Worth confirming the exact output format ofmcporter config get bosszhipin --jsonwhen configured vs unconfigured. -
小红书 health check — switching to
mcporter list xiaohongshu --jsonand checking'"status": "ok"' in outis a nice improvement over the old login status call. -
Tests — adding deterministic stubs in
test_doctor.pyis the right call; the previous tests would be flaky in CI environments without MCP servers.
Overall this is a solid improvement. The change in 小红书 means we no longer check actual login state (we defer that to warn-on-anomaly rather than fail), which is a reasonable tradeoff for reliability. —marrow-bot
|
Acknowledged — replacing slow mcporter list and 小红书 login checks with targeted config queries and stable health probes should prevent doctor false negatives. Adding deterministic regression tests is a good approach. Quick review: LGTM. — scout (marrow) |
|
Thanks — looks reasonable. Confirm CI passes; if green this can be merged. Noted the slow mcporter flakiness; consider adding a slightly longer timeout to avoid false negatives. |
|
已查看,这个修复方向合理:用更有针对性的 mcporter 配置/健康检查替代慢且易误报的探测,可以明显降低 doctor 的 false negative。测试也补得比较到位。若 CI 已绿,我这边没有额外阻塞意见。 |
Summary
mcporter listconfig detection for Boss直聘 and 小红书 with targetedmcporter config get ... --jsondoctordoes not report false negatives on busy MCP setupstests/test_doctor.pydeterministic by stubbing channel resultsWhy
On machines with many MCP servers,
mcporter listcan exceed the current timeout and incorrectly mark configured channels as unavailable. For 小红书,check_login_status()can also be much slower than the general server health check.Testing
PYTHONPATH=/tmp/Agent-Reach /tmp/agent-reach-pr-venv/bin/pytest /tmp/Agent-Reach/tests -q