Conversation
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.
Summary
Adds
ods/tests/pixel_inference/test_runtime_gateway_policy.py— boundary-policy coverage forods/bin/pixel_provider/runtime_gateway.py, the turn-scoped OpenAI transport every Pixel generation call crosses.test_provider_runtime.pyalready covers failover/streaming mechanics; this pins the admission and SSRF-guard surface it did not.Why this matters
This is the last process boundary before a turn leaves the device: request validation decides what may reach a provider,
pinned_targetis the DNS-rebinding/SSRF guard, and the session policy (single-flight, terminal-on-failure, call limit, cooldown) is what prevents SDK retries from multiplying provider attempts.What is tested (56 cases)
validate_request— envelope allowlist,model=='ods/pixel', non-empty message list, boolstream,n==1, mutually exclusivemax_tokens/max_completion_tokens; all six message roles; external-media gate — onlydata:image/{png,jpeg,webp};base64URLs pass, every remote/foreign-scheme URL raisesexternal-media-not-allowed; tools must betype:'function';chat_template_kwargslimited to{enable_thinking: bool}.pinned_target— loopback HTTP allowed withX-ODS-Pixel-Route-Hop/Hostheaders; link-local, private-LAN-over-http, unspecified, v4-mapped public, v6 link-local, and v6 multicast all raiseunsafe-provider-address; HTTPS public allowed withsni_hostnameextension; IPv6 loopback bracketed correctly.Authorization→ 401;X-ODS-Pixel-Route-Hop→ 409provider-route-cycle; transient upstream exhaustion →provider-attempts-exhaustedthenprovider-session-stoppedon the next call; non-JSON / wrong-shape upstream bodies →invalid-provider-response; non-SSE content-type onstream:true→invalid-provider-stream; missingdata: [DONE]→provider-stream-interruptedand a terminal session (no client retry can splice a backup); oversized request body rejected; response headers carry provider id, revision, request id,Cache-Control: no-store.Overlap check
Searched
runtime_gateway, "runtime gateway". #5647 (open, roshangupta00750) adds stream-tail chunk-boundary[DONE]detection + tests intest_provider_runtime.py— different file, compatible semantics (my no-[DONE]→ interrupted assertion holds under both). #5607/#5608 are dashboard-api/pixel-edge stream handling. My own #5659/#5661/#5663/#5665/#5668/#5669/#5671/#5674/#5675/#5676/#5677/#5681/#5686/#5687/#5688 touch other modules.Validation
Test-only change; revert is a single file deletion.