Files
magpie/docs
yetone f2b0780fa2 gateway: a held rule fails over within the member it chose, and a fallback outside it isn't kept for the turn (#1946, XcodeFish)
A group of coding-fast and coding-quality, its rule sending turns to
coding-quality: when coding-quality's member failed mid-turn the request
went to coding-fast's members before coding-quality's other one, and the
turn then stayed on coding-fast. Within a turn the rule is held, and
when affinity kept a member the rule's order wasn't applied at all
(gateway.go and nestedRules skipped `hit.Held && aff.Kept`), so the
failover order was the kept one, then the parent's own order.

ruleOver (rules.go), used at the group's rule and every nested group's:
- the kept one stays first while it is of the rule's member that goes
  first (the one it names, or a Then's while that is resting); the
  rule's other members follow it, ahead of the group's others;
- one kept outside that member, which took over when it failed, isn't
  held: once a member of the rule's target is out of its rest, the next
  request of the turn goes back to it (Affinity.Why "rule"). While all of
  it rests, the fallback stays. No new option.
docs/subsystems/gateway-routing.md says so.

Run (before the rebase onto origin/main): go test -tags nogui -count=1 ./internal/gateway/: green but for
TestKimiHeldBurstTellsNoSpeed at load average ~139 (passes 3 of 3
alone; filed as #1963, not on this path),
gofmt -l, GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gateway/.
TestHeldRuleFailsOverWithinItsMember fails on the old code (tried
[kq1 kf1], the reporter's order), and with the go-back part disabled by
hand (round 3 kept on f1).

After the rebase: gofmt, both vets, and go test -run
'Rule|Group|Affin|Nested|Stick|Turn|Classif|Decide|Pause' ./internal/gateway/ green.
2026-10-13 16:18:05 +08:00
..