Files
magpie/site
yetone 333c167575 routing: a rule can set the reasoning its model is asked for (#2633)
dengtongcai asked for a routing rule that picks both the model and the
reasoning it is asked for (a quick question goes to a cheap model at low).
A rule now has an output field, useEffort (low|medium|high|xhigh|max). When
the rule matches, its member is asked for that effort. A member's own fixed
effort still wins. Otherwise the rule beats the model's suffix, the turn's
pick and the agent's pick. The existing effort condition is unchanged.

- The value is fitted to the model's levels (max -> high on a model that
  tops out at high). A model with no Efforts is sent what the agent asked,
  untouched. Unset changes nothing. Failover members are not affected.
- The trace records it: Rule.UseEffort and the try's RuleEffort (the second
  Try construction in the candidate loop was missing it).
- Saving a group rejects an unknown value or one on a pause (cleanRules).
  The CLI takes use-effort=; the TUI and CLI lists show " at <effort>".
- GUI: a chip after the rule's model, picked from the app menu (pickFrom,
  no native select), set/changed from the rule's menu. A pause clears it.
  Strings in zh, zh-TW, ja, de.
- A Gemini-protocol client is left unchanged, as with every effort magpie
  sets.
- Docs: docs/subsystems/gateway-routing.md; site docs intent and start (en,
  zh, ja).

What was run, at d4c03a2c5 (rebased on d4a1b9baa) unless said:
- gofmt -l: none. go vet ./... (darwin), GOOS=linux and GOOS=windows
  go vet -tags nogui ./...: clean.
- go test -count=1 ./internal/gateway ./internal/provider ./internal/cli
  ./internal/tui: ok.
- The full go test -timeout 45m ./... under pipefail, before the rebase at
  6f950653f: every package ok except internal/gui. There, 8 real-window
  darwin tests were killed at their deadlines with the load average at
  150-300. Four passed on a rerun. TestMainWindowCorners,
  TestMainWindowRightToLeft, TestTrayCellClickReleasedPanel and
  TestCoveredWindowStaysUp fail the same way on a clean 6f950653f checkout
  (added to #1936). This change has no Go in internal/gui.
- Broken by hand: ruleEffort returning "" turns the four gateway tests red
  (Chat member, intent rule, failover member, Anthropic member). Returning
  the raw value for a model with no levels turns the unset/no-levels test
  red. Dropping the cleanRules checks turns TestCleanRulesUseEffort red.
  routing-rule-effort.test.cjs against the 6f950653f routing client.js and
  i18n.js is red.
- GUI: routing-rule-effort.test.cjs passes 18/18 in chromium and webkit
  (en, zh, zh-TW, ja, de; 1100 and 420 wide). The 140 GUI files that open
  the Routing view ran 560 tests before the run stopped with no summary.
  Two of the 560 were red: group-from-model-add (#2388) and
  name-suffix-where-named (filed #2640, a skeleton-row race). Both pass
  alone. The whole 791-file suite was not finished. At a load near 280 it
  covered about 20 files in 40 minutes. The reds it showed were in
  account-* files, and account-models passes 12/12 alone.
- Then rebased onto 8bb9375e7 (#2635, internal/library only) and
  go build ./... at the final head.
2026-10-17 10:04:39 +08:00
..