Fix Custom Provider sign-in against endpoints that reject empty model#13660
Merged
Conversation
The custom provider validator POSTed `{model: '', messages: []}` to
`/chat/completions`, which Databricks `serving-endpoints` and the
Moonshot/Kimi API reject with 404 (and the validator surfaced as
"Custom Provider endpoint not found"), blocking sign-in. Read the
first entry's identifier from `positron.assistant.models.overrides
.customProvider` and send it as the model; treat HTTP 404 as a soft
success (warns to the auth log channel and returns) so providers whose
`/chat/completions` shape diverges from the OpenAI canonical can still
sign in. 401/403/timeouts/5xx remain hard failures.
Refs #13421, #13489.
|
E2E Tests 🚀 |
PETE's assessment 🧪Verdict: Adequate -- the new extension-host test file directly exercises all three behavioral changes: override-model resolution, empty-model fallback, and the 404 soft-fail. What changed
Tests in this PR
Existing coverageNot applicable -- this is a new test file providing primary coverage for the changed module. Suggested additionsNone. PETE (Positron Extreme Test Experiment) - LLM-based test-coverage advisor, in pilot. Triggers on PR open and on |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #13421 Fixes #13489
Custom Provider sign-in now validates against the user's configured model. When
positron.assistant.models.overrides.customProviderhas at least one entry, the validator sends the first entry'sidentifieras themodelfield on the test request to/chat/completions; otherwise it sends an empty string. A 404 response from the endpoint is logged as a warning and treated as a soft success - credentials are saved and the user can proceed. 401, 403, timeouts, and 5xx responses still hard-fail.This unblocks Databricks
serving-endpointsand other OpenAI-compatible providers (Moonshot/Kimi, etc.) whose/chat/completionsroute rejects requests without a real model.Release Notes
New Features
Bug Fixes
Validation Steps
@:assistant
To reproduce against a Databricks workspace (or any provider whose
/chat/completionsrejects empty model strings):settings.json, set:https://<workspace>.azuredatabricks.net/serving-endpointsand your PAT, and sign in.Unit coverage in
extensions/authentication/src/test/customProvider.test.ts- run withnpm run test-extension -- -l authentication --grep validateCustomProviderApiKey.