Skip to content

fix(media): guard against an invalid/partial default model (v0.138.3)#237

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/bad-model-guard
Jul 13, 2026
Merged

fix(media): guard against an invalid/partial default model (v0.138.3)#237
vikasprogrammer merged 1 commit into
mainfrom
feat/bad-model-guard

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

What

The image_edit end-to-end test on a live session surfaced a real bug: the workspace image_default_model had been left as a half-typed google/ (the model dropdown's onBlur saves free text), which made every image_generate/image_edit fail with a cryptic Atlas 400: not found. Guarded two ways:

  1. Console warning — the image and video default-model fields now flag a value that isn't a known Atlas catalog id: "⚠ '…' isn't a known Atlas model — pick one from the list, or leave blank for the default." Still free-text (Atlas has 400+ models; fal ids are exempt for the video field).
  2. Graceful fallbackAtlasBackend.withModelFallback: if Atlas rejects a model id as not-found/invalid, it retries once with the built-in default (google/nano-banana-2/text-to-image for generate, …/edit for edit, atlascloud/image-upscaler for upscale). The result is tagged fallbackFrom, and the tool response + image.generated/image.edited audit report which bad model was replaced — so the run succeeds and the operator gets a clear "fix the default in Settings" message instead of a dead end.

Verified

  • Live Atlas, in-process: defaultModel: "google/" → rejected → auto-retried with google/nano-banana-2/text-to-image → 742 KB image, fallbackFrom: "google/".
  • Full image_edit e2e had already passed on a real session (researcher): generate → edit (watercolor) → upscale 2×, all gated/metered/audited/in the Library.
  • typecheck, web build, test:governance (68/68) pass.

Server + console + MCP tool text; no schema change.

🤖 Generated with Claude Code

A half-typed default (e.g. "google/") silently broke all image gen with
a cryptic Atlas "not found". Now: (1) the console warns when a default
model isn't a known catalog id (image + video); (2) the Atlas image
backend retries once with the built-in default when a model id is
rejected, tagging fallbackFrom so the tool + audit report the bad model.
Verified live (bad "google/" → auto-retry → success).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vikasprogrammer vikasprogrammer merged commit 811c515 into main Jul 13, 2026
1 check passed
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