feat: 新增 Boss直聘 channel(岗位搜索 + JD 全文) - #627
Open
iqjiy wants to merge 4 commits into
Open
Conversation
- 新增 boss channel:经 boss-agent-cli + CDP 真 Chrome 搜岗位、取 JD 全文。 check() 三层只读探测(装没装 → 9222 端口 → 有无 zhipin 页签),无副作用、 不搜索、不拉起浏览器。 - 抓取走 boss-agent-cli 公开 API(search_jobs + job_card_browser + browser_mode="cdp_required"),不依赖私有降级链。 - 文档:平台数 15→16(SKILL.md / SKILL_en.md / README / CHANGELOG), career.md 加 Boss直聘 抓取姿势 + 环境体检恢复 runbook。 - 测试:test_boss_channel.py 7 个测试,契约测试自动覆盖。 Co-Authored-By: Claude <noreply@anthropic.com>
判断登录态只信 boss status(wt2/__zp_stoken__),不再用当前页 URL 推断。security-check / zhipin-security / _security_check 是 Boss 反爬挑战,与登录无关,已登录也会出现(带 CDP 调试端口的 Chrome 几乎必现)。 - channels/boss.py:check() 新增「页签都停在安全校验页」分支,返回明确 warn 提示「反爬挑战、不代表未登录、先跑 boss status」,不再笼统报「链路就绪」。 - skill/SKILL.md + references/career.md:拆开「登录/扫码」与「处理安全校验滑块」,新增「登录门槛 ≠ 反爬安全校验」三态说明。 - tests:新增 test_check_warn_when_stuck_on_security_check。 Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
动机
新增 Boss直聘(zhipin.com)的岗位搜索 + JD 全文能力,并让用户像配置其他平台一样直接告诉 Agent「帮我配 Boss直聘」,无需自己研究 9222/CDP 参数。
改动
bosschannelcheck()只读探测 boss-agent-cli、CDP 端口和 zhipin 页签,不搜索、不拉起浏览器。127.0.0.1,并提示 9222 可完全控制浏览器的安全边界。Agent 驱动的配置流程
agent-reach install --env=local --system --channels=boss,并纳入--channels=all。boss --cdp-url http://localhost:9222 login --cdp,再以boss status和agent-reach doctor验收;用户只负责手动登录、扫码或处理滑块。严格 CDP 抓取
BossClient(..., browser_mode="cdp_required")、search_jobs()、job_card_browser()和JobItem.lid,不依赖私有接口。boss --browser-mode cdp-required --cdp-url http://localhost:9222 search ...。CDP 不可用时立即失败,禁止静默降级 headless。uv run --isolated --no-project --with ...运行 Python API 示例,避免 tool 隔离环境导致普通 Python 无法 import,也避免在用户工作区创建.venv。正确处理 code 37
环境存在异常→ENVIRONMENT_RISK,立即停止,不刷新 Token、不重新登录、不自动重试。TOKEN_REFRESH_FAILED;上游最多刷新并重试一次。临时依赖策略
所需公开 API 来自 boss-agent-cli PR #382,目前尚未合并、发布。技术上可以依赖 fork branch,但 branch 会移动、不可复现,因此安装器固定到已包含 CDP 登录态复用、错误分类和严格 CLI 的不可变提交:
ba0f12541079ad794eae4c3bf3fc348befd228c9上游发布后,只需把
_BOSS_AGENT_CLI_SOURCE替换为包含上述公开能力的正式版本约束。验证
599 passed, 16 subtests passedruff check agent_reach tests:通过mypy agent_reach:36 个源文件通过git diff --check:通过