test image-gen connection against the provider tab you're on, not the saved default - #3199
Merged
Merged
Conversation
… saved default The Test Connection button in Settings → Image Gen sits in a bar shared by every sub-tab and called /api/image-gen/status with no ?mode=, so the server fell back to settings.imageGen.mode. Testing from the Grok CLI or Agy CLI tab reported the saved default backend — "codex — codex-cli 0.145.0" — which reads as Agy having resolved to the codex binary rather than as never having been probed at all. Each provider tab now carries a probeMode that is passed as ?mode=, and every result is tagged with the tab that requested it and rendered only under that tab, so a probe left in flight across a tab switch can't paint its answer under another provider's panel.
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
Pressing Test Connection on the Grok CLI or Agy CLI tab of Settings → Image Gen reported
codex — codex-cli 0.145.0, which reads as though Agy/Grok had resolved to the codex binary.Nothing was wrong with those probes — they were never run. The button lives in the global save/status bar shared by every sub-tab and called
/api/image-gen/statuswith no?mode=, soimageGen.checkConnection()fell back tosettings.imageGen.mode(the saved default backend) and answered for that instead.Changes, all in
client/src/components/settings/ImageGenTab.jsx:MEDIA_TABScarries aprobeMode, passed togetImageGenStatus(mode). The four non-provider tabs (Backend / Tokens / Expose / Test) carry none and keep probing the saved default.A probe of a disabled provider now truthfully reports "… is disabled in settings" instead of a false green borrowed from whatever was saved as default. No server change —
/statusalready validated and honored?mode=.Follow-up captured in
PLAN.md: the Test tab's Test Render still renders with the saved default mode, so smoke-testing an Agy render still requires making it the default. That needs a provider picker, not a re-target of an existing call.Test plan
client/src/components/settings/ImageGenTab.test.jsx— five new cases: per-tab probe targeting (agy, grok), fallback to the default on non-provider tabs, result hidden after a tab switch, a deferred-promise case proving a late response never surfaces under the tab the user switched to, and an exhaustiveness assertion that everyIMAGE_GEN_MODEis tagged onto some tab (so a future backend can't silently regress to probing the default).