Files
magpie/internal/catalog
yetone 21882a68dc providers: a model's list price skips Grok's two name patterns unless it names grok-
/api/providers prices every model of every provider on each poll, and
pricedNames ran grokWindow and grokEffort over each id, lowercasing it
twice. Both patterns need "grok-" in the lowercased id, so any other id
now returns before them; what a Grok id is priced as is unchanged.
pricedOnce's memo key is sized once instead of growing by doublings.

Run (on mote unless named):
- go test -count=1 -timeout 45m ./internal/provider ok (103.8s),
  ./internal/catalog ok; GOOS=linux and windows go vet of both ok;
  gofmt clean (here).
- Broken by hand: the guard narrowed to "grokx-" turns
  TestGrokEffortListPrice, TestCursorGrokFastPrice and
  TestGrokWindowWithoutKListPrice red, so the Grok aliases are covered.
- Here, 200 GET /api/providers on the sandbox with the real config
  copy (offline, proxy :9), against v0.1.2548's tree: pricedNames
  0.28s -> 0.02s, ListPrice 0.63s -> 0.40s; process CPU 4.62s ->
  4.24s, median 20.4ms -> 19.0ms. pricedOnce stayed ~0.20s: its cost
  is the key's bytes, not the growth.

Not run: the full ./... suite; GUI tests (the JSON is the same).
2026-11-01 13:52:21 +08:00
..