fix(external-providers): admin guard, validation, locale keys#9171
Merged
lstein merged 12 commits intoMay 18, 2026
Conversation
- Require AdminUserOrDefault on POST/DELETE /external_providers/config/{id}
so non-admins in multiuser mode can no longer set/reset shared credentials
- Reject Seedream batch requests where references + init + outputs > 15
before posting, surfacing ExternalProviderCapabilityError instead of a
provider-side 400
- Surface Seedream batch item errors via provider_metadata.partial_failures
and raise when every item failed, instead of silently dropping filtered
results
- Set max_reference_images=3 on Qwen Image Edit Max so the central validator
enforces the documented limit before hitting DashScope
- Add missing parameters.* locale keys (quality, background, inputFidelity,
temperature, thinkingLevel, watermark, optimizePrompt) so the OpenAI,
Gemini, and Seedream option panels render their labels without fallbacks
Collaborator
|
I can't run tests so here's what I have:
|
Wrap the visible <option> text in OpenAIProviderOptions and
GeminiProviderOptions with t(...) so non-English locales translate
the values alongside their <FormLabel> (previously the labels
translated but Auto/High/Medium/Low/Transparent/Opaque/Default/
Minimal stayed English). Adds the matching
parameters.{quality,background,inputFidelity,thinkingLevel}Options
keys to en.json and a colocated vitest guard that fails if any
<FormLabel> or <option> in External/*ProviderOptions.tsx contains
a raw literal instead of a {t(...)} expression.
Collaborator
|
@JPPhoto I've run through the functional tests; have not looked at the code. All the tests suggested in the PR description were successful:
I did surface a new bug, however. When the Canvas is selected, I can drag images into the Regional Reference Image section of the canvas and create a new regional guidance layer. However, regional guidance is not supported by the external models and is disabled in the layer creation menu. |
The Canvas drop area registered every <DndDropTarget> as long as the canvas wasn't busy, so dragging an image onto the "Regional Reference Image" tile created a regional_guidance layer even when the active model didn't support it (e.g. OpenAI/Gemini/Seedream). The layer-creation menu already disables those entries via useIsEntityTypeEnabled, but the drop tiles bypassed that check. Pull useIsEntityTypeEnabled into CanvasDropArea and OR each tile's isDisabled with !isEnabled for its entity type. Same fix closes the symmetric gaps for SD3 / CogView4 / Flux Kontext on the control-layer and inpaint-mask tiles, mirroring the menu in one place.
…Pfannkuchensack/InvokeAI into fix/external-provider-hardening
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.
Summary
AdminUserOrDefaultonPOST/DELETE/external_providers/config/{id}so non-admins in multiuser mode can no longer set/reset shared credentialsreferences + init + outputs > 15before posting, surfacingExternalProviderCapabilityErrorinstead of a provider-side 400provider_metadata.partial_failuresand raise when every item failed, instead of silently dropping filtered resultsmax_reference_images=3on Qwen Image Edit Max so the central validator enforces the documented limit before hitting DashScopeparameters.*locale keys (quality,background,inputFidelity,temperature,thinkingLevel,watermark,optimizePrompt) so the OpenAI, Gemini, and Seedream option panels render their labels without fallbacksRelated Issues / Discussions
https://discord.com/channels/1020123559063990373/1049495067846524939/1504485218461941770
QA Instructions
Backend tests (all pass):
Admin guard (multiuser mode):
multiuser: true.POST /api/v1/app/external_providers/config/openaiwith{"api_key": "x"}→ expect403 Admin privileges required.200.DELETE /api/v1/app/external_providers/config/{openai|gemini|alibabacloud|seedream}.Seedream combined limit:
Seedream 4.5(or any batch model).num_images=15→ expect a capability error in the UI; no request reaches BytePlus.Seedream partial failures:
partial_failuresmetadata entry and the warning log line.ExternalProviderRequestErrorsurfacing the provider's message.Qwen Image Edit Max reference limit:
ExternalProviderCapabilityError("supports at most 3 reference images") before any DashScope call.Locale keys:
parameters.*keys inen.json).Merge Plan
Standard merge — no schema or migration changes.
Checklist
What's Newcopy (if doing a release after this PR)