Skip to content

warn on unknown hero_mode; fix .env.example Replicate default#49

Merged
JonnyFi merged 1 commit intomainfrom
pr/35-36-hero-mode-env
Apr 22, 2026
Merged

warn on unknown hero_mode; fix .env.example Replicate default#49
JonnyFi merged 1 commit intomainfrom
pr/35-36-hero-mode-env

Conversation

@JonnyFi
Copy link
Copy Markdown
Owner

@JonnyFi JonnyFi commented Apr 22, 2026

Summary

Test plan

  • python3 -c "from shared import base_canvas; ..." smoke test locally: unknown mode warns, valid mode is quiet, missing hero_image warns
  • CI: new run-tests.sh cases 2g.7 (hero_mode fallback + warning text) and 2g.8 (.env.example matches replicate.py)
  • Existing advertorial / quote-card / stat-card render tests remain green (valid modes unchanged)

… 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.
@JonnyFi JonnyFi merged commit fc3dd62 into main Apr 22, 2026
1 check passed
@JonnyFi JonnyFi deleted the pr/35-36-hero-mode-env branch April 22, 2026 12:56
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.

.env.example still lists google/nano-banana-2 as Replicate default Unknown hero_mode silently falls back to flat_brand_color

1 participant