fix(media): guard against an invalid/partial default model (v0.138.3)#237
Merged
Conversation
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>
d242d68 to
04d69bf
Compare
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.
What
The
image_editend-to-end test on a live session surfaced a real bug: the workspaceimage_default_modelhad been left as a half-typedgoogle/(the model dropdown's onBlur saves free text), which made everyimage_generate/image_editfail with a cryptic Atlas400: not found. Guarded two ways:AtlasBackend.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-imagefor generate,…/editfor edit,atlascloud/image-upscalerfor upscale). The result is taggedfallbackFrom, and the tool response +image.generated/image.editedaudit 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
defaultModel: "google/"→ rejected → auto-retried withgoogle/nano-banana-2/text-to-image→ 742 KB image,fallbackFrom: "google/".image_edite2e had already passed on a real session (researcher): generate → edit (watercolor) → upscale 2×, all gated/metered/audited/in the Library.typecheck, webbuild,test:governance(68/68) pass.Server + console + MCP tool text; no schema change.
🤖 Generated with Claude Code