Files
zeekay 301b7c8d76 An Enso or Zen model never stops: its family's free model answers
Owner, 2026-10-26: "enso and enso-auto are the same, and even the other
enso/zen models literally never stop working. They just fall to free
models and keep GOING."

One rule, controllers.Fall (floor.go): a chat on /v1/chat/completions,
/v1/messages or /v1/responses, streamed or whole, naming an Enso or Zen
id that cannot be served for a reason that is not the caller's is
served as the same request by the id's floor, Floor(model): enso-free
for an Enso id, zen-free for a Zen id, read from the family's freeName.
Every refusal point asks it:

- the balance gate: an empty or unreadable wallet and every plan
  refusal of the asked model, for any credential, an API key included;
  the floor is asked again from the top, so what it meets itself stands;
- the handlers' own gate and reservation, chat and messages: a 402, an
  unreadable balance, our cash breaker, an estimate the balance cannot
  cover;
- the family pipe, before a byte reached the caller: 5xx, 429, 402 from
  our vendor account, a timeout, an unreachable family, our family's
  masked "could not serve this request", an unpriced route, a paid lane
  closed to the caller. The floor is always asked once.

What stands: 401, 400, 403, a key's own budget or models, the free
allowance, an unreadable policy, and any refusal the floor meets. A
floor never falls, so a request moves at most once; when the floor
fails too its own status answers, said as the floor's.

The answer is the floor's: X-Hanzo-Fallback and X-Hanzo-Fallback-Reason,
the body's model, X-Hanzo-Served; it bills nothing and carries no plan
spend. A forced tool goes to the floor as "required" over that tool,
then as "auto" with a sentence asking for the call (X-Hanzo-Fallback-
Tools). A stream that breaks off after its first bytes ends with an
error event and is never asked again. Counted in cloud_fallback.

Router ids keep their free SKU under the same exclusions: a key's own
limit now stands for them too.

Testing: go test ./controllers/ ./routers/ (floor_test.go,
filter_balance_floor_test.go; rates, spare, limits and lane tests
updated where the owner's rule replaces the old naming and refusals).
Risk: a paid plan past its usage on an Enso or Zen id is now answered by
the floor rather than refused 429; answers that fell are named and billed
as the floor's.
How to revert: git revert this commit.
2026-10-26 20:42:47 -07:00
..
2026-09-17 11:59:48 -07:00