fix(scaleway): support project-scoped keys and chat-completions endpoint#45
Merged
Conversation
…ndpoint A Scaleway API key scoped to a specific Project returned 403 "insufficient permissions" on the hardcoded https://api.scaleway.ai/v1 URL (the org default project), so the model dropdown was empty. Add an optional Project ID on the Scaleway provider and target https://api.scaleway.ai/{projectId}/v1 when set. Also switch Scaleway inference to the .chat() model: the default callable in @ai-sdk/openai v3 targets /v1/responses, which Scaleway does not implement (returns 422 ROUTE NOT SUPPORTED) — same fix applied to openai-compatible in #44. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Fixes the Scaleway provider, which returned an empty model dropdown, and makes the failure that caused it visible instead of silent.
What changed
https://api.scaleway.ai/{projectId}/v1instead of the bare/v1(the org default project). A key scoped to a single Project returned403 insufficient permissionsagainst the bare URL, leaving the model dropdown empty..chat()model. The default@ai-sdk/openaiv3 callable targets/v1/responses, which Scaleway does not implement (returns422 ROUTE NOT SUPPORTED) — the same fix applied toopenai-compatiblein feat: add compatibility mode for openai-compatible providers #44.[].GET /modelsnow returns{ results, count, errors }, and the admin settings page shows a warning naming each provider that failed and why. This is the diagnosability gap the Scaleway bug exposed — the 403 was only visible in server logs.Why: a user reported "Scaleway is broken, it doesn't list its models." Root cause was the hardcoded default-project URL for a project-scoped key; the empty dropdown gave no hint why, which is what motivated the error-surfacing change.
Verified: unit tests for the URL helper; API tests proving a failing provider is reported while working providers still list; lint + type-check clean. Confirmed live against the Scaleway API: project-scoped
/v1/modelsand/v1/chat/completionsreturn 200,/v1/responsesreturns 422.Heads-up for reviewers
GET /modelsresponse gained anerrorskey (additive; the vjsf autocomplete readsresultsonly).updatedAt; saving settings busts the cache, so a fixed key reflects immediately.build-typesoutput (validate.js,vjsf-put-req-*.vue) — mechanical identifier renumbering from the one new schema field, no hand edits there.