Skip to content

fix(pixel-gateway): validate temperature bounds in runtime gateway - #6330

Closed
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/pixel-gateway-temperature-bounds
Closed

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/pixel-gateway-temperature-bounds

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/bin/pixel_provider/runtime_gateway.py, the validate_request routine permits the optional temperature sampling parameter without verifying bounds or type constraints. When clients send out-of-range values (such as negative numbers or values exceeding standard upper bound 2.0) or invalid types (booleans, strings, or nulls), the request bypasses admission validation and is forwarded to provider endpoints, leading to downstream runtime errors or corrupted sampling distributions.

This change surgically adds bounds ($[0.0, 2.0]$) and numeric type checks (type(payload['temperature']) in (int, float)) for temperature in validate_request, rejecting invalid configurations with invalid-inference-request. Valid values across the full standard range $[0.0, 2.0]$ remain supported.

Validation

  • Baseline reproduction: Requests specifying temperature: -0.5, temperature: 3.0, or temperature: True were accepted by validate_request.
  • Post-fix behavior: Requests with out-of-bounds or non-numeric temperature values raise RuntimeErrorCode('invalid-inference-request'). Standard temperatures (e.g. 0.0, 0.7, 1.0, 2.0) validate cleanly.
  • Telemetry: Pixel gateway suites: 3 passed. New-test Ruff, ShellCheck, and diff checks pass; new regressions wired into Linux CI.

Overlap check

Recent PRs #6329 (top_p validation in runtime gateway), #6328 (rollback snapshot permissions in ods-update.sh), and #6326 (multiple backup args in ods-restore.sh) focus on distinct parameters or subsystems. This PR focuses strictly on the temperature parameter within ods/bin/pixel_provider/runtime_gateway.py without overlapping or altering existing sampling logic.

Risk / AI disclosure

AI-assisted investigation, implementation and CLI regressions. This strengthens an API validation check, not runtime admission. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.

Follow-up integration evidence

Composed with #6329 at 02f5766 without conflicts. Production and test diffs passed together; gateway and runtime 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.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants