Revert "Use native JSON bytes for upstream eval traffic" - #1800
Merged
xeophon merged 1 commit intoJun 21, 2026
Conversation
This reverts commit 92e8ffb.
Contributor
ApprovabilityVerdict: Approved This revert removes a recent JSON serialization optimization and returns to httpx's standard built-in JSON handling. The changes are mechanical and restore previously working behavior. You can customize Macroscope's approvability policy. Learn more. |
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.
Reverts #1798
Note
Medium Risk
Changes how all upstream eval bodies are encoded and parsed, which can differ from the reverted path on edge cases (non-finite floats, JSON wire shape) even though it restores prior behavior.
Overview
Reverts the native JSON bytes path in
EvalClientand restores httpx’s built-in JSON for upstream eval and aux relays._requestagain usesbuild_request(..., json=body)instead of manually serializing withpydantic_core.to_json, settingcontent-type, and walking the body to reject non-finite floats. Response handling switches fromfrom_json(resp.content)back toresp.json()inget_responseandrelay_aux. Unusedmathandpydantic_coreimports are removed.Reviewed by Cursor Bugbot for commit e0552d4. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Revert native JSON serialization in
EvalClientto use httpx defaultsReverts the
EvalClientin eval.py to use httpx's built-in JSON handling instead ofpydantic_core. Removes manual pre-validation of non-finite floats and explicit content-type headers, replacingpydantic_core.to_json/from_jsoncalls withjson=bodyandresp.json()throughout. Risk: non-finite float values (e.g.NaN,Infinity) in request bodies are no longer rejected before serialization.Macroscope summarized e0552d4.