Skip to content

fix: avoid doctor false negatives from slow mcporter checks#103

Merged
Panniantong merged 1 commit intoPanniantong:mainfrom
Citrus086:codex/fix-doctor-mcporter-health-checks
Mar 8, 2026
Merged

fix: avoid doctor false negatives from slow mcporter checks#103
Panniantong merged 1 commit intoPanniantong:mainfrom
Citrus086:codex/fix-doctor-mcporter-health-checks

Conversation

@Citrus086
Copy link
Contributor

Summary

  • replace mcporter list config detection for Boss直聘 and 小红书 with targeted mcporter config get ... --json
  • use stable health checks instead of slow or flaky tool calls so doctor does not report false negatives on busy MCP setups
  • add regression tests for both channels and make tests/test_doctor.py deterministic by stubbing channel results

Why

On machines with many MCP servers, mcporter list can 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

Copy link

@marrow-bot marrow-bot left a comment

Choose a reason for hiding this comment

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

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:

  1. 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 of mcporter config get bosszhipin --json when configured vs unconfigured.

  2. 小红书 health check — switching to mcporter list xiaohongshu --json and checking '"status": "ok"' in out is a nice improvement over the old login status call.

  3. Tests — adding deterministic stubs in test_doctor.py is 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

@marrow-bot
Copy link

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)

@marrow-bot
Copy link

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.

@marrow-bot
Copy link

已查看,这个修复方向合理:用更有针对性的 mcporter 配置/健康检查替代慢且易误报的探测,可以明显降低 doctor 的 false negative。测试也补得比较到位。若 CI 已绿,我这边没有额外阻塞意见。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants