warn on unknown hero_mode; fix .env.example Replicate default#49
Merged
warn on unknown hero_mode; fix .env.example Replicate default#49
Conversation
… default Closes #35, #36. shared.base_canvas silently rendered flat_brand_color for any unknown hero_mode value — so a typo or intuitive-but-wrong guess like "generated" produced a plausible output with no indication that the intended mode was missing. Dispatch now validates against a VALID_HERO_MODES set and prints a warning to stderr listing the valid options before falling back. Same treatment for "background"/"top_band" without a hero_image path (previously also silent). env.example still advertised google/nano-banana-2 as the Replicate default; the provider defaulted to black-forest-labs/flux-schnell in v0.3.2. Updated the comment + commented-out example.
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
shared.base_canvasnow validateshero_modeagainstVALID_HERO_MODESand warns to stderr before falling back toflat_brand_color— closes Unknown hero_mode silently falls back to flat_brand_color #35 (the silent fallback masked typos like"generated").background/top_bandwhenhero_imageis missing (previously also silent)..env.exampleupdated to advertiseblack-forest-labs/flux-schnellas the Replicate default, matchingreplicate.pysince v0.3.2 — closes .env.example still lists google/nano-banana-2 as Replicate default #36.Test plan
python3 -c "from shared import base_canvas; ..."smoke test locally: unknown mode warns, valid mode is quiet, missing hero_image warnsrun-tests.shcases 2g.7 (hero_mode fallback + warning text) and 2g.8 (.env.example matches replicate.py)advertorial/quote-card/stat-cardrender tests remain green (valid modes unchanged)