Files
Nariman Jelveh b5dc3a797d Continue on a fallback model when Claude declines a request
When Anthropic's safety system declines a request, Puter ends the stream
cleanly with stopReason "refusal" and no text or tool calls. The builder
read that as a finished turn: nothing was saved, no error was shown, and
every later message in the chat was declined (and charged) the same way.

- handleMessageStream throws a model_refusal error on that usage line and
  runs none of the declined reply's tool calls.
- On a paid plan, the turn continues once on Claude Fable 5.2 from the
  work already done (like a transient retry), with a note in the chat. The
  switch is remembered per project in this browser for 30 days, so later
  messages don't pay for another declined request first. Fable is a
  fallback-only model: never in the picker or stored as a project's model.
- Otherwise (free plan, flag off, or the fallback declines too) a card
  says the model's maker declined it and offers "Continue in a new chat":
  a copy of the project with a fresh conversation. The original chat is
  never modified.
- The card is saved as isError: 'refusal'. Every isError check is truthy,
  so older versions show it as a plain error card and strip it before
  sending. No other saved shape changes.
- Kill switch: FEATURE_FLAGS.refusalFallback.
2026-11-13 18:31:38 -07:00
..
2026-09-20 21:34:17 -07:00
2026-10-15 19:33:39 +07:00
2026-11-05 08:15:42 +07:00
2026-09-20 21:34:17 -07:00
2026-11-12 13:02:30 +07:00
2026-09-20 21:34:17 -07:00
2026-11-12 13:02:30 +07:00
2026-10-23 22:24:38 +07:00
2026-09-20 21:34:17 -07:00
2026-09-20 21:34:17 -07:00
2026-11-03 17:31:13 -07:00
2026-09-20 21:34:17 -07:00
2026-09-20 21:34:17 -07:00
2026-10-29 20:03:36 +07:00
2026-09-20 21:34:17 -07:00
2026-10-15 19:33:39 +07:00
2026-09-20 21:34:17 -07:00
2026-09-20 21:34:17 -07:00
2026-09-20 21:34:17 -07:00
2026-09-20 21:34:17 -07:00
2026-09-20 21:34:17 -07:00
2026-09-20 21:34:17 -07:00