Files
magpie/internal/cli
yetone 6bffcfe178 gateway-key: a key's monthly limit can be set from the CLI again
`magpie gateway-key limit <id> month --cost 5` (and `add month`) failed
with "an N-hour cycle is a whole number of hours …: \"month\"":
parseKeyLimit cut an h off any window ending in one before it looked
for a named period, and month ends in an h. A named period (day, week,
month) is now taken as itself before the <N>d and <N>h forms are read.
Found while trying every command for the magpie-setup skill in a
sandbox HOME.

Run: go test ./internal/cli -run TestGatewayKey -count=1 ok; the new
month cases in TestGatewayKeyLimitCLI fail on the old parseKeyLimit
(reverted by hand) and pass with it. Tried the built binary in a
sandbox HOME: limit <id> month --cost 5 sets "this month".
2026-10-25 19:34:55 +08:00
..