Repository navigation
fix(settings): accept the image model a signed-in vendor account offers - #1455
Merged
Merged
Conversation
Choosing the image model a ChatGPT (Codex) account offers under Settings > Models > Image generation model saved nothing. The picker row composed its options from the stored candidate list plus the image model a signed-in vendor account answers with, while the settings page validated the choice against the stored list alone. That list never contains a vendor account's image model — it is not one of the provider's chat models — so the choice was refused and the handler returned silently: no toast, no write, a menu that looked inert. The offer and the acceptance now read one list, composed by imageGenerationPickerCandidates, and one membership rule decides candidate identity for both the picker and the chat-model exclusion. Nothing else changes: an explicitly cleared candidate list is still not resurrected, a missing list still falls back to the legacy single binding, and a signed-out account or another vendor still offers no image model.
This branch was previously deployed
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.
Problem
Settings > Models > Image generation model lists the image model a signed-in
ChatGPT (Codex) account answers with (
gpt-image-2.5,gpt-image-2), butpicking one saved nothing: no toast, no write, and the menu stayed at its
placeholder.
Root cause
A vendor account's image model is deliberately never stored in
provider.models— the account's chat routes do not serve it — so it reachesthe picker only through
vendorAccountImageCandidates(). The picker rowcomposed its options from the stored candidate list plus those vendor
candidates, while
setImageGenerationDefaultvalidated the choice against thestored list alone. With no candidate list stored yet (a fresh install),
settings.imageGenerationModelscontributes nothing,isImageCandidatereturned false, and the handler returned silently.
Reproduced against a local data dir holding a signed-in
OpenAI (ChatGPT Plus/Pro)row (vendorKey: openai-codex,authKind: oauth, credentialpresent) and
imageGeneration: null:Change
components/settings/image-generation-default.ts: newimageGenerationPickerCandidates(stored, active, providers)— the singlecomposition of stored candidates, the legacy single-binding fallback, and a
signed-in vendor account's image model — plus
isImageGenerationPickerCandidate.ImageGenerationModelRow.tsx: renders its options from that helper.ModelConfigPage.tsx: validates the choice against the very same list, andthe chat-model exclusion reuses one membership predicate instead of a local
copy of the same rule.
account and other vendors refused, an explicitly cleared list is not
resurrected, the legacy fallback still applies) and a contract test holds the
row and the page to the same helper. Two stale source assertions were updated.
No other behavior changes: an explicitly cleared candidate list still does not
come back, a missing list still falls back to the legacy single binding, and
the row's availability rules are untouched.
Verification
Task-candidate run in the dedicated worktree on
278e929ca(origin/main):node --test test/*.test.mjs(apps/desktop) → 3591 pass / 0 failtsc -p tsconfig.json --noEmit(apps/desktop) → cleancheck-style-tokens,biome lint,check-architecture,check-agent-policy-sync,check-release-docs,check:pr-base→ passelectron-vite build→ OKNot run: UI E2E (
verify:ui:*); the change is renderer-only and the affectedsurface is covered by the tests above.