Files
magpie/internal
ggbdpq 30f7ad0462 provider: a Grok window the id names without a k is signed and priced as its model
grokContextModels offers each window Grok lists beside the default as
<id>@<N>k, and grokWindowLabel writes a window that is no multiple of
1000 as bare digits (131072). grokWindowed took any size without the k
for no window at all: such an id went to Grok verbatim, as
x-grok-model-override "grok-4.7@131072" with no x-grok-context-window —
a model id Grok doesn't list — and pricedNames's grokWindow gave it no
price either.

What changed
- grokWindowed reads a bare-digit size as the window itself, as the
  label writes it; a k still means thousands.
- grokWindow (pricedNames) takes the window without the k too, so the
  id is priced as its model, as grok-4.7@500k is.

What was run
- New TestGrokSignsWindowWithoutK and TestGrokWindowWithoutKListPrice
  fail on the old code (the id sent verbatim as the override, no window
  header; ListPrice and MakerPrice give nothing) and pass with the
  change.
- go test -tags nogui -count=1 ./internal/provider ok; -race -count=5
  on the Grok tests ok.
- gofmt -l internal/ clean; go vet ./..., GOOS=linux go vet -tags nogui
  ./... and GOOS=windows go vet ./... clean but the known
  trayimage_darwin.go cgo -Wenum-conversion warning; go build,
  GOOS=linux go build -tags nogui and GOOS=windows go build ok;
  go test -tags nogui -count=1 ./... green under a temp HOME
  (TestPluginListSaysMiddleware once hit its 60s bound under the full
  run and passes alone and on a second full run; unrelated to this).
2026-10-13 10:40:35 +08:00
..
…
…