fix(sdk): surface proxy request validation errors#12550
Open
RuchirSingh1000 wants to merge 1 commit into
Open
Conversation
Contributor
|
I have read the CLA Document and I hereby sign the CLA Your Name seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
Author
|
I have read the CLA Document and I hereby sign the CLA |
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
createOpenAIClientcurrently builds useful validation errors when a request references a model that is missing from the assistant config, or when that model has noapiKeyLocation/envSecretLocations. Those errors are inside the same broadtry/catchused for JSON parsing, so they are swallowed and the SDK silently forwards the original request body withoutcontinueProperties.This separates JSON parsing fallback from assistant-model validation:
Checklist
Screen recording or screenshot
N/A - SDK request validation fix.
Tests
npm.cmd test -- createOpenAIClient.test.ts --runInBandfrompackages/continue-sdk/typescriptgit diff --checkI also tried
npm.cmd test -- --runInBandandnpx.cmd tsc --noEmitfrompackages/continue-sdk/typescript. The focused regression test passes, but the full package checks are currently blocked in this local checkout by existing generated/local package resolution issues (../api/dist/index.jsand@continuedev/config-yaml).Summary by cubic
Surface proxy request validation errors in the SDK by separating JSON parsing from model validation in
createOpenAIClient. Non-JSON bodies pass through unchanged; missing models or models without secret locations now fail fast with clear errors.addContinuePropertiesToBodyto attachcontinuePropertiesonly for JSON bodies.apiKeyLocation/envSecretLocations.Written for commit 9739005. Summary will update on new commits.