Skip to content

fix(scaleway): support project-scoped keys and chat-completions endpoint#45

Merged
albanm merged 1 commit into
mainfrom
fix-scaleway
Jun 26, 2026
Merged

fix(scaleway): support project-scoped keys and chat-completions endpoint#45
albanm merged 1 commit into
mainfrom
fix-scaleway

Conversation

@albanm

@albanm albanm commented Jun 26, 2026

Copy link
Copy Markdown
Member

Fixes the Scaleway provider, which returned an empty model dropdown, and makes the failure that caused it visible instead of silent.

What changed

  • Scaleway project-scoped keys: add an optional Project ID on the Scaleway provider. When set, requests target https://api.scaleway.ai/{projectId}/v1 instead of the bare /v1 (the org default project). A key scoped to a single Project returned 403 insufficient permissions against the bare URL, leaving the model dropdown empty.
  • Scaleway chat endpoint: switch Scaleway inference to the .chat() model. The default @ai-sdk/openai v3 callable targets /v1/responses, which Scaleway does not implement (returns 422 ROUTE NOT SUPPORTED) — the same fix applied to openai-compatible in feat: add compatibility mode for openai-compatible providers #44.
  • Surface model-listing errors: the per-provider fetchers no longer swallow errors and return []. GET /models now 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/models and /v1/chat/completions return 200, /v1/responses returns 422.

Heads-up for reviewers

  • GET /models response gained an errors key (additive; the vjsf autocomplete reads results only).
  • Listing results (incl. errors) are memoized 5 min keyed on updatedAt; saving settings busts the cache, so a fixed key reflects immediately.
  • Most of the diff is regenerated build-types output (validate.js, vjsf-put-req-*.vue) — mechanical identifier renumbering from the one new schema field, no hand edits there.

…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>
@github-actions github-actions Bot added the fix label Jun 26, 2026
@albanm albanm merged commit 4a34b3e into main Jun 26, 2026
4 checks passed
@albanm albanm deleted the fix-scaleway branch June 26, 2026 15:53
@albanm albanm restored the fix-scaleway branch June 26, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant