fix: forward extraBodyProperties from requestOptions in autocomplete requests (#12334)#12533
Open
argahv wants to merge 1 commit into
Open
fix: forward extraBodyProperties from requestOptions in autocomplete requests (#12334)#12533argahv wants to merge 1 commit into
argahv wants to merge 1 commit into
Conversation
Author
|
I have read the CLA Document and I hereby sign the CLA |
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
c663337 to
ecadb17
Compare
…requests (continuedev#12334) The extraBodyProperties() method in OpenAI.ts returned {} by default, causing user-configured requestOptions.extraBodyProperties to be omitted from request bodies constructed at the class level. While the fetch layer (fetchwithRequestOptions) also merges these properties, the adapter and non-adapter paths have inconsistent coverage. This commit changes extraBodyProperties() to return this.requestOptions?.extraBodyProperties ?? {} instead of {}. This fixes autocomplete requests (which go through streamComplete -> _streamChat -> _legacystreamComplete) not sending extra body properties configured via requestOptions.extraBodyProperties, while also ensuring all request types (chat, completions, FIM, embeddings) consistently include them. Also fixes ContinueProxy to propagate super.extraBodyProperties(). Fixes continuedev#12334
ecadb17 to
28225c8
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.
Description
Fixes #12334 — autocomplete using OpenRouter (and other OpenAI-compatible providers) doesn't send
requestOptions.extraBodyProperties.Root Cause
The
extraBodyProperties()method inOpenAI.tsreturned{}by default. This method is used to spread extra properties into request bodies across ALL request types:_streamChat(chat completions)_legacystreamComplete(legacy completions — used by autocomplete whensupportsFim()is false)_streamFim(fill-in-the-middle)_streamResponses(responses API)_embed(embeddings)While the fetch layer (
fetchwithRequestOptions) also mergesrequestOptions.extraBodyProperties, the adapter and non-adapter paths have inconsistent coverage. This fix ensures the configured properties are explicitly included at the body construction level for ALL paths.Changes
extraBodyProperties()to returnthis.requestOptions?.extraBodyProperties ?? {}instead of{}...super.extraBodyProperties()to ensure user-configured properties propagate through the proxyTest plan
extraBodyPropertiesappear instreamChatbody (chat completions endpoint)extraBodyPropertiesappear instreamChatwithraw: true(legacy completions endpoint, used by autocomplete)Summary by cubic
Ensure
requestOptions.extraBodyPropertiesare included in all OpenAI‑compatible request bodies, fixing missing fields in autocomplete with OpenRouter. Chat, legacy completions (autocomplete), FIM, responses, and embeddings now send custom body fields consistently. Fixes #12334.this.requestOptions?.extraBodyProperties ?? {}fromextraBodyProperties()inOpenAI.ContinueProxyby spreadingsuper.extraBodyProperties().Written for commit 28225c8. Summary will update on new commits.