WorkBuddy's /v3/config prices a model by its "credits" and by a
modelPromotions list the picker reads for its badges: Hy3 限时免费 (whole
days to 10-31), Step-5-Preview 独家限免 (10-12..10-25), Hy4 preview 夜间免费
(free 23:00–8:00 only), GLM-5.2 and DeepSeek 夜间折扣. The plugin read only
"credits", and magpie keeps a plugin's model list until it next asks, so a
list read at night said Hy4 preview was free all day (#121's screenshot:
免费 in magpie, 0.29x and 夜间免费 in WorkBuddy).
priceOf now reads both. A model under a promotion with daily hours is given
at its full price and never as free (unpriced when the credits read 0 under
a night discount). A running whole-day discount is the price now, with the
credits before it as rateWas, which magpie already shows struck through.
Run:
- bun test across the repo (TMPDIR+HOME in the scratchpad): 1219 pass. The
new price.test.mjs, built from the promotions copilot.tencent.com gave on
2026-10-14, fails 3 on the old code.
- The owner's real WorkBuddy and WorkBuddy AI accounts through liveModels
(17:10 CST): Hy4 preview 0.29, Hy3 and Step-5-Preview free, the rest at
their credits, matching WorkBuddy's picker.
Not tried: the config as served at night (whether "credits" itself reads
x0.00 then); the unpriced branch covers that case.