Repository navigation
feat(client): pass through sampling-mask logprobs and by-handle payload segments - #170
faresobeid wants to merge 6 commits into
Conversation
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — The patch is a small, backward-compatible addition that exposes optional response metadata without changing request behavior. Two unresolved substantive comments identify potential reasoning/parsing correctness issues elsewhere in the PR, so human review is warranted. Notes:
No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
01c9cce to
1cd3446
Compare
e134d56 to
e161362
Compare
1cd3446 to
ea01237
Compare
e161362 to
19c558f
Compare
ea01237 to
ecfeef7
Compare
Dismissing prior approval to re-evaluate d3a1af0
Dismissing prior approval to re-evaluate 030b208
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 030b208. Configure here.
| close == -1, text[start : close if close != -1 else len(text)], by_tool | ||
| close == -1, | ||
| text[start : close if close != -1 else len(text)].replace(open_marker, ""), | ||
| by_tool, |
There was a problem hiding this comment.
Reasoning text drops think markers
Medium Severity
scan_reasoning already skips the leading <think> opener, then deletes every later open_id and every <think> substring before decoding what remains. Reasoning that mentions the tag, or a truncated </think>, loses those characters, and neighboring tokens can merge into different text.
Reviewed by Cursor Bugbot for commit 030b208. Configure here.
| (reasoning or "").rstrip() | ||
| if parsed.boundary.is_open | ||
| else (reasoning or "").rstrip() or None | ||
| ), |
There was a problem hiding this comment.
DeepSeek reasoning boundary whitespace stripped
Medium Severity
parse_deepseek_v4 always rstrips reasoning and turns whitespace-only content into "". The newline the model emits before </think>, and a content channel that is only that separator, disappear from the parsed message.
Reviewed by Cursor Bugbot for commit 030b208. Configure here.


renderers.client.generate()passes two more optional prime-rl/inference/v1/generatefields through. Both are pure pass-through: no request-side change, no parsing or validation (same assampling_mask). Stock vLLM sends neither, and then the keys areNone.sampling_mask_logprobs = choice.get("sampling_mask_logprobs"): the sampler's logprobs at the sampling-mask ids, packed base64 float32{data, shape, dtype}, parallel to the packedsampling_maskids. verifiers decodes it (feat(v1): optional sampler logprobs on SamplingMask verifiers#2756). Consumer: prime-rl score centering, feat: exact score centering over the sampling mask (arXiv:2609.20807) prime-rl#3794.payload = choice.get("payload"): by-handle segments of a shared file that prime-rl's inference server writes instead of returningrouted_experts/sampling_maskinline. verifiers puts them on traces (feat(v1): by-handle payload segments on traces verifiers#2765). Consumer: feat: pass router-replay ids and sampling masks by handle on multi-node runs prime-rl#3902.Order
This PR with PrimeIntellect-ai/verifiers#2756 (-> prime-rl#3794) and PrimeIntellect-ai/verifiers#2765 (-> prime-rl#3902).
Validation
pytest tests/test_client.py --noconftest(32 passed),ruff check,ruff format --checkonrenderers/client.py.Note
Pass through sampling-mask logprobs and by-handle payload segments in generation client
The async generation client in client.py now reads sampling-mask logprobs from the response choice and includes them in the result. It also forwards the choice's payload field for by-handle side arrays such as routed experts or sampling masks. Missing fields are returned as
None.Macroscope summarized 196f97e.
Note
Low Risk
Backward-compatible optional response pass-through with no request, validation, or parsing logic changes.
Overview
generate()now surfaces two optional prime-rl/inference/v1/generatechoice fields on its result dict, with no request or parsing changes (same pattern as existingsampling_mask/routed_expertspass-through).sampling_mask_logprobscarries packed sampler logprobs aligned with the sampling-mask token ids when score centering is enabled on the inference server.payloadforwards by-handle segments pointing at a shared sidecar file when the server offloads largerouted_experts/sampling_maskblobs instead of inlining them. Engines that omit either field leave the keys asNone.Docstrings and inline comments were updated to document the new return keys.
Reviewed by Cursor Bugbot for commit 196f97e. Bugbot is set up for automated code reviews on this repo. Configure here.