Skip to content

test image-gen connection against the provider tab you're on, not the saved default - #3199

Merged
atomantic merged 1 commit into
mainfrom
cos/task-ms5cha9e/agent-36253c1f
Jul 29, 2026
Merged

test image-gen connection against the provider tab you're on, not the saved default#3199
atomantic merged 1 commit into
mainfrom
cos/task-ms5cha9e/agent-36253c1f

Conversation

@atomantic

Copy link
Copy Markdown
Owner

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/status with no ?mode=, so imageGen.checkConnection() fell back to settings.imageGen.mode (the saved default backend) and answered for that instead.

Changes, all in client/src/components/settings/ImageGenTab.jsx:

  • Each provider tab in MEDIA_TABS carries a probeMode, passed to getImageGenStatus(mode). The four non-provider tabs (Backend / Tokens / Expose / Test) carry none and keep probing the saved default.
  • 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.
  • The button tooltip names the backend it will probe.

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 — /status already 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 every IMAGE_GEN_MODE is tagged onto some tab (so a future backend can't silently regress to probing the default).
  • Full client suite green: 476 files / 5326 tests.
  • ESLint clean on both changed files.

… 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.
@atomantic
atomantic merged commit c10e86f into main Jul 29, 2026
6 checks passed
@atomantic
atomantic deleted the cos/task-ms5cha9e/agent-36253c1f branch July 29, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant