My fallback list only held one model

After an outage I added a loop that retries with another LLM. It looked right, it had error handling, and for a month it had nothing to fall back to.

From building GitRoasted

GitRoasted scores a GitHub profile in plain code, then asks an LLM on Groq to write the roast. For a while that was a single call to a single hosted model, with the model's name in the source.

On 2 October 2026, Groq started returning 404 for that model, and every roast failed. There was one path, and it was gone.

The fix that wasn't

I replaced the model and, so the next dead model wouldn't take the site down, wrapped the call in a loop over candidate models. The loop tries each one, logs the failure and moves on. This is the list it looped over:

src/ai/flows/generate-github-roast.ts, October
const preferredModel = process.env.GROQ_MODEL || 'qwen/qwen3.8-27b';
const candidateModels = Array.from(
  new Set([preferredModel, 'qwen/qwen3.8-27b'])
);

When GROQ_MODEL isn't set, the default and the second entry are the same string, and a Set removes duplicates. So the list has exactly one model in it. The retry logic worked. It just had nothing to retry with, and nothing about that fails until the day you need it.

The actual fix

I found it a month later, on 5 November, while reviewing the whole roast path. The change is one more string, from a different family of model:

src/ai/flows/generate-github-roast.ts, now
const candidateModels = Array.from(
  new Set([preferredModel, 'qwen/qwen3.8-27b', 'openai/gpt-oss-20b'])
);

What I took from it

A fallback you've never watched fire is a comment that happens to compile. Reading this code, I saw a list, a loop and error handling, and my brain filed it as handled. What I should have done is make the first model fail on purpose and watch the second one answer. That test would have taken five minutes and failed the same day. It's next on the list.