Repository navigation
fix(backend): contain response serialization failures - #322
Merged
gaborbernat merged 1 commit intoOct 17, 2026
Merged
Conversation
Serialize current-request responses before writing them and preserve error reporting and recovery for malformed hook results and exceptions. Developed, tested and reviewed with AI assistance. No independent human review is claimed.
gaborbernat
approved these changes
Oct 17, 2026
gaborbernat
enabled auto-merge (squash)
October 17, 2026 10:31
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.
When a build hook returns a non-JSON value such as a
Path, bytes or a set, the runner currently writes a partial response file. The frontend then raisesJSONDecodeErrorinstead of reporting the backend failure.Serialize the response before opening the result file, and handle serialization errors through the existing backend exception envelope. Replace the success dictionary when reporting an error so it cannot retain a
returnkey. If formatting or serializing the exception also fails, emit a fixed JSON-safe error response. Reset the serialized response for each request so a reused process cannot return an earlier success after a malformedSystemExitcode.Add seven regression cases covering invalid hook returns and invalid exit codes, both on the first request and after a successful request, with subsequent recovery and clean shutdown. These hooks test response transport and lifecycle; their synthetic wheel names do not establish wheel production.
This addresses malformed backend results and exceptions. It does not establish a failure with a conforming backend or a production incident, and it does not make response-file writes atomic or cover file I/O failures and resource exhaustion.
Validation on macOS arm64:
tox run -e fix,type,docs,pkg_metapassed, including all pre-commit hooks, typing, strict Sphinx build, sdist/wheel build, twine and wheel-content checks.Linux, Windows and hosted CI have not been verified for this patch locally. AI assistance was used to prepare implementation and regression tests.