Repository navigation
feat(server): integrate OpenAI Chat streaming - #2437
Merged
Merged
Conversation
This was referenced Oct 5, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Pouyanpi
force-pushed
the
pouyanpi/openai-chat-streaming-integration-4
branch
from
October 6, 2026 11:05
9861450 to
229e31a
Compare
Pouyanpi
marked this pull request as ready for review
October 6, 2026 11:06
Pouyanpi
force-pushed
the
pouyanpi/openai-chat-streaming-integration-4
branch
from
October 6, 2026 15:22
229e31a to
52b1d88
Compare
Contributor
|
Pouyanpi
force-pushed
the
pouyanpi/openai-chat-streaming-integration-4
branch
2 times, most recently
from
October 7, 2026 09:00
cc48787 to
1058fe8
Compare
Pouyanpi
force-pushed
the
pouyanpi/openai-chat-streaming-integration-4
branch
from
October 8, 2026 17:52
1058fe8 to
6269303
Compare
This was referenced Oct 8, 2026
Pouyanpi
added this pull request to stack #2445
October 9, 2026 13:16
Contributor
Pouyanpi
force-pushed
the
pouyanpi/openai-chat-streaming-integration-4
branch
from
October 9, 2026 14:17
6269303 to
7601b81
Compare
Pouyanpi
force-pushed
the
pouyanpi/openai-chat-streaming-integration-4
branch
from
October 9, 2026 15:22
7601b81 to
33d8179
Compare
Pouyanpi
force-pushed
the
pouyanpi/openai-chat-streaming-integration-4
branch
from
October 12, 2026 13:21
33d8179 to
f463797
Compare
tgasser-nv
approved these changes
Oct 13, 2026
tgasser-nv
left a comment
Collaborator
There was a problem hiding this comment.
Looks godo, just a couple of things to address before merging:
- Could you add a local end-to-end test to show this works with a build.nvidia.com - hosted model?
- Can you add test coverage to get it up to 100% ?
Pouyanpi
force-pushed
the
pouyanpi/openai-chat-streaming-integration-4
branch
from
October 13, 2026 09:33
f463797 to
aec23e3
Compare
Collaborator
Author
|
Thanks Tim. Added tests across the stack, including the kernel features Chat doesn't use yet. The end-to-end test against build.nvidia.com is deferred to the transport work. |
Pouyanpi
force-pushed
the
pouyanpi/openai-chat-streaming-integration-4
branch
from
October 13, 2026 10:14
aec23e3 to
5e75295
Compare
Base automatically changed from
pouyanpi/transparent-proxy-streaming-http-3
to
develop
October 13, 2026 11:20
Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Advertise the text/event-stream success response only when the router has both a stream adapter and streaming dispatch, since streaming requests are rejected before dispatch otherwise. Remove the unused first construction of the buffered operation, which the factory replaced before returning. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
The endpoint now binds the stream classifier and a fresh hook instance per request, and the router dispatches either response mode. State that the buffered contract export stays buffered-only. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Empty assistant content means no guarded text because other reviewed fields that could carry generated content are rejected unless null or empty, not because every other field is content-free: opaque metadata is relayed without inspection. Export checks that replacement blockers name reviewed fields, not replacement behavior. Stream event match keys are dot-separated member paths, while object variant keys name item members directly. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Export could describe a policy different from the one bound at runtime: - stream models with custom validators, whose effect the document omits; - a hand-written response-mode property, exported without any selector; - a non-strict stream selector, which accepts "true" while the document says boolean; - schema keywords the guard format cannot carry. Each is now rejected at export. The validator check reads Pydantic's core schema; a test pins every validator kind so a Pydantic change fails loudly. Strictness has no JSON Schema keyword and stays a documented limitation, not an export failure. Endpoints whose response mode is fixed by the route can no longer be exported until the format can describe them. The export also drops a selector check that can no longer be false, adds an HTTP test that the checker sees the original stream text, and documents resource ownership and intentional limits. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
A stream selector default produced by a factory runs at validation time, but the exported document can only state a literal default. Export now rejects selector default factories instead of silently omitting their behavior. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
The streaming branch passed guardable.target.message as output-check context, which equals the message the input rail checked only because the request projection happens to return it. It now passes prepared_input.input_message, as the buffered path does. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
An operation built with a streaming dispatcher but no endpoint stream binding failed each stream: true request with an AssertionError, which surfaced as a 500. The combination is a configuration error, so it is now rejected when the operation is created, and the request path no longer needs the assertion. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Adds cases for selector field and model validators, overridden model validation on stream models, unknown capability profiles, a stream binding without a callable classifier, and the native error for stream processing failures. No runtime behavior changes. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
StreamInspectionUnsupported joins the stream outcome union here and has no stage, so ty rejected the fallback branch. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Pouyanpi
force-pushed
the
pouyanpi/openai-chat-streaming-integration-4
branch
from
October 13, 2026 11:20
06cbf27 to
a7f7e64
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.
Summary
Integrates the preceding OpenAI Chat stream modules and HTTP bridge with the existing guarded endpoint. Buffered and streaming requests share one input projection and check.
What Changed
stream: trueselects streaming;false,null, or omission selects buffered, and the request bytes are forwarded unchanged.minimumandmaximum.Review Notes
Review target-state continuity, one input check, request-local hooks, error disclosure, and buffered regressions. Known limits: JSON Schema cannot express Python strictness, and endpoints whose response mode is fixed by the route cannot be exported yet. The stream projection, classifier, and hooks are supplied by part 2; the HTTP bridge is supplied by part 3. Concrete outbound HTTP, application configuration, live recordings, and replacement execution remain separate work.
AI Assistance
Checklist
Stack Position
Part 4 of 4.
Stack Context
Adds OpenAI Chat streaming above the merged buffered implementation on develop in four parts: provider-neutral execution, typed OpenAI stream declarations and handwritten hooks, injected HTTP lifecycle handling, and integration with the buffered request pipeline.
The open chain is develop → #2434 → #2435 → #2436 → #2437. The buffered foundation is merged; #2412 is closed.
Python declarations own field and event policy. Hooks are handwritten and created for each stream by the integration. The final PR exports the bound buffered and streaming policy for inspection; export never constructs runtime components. Concrete outbound HTTP, deployment configuration, and replacement execution land separately.
Review each PR against its listed base branch.
pouyanpi/transparent-proxy-streaming-kernel-1developpouyanpi/openai-chat-streaming-contract-2pouyanpi/transparent-proxy-streaming-kernel-1pouyanpi/transparent-proxy-streaming-http-3pouyanpi/openai-chat-streaming-contract-2pouyanpi/openai-chat-streaming-integration-4pouyanpi/transparent-proxy-streaming-http-3Summary by CodeRabbit