Files
magpie/docs
yetone 1ad60446ff gateway: a model failing between its siblings' answers climbs its own rest ladder, not a minute forever (#2241, weizsw)
The backoff count was kept per account (restKey), and any model's answer
cleared it. On an account serving several models, a model that kept
failing while its siblings answered was counted 1 every time and rested
one minute, forever. weizsw's Antigravity seat: 41 of 43 rests at
failures: 1.

restAfterMarked now also counts each model's own failures (restID), and
only that model's answer clears that count (servedCandidate). When a
model's own count is past the account's, a sibling answered since the
model last did, so the failure belongs to the model. It climbs its own
ladder (1, 2, 4, 8, 10 minutes) and rests alone, keyed by restID, while
its siblings stay served. If every model fails with no answer between
them, the account still climbs and rests whole, as before. A window
rest wins as before. A candidate naming no model keeps the account's
count alone.

What was run:
- TestModelLadderClimbsPastSiblingAnswers (new, model_ladder_test.go).
  Old code: FAIL ("failure #2 after a sibling's answer: 1 failures,
  rests 59.99s; want 2m0s"). With the restID choice taken out by hand:
  FAIL ("rests antigravity@seat@example.com, want the model alone").
  With the fix: pass.
- The first full run caught TestSmartRouting. Its modelless candidate
  ("t#fail") was given a "t#fail/" count that its served() call never
  cleared. Fixed by counting per model only when the candidate names
  one. TestSmartRouting and the rest/ladder tests pass.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui and GOOS=windows
  clean.
- HOME=<scratch> go test -tags nogui -timeout 40m ./...: every package ok
  except gateway's TestSmartRouting (above). After the fix, gateway was
  rerun whole: ok (468s).
2026-10-15 03:25:41 +08:00
..