fix: /v1/embeddings now returns OpenAI shape (OQP-4)#7
Merged
Conversation
…I wrap (OQP-4) Ollama's /api/embed sends application/json with transfer-encoding: chunked. dispatch_request classified any chunked response as streaming, returning a StreamingResponse. proxy_handler's isinstance(response, JSONResponse) guard then failed, so wrap_response was never called and the Ollama-native body passed through to callers expecting the OpenAI shape. Fix: remove transfer-encoding: chunked from the is_streaming heuristic. Chunked TE is a transport-layer mechanism; true streaming is identified by content-type (text/event-stream, application/x-ndjson). Adds regression test: test_chunked_json_response_not_treated_as_streaming. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> agent-id: developer
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
Test plan
Closes OQP-4
Generated with Claude Code