fix(pixel-inference): reject negative or out-of-range temperature in prepare - #5940
Open
vaibhavsrv wants to merge 1 commit into
Open
vaibhavsrv wants to merge 1 commit into
vaibhavsrv wants to merge 1 commit into
Conversation
This was referenced Sep 19, 2026
vaibhavsrv
force-pushed
the
fix/pixel-inference-temperature-bounds
branch
from
September 22, 2026 03:19
4f33371 to
ceec0ab
Compare
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.
Why this matters
In
ods/extensions/services/pixel-inference/app/main.py,_prepare(payload, grant)checks inference request fields against the allowedFIELDSset and enforces message formatting, but does not validate the type or numerical bounds oftemperature. When a client passes a negative temperature, a value exceeding the model runtime cap (> 2.0), or a non-numeric/boolean value (such astrueor a string), the unvalidated value passes through to downstream inference runtimes, triggering unhandled backend exceptions, process abortion, or HTTP 500 crashes.This change adds a surgical validation block to
_preparebefore computing the token limit. It verifies thattemperatureis anintorfloat(excludingbool) within the canonical[0.0, 2.0]range, raisingShareError(400, 'invalid_temperature')otherwise. Existing valid temperatures, default behavior, and model parameter fallbacks remain completely unchanged.Validation
main.py: passing{"temperature": -1.0},{"temperature": 2.5}, or{"temperature": True}bypassed validation and was forwarded without rejection.invalid_temperature; valid values in[0.0, 2.0]succeed identically.Overlap check
healthcheck.py.pixel_settings/contract.py.pixel_edge.py.pixel_gateway.This PR operates exclusively on incoming parameter validation in
pixel-inference/app/main.pyand does not overlap with or duplicate any of these changes.Risk / AI disclosure
AI-assisted investigation, implementation, and unit regression. This strengthens an inference parameter contract check and does not modify running infrastructure, model files, or container configurations. Independent human review and platform qualification remain gates.
Follow-up integration evidence
Composed cleanly on top of #5569, #5871, and #5875 at HEAD without conflicts. Production and test diffs passed together; adjacent pixel-agent and pixel-settings checks remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.