fix(recruiter): make greet actually greet — call real chat/start, support custom first message#29
Open
chengyixu wants to merge 13 commits into
Open
fix(recruiter): make greet actually greet — call real chat/start, support custom first message#29chengyixu wants to merge 13 commits into
greet actually greet — call real chat/start, support custom first message#29chengyixu wants to merge 13 commits into
Conversation
Adds employer-side functionality for BOSS直聘 recruiters: - `boss recruiter-jobs` — list posted jobs - `boss recruiter-inbox` — view candidate chat list with last messages - `boss recruiter-geek <id>` — view detailed candidate profile - `boss recruiter-chat <friendId>` — view chat history with candidate - `boss recruiter-labels` — list candidate tags - `boss recruiter-export` — export candidates to CSV/JSON All commands support --json/--yaml structured output and follow the existing CLI patterns (rate limiting, session handling, rich tables). Closes jackwener#10 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add usage examples, workflow guide, and Chinese docs for the 6 new recruiter commands. Update project structure and badges. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…group Restructure recruiter commands from 6 flat commands to a proper Click subcommand group with 12 commands matching issue jackwener#10 spec: New commands: - `boss recruiter search` — search candidates with city/exp/degree/salary - `boss recruiter recommend` — recommended candidates (greetRecSortList) - `boss recruiter greet` — initiate conversation with candidate - `boss recruiter batch-greet` — batch greet with --dry-run support - `boss recruiter reply` — send message to candidate (with confirmation) - `boss recruiter resume` — full resume view (work, education, projects) Preserved from v1: - `boss recruiter jobs/inbox/geek/chat/labels/export` New BossClient methods: search_geeks, get_boss_recommend_geeks, get_boss_view_geek, boss_send_message. Resume auto-fetches securityId from friend list when not provided. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add -p/--page to recommend and inbox commands for scrolling - Add --job filter to recommend for switching between 岗位 - Add resume-download command: exports resume as Markdown file - Add job-close/job-reopen commands for job lifecycle management - Add pagination hints and job switching hints to command output - get_boss_friend_list now accepts page parameter 15 total commands under `boss recruiter` subgroup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ume download Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e-interview, mark-unsuitable 5 new commands matching BOSS直聘 recruiter chat page actions: - `boss recruiter request-resume` — 求简历 - `boss recruiter exchange-phone` — 换电话 - `boss recruiter exchange-wechat` — 换微信 - `boss recruiter invite-interview` — 约面试 - `boss recruiter mark-unsuitable` — 不合适 All require --yes or confirmation prompt. Include __zp_stoken__ hint when anti-bot protection blocks the action. 20 total commands under `boss recruiter`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ected endpoints - Add X-Requested-With and zp_token (from bst cookie) to all requests - Handle code 121/122 (warlock anti-bot) with clear error message - Protected actions (exchange, interview, mark) now explain the limitation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The recommend (greetRecSortList) and inbox (filterByLabel) APIs return ALL results in a single call — the page parameter is ignored server-side. Replace -p/--page with -n/--limit for client-side display limiting. Update hints to show label filtering and job switching instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… 404 gracefully - boss_interview_invite now sends JSON body (not form-encoded) to match API - boss_exchange_request includes gid=uid param required by the API - _request handles 404 responses that contain JSON (anti-bot responses) - _post supports json_body=True parameter for JSON POST requests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ing pagination
`recruiter recommend` previously called `/wapi/zprelation/friend/greetRecSortList`
("greet rec sort list"), which re-sorts the recruiter's already-greeted candidates
and ignores the `page` param. Result: users saw only ~10 candidates and `-p N`
returned the same list reshuffled.
The actual "推荐牛人" feed on the BOSS recruiter web page calls
`/wapi/zpjob/rec/geek/list` (XHR fired on infinite scroll), which:
- returns 15 candidates per page
- paginates via `page=N`
- includes `hasMore` for the end-of-feed signal
- requires a `Referer: /web/frame/recommend/` header
Changes:
- Add `BOSS_REC_GEEK_LIST_URL` constant + Referer mapping
- Repoint `get_boss_recommend_geeks` at the real endpoint with the full
filter param set the page sends (age/school/activation/etc., zeroed)
- `--job` is now required (the endpoint is job-scoped)
- Render the richer `geekCard` payload: name / age / exp / degree / city /
salary / activeTime / encryptGeekId, plus next-page hint when hasMore
- Update README examples
Smoke-tested against an active recruiter account: page 1 returned 15
distinct candidates with `hasMore: true`; `-p 2`, `-p 3`, ... return
fresh batches as the browser does on scroll.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…upport custom first message `recruiter greet` previously did NOT send a greeting — it just called `view_geek` (with broken params: `encryptGeekId + encryptJobId` returns `code=2 未知的非法参数`; BOSS prefers `securityId` alone) and printed the candidate name. No `chat/start` POST. No actual conversation initiation. Now `greet` calls the real `/wapi/zpjob/chat/start` (the same endpoint the web UI fires when the recruiter clicks "打招呼"). With `-m/--message`, the message is delivered as the chat's first line — saves the extra `sendReplyMsg` round-trip. Also fix `get_boss_view_geek` to accept `security_id` alone (the form BOSS actually wants). Changes: - Add `BOSS_CHAT_START_URL` constant + Referer mapping - Add `boss_chat_start(encrypt_geek_id, encrypt_job_id, security_id, expect_id?, lid?, greet?)` to client - Rewire `recruiter greet` command: required `--job` + `--security-id`, optional `--expect-id`, `--lid`, `-m/--message` - Fix `get_boss_view_geek`: accept `security_id` alone (prefer it), reject the broken `encGid+encJid` combo via ValueError when securityId missing Schema discovered by hooking XMLHttpRequest in a logged-in BOSS recruiter session and clicking the real "打招呼" button — captured the full POST body (gid, suid, jid, expectId, lid, greet, from, securityId, customGreetingGuide). All 9 params required; tested against live account. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Problem
boss recruiter greetdoesn't actually greet — it only callsview_geek(with broken params:encryptGeekId + encryptJobIdreturnscode=2 未知的非法参数; BOSS wantssecurityIdalone) and prints the candidate name. Nochat/startPOST is ever made, so no conversation is initiated.Root cause
The BOSS recruiter web "打招呼" button fires
POST /wapi/zpjob/chat/startwith a 9-param body:With a non-empty
greetfield, BOSS delivers it as the chat's first message — saves a separatesendReplyMsground-trip.Schema discovered by hooking
XMLHttpRequest.prototype.sendin a logged-in BOSS recruiter session and clicking the real "打招呼" button.Changes
BOSS_CHAT_START_URLconstant +Referermappingboss_chat_start(encrypt_geek_id, encrypt_job_id, security_id, expect_id?, lid?, greet?)to clientrecruiter greetcommand: required--job+--security-id, optional--expect-id,--lid,-m/--messageget_boss_view_geek: acceptsecurity_idalone (prefer it), reject the brokenencGid+encJidcombo viaValueErrorwhensecurityIdmissingTest plan
boss recruiter greet --helpshows the new flagscode:0 Success, candidate received chat invitation + custom first message (verified via inbox: "[送达]你好,我是 Wilson...")customGreetingGuide=-1, emptysuid/from/greet) hasn't changed since 2026-05-12🤖 Generated with Claude Code