Commit Graph
1 Commits
Author SHA1 Message Date
yetone a92e85ab20 provider: a test that WorkBuddy's spent free-token window holds its model only (youjianqiasongshan)
youjianqiasongshan (Discord) has a WorkBuddy Free plan card that shows
积分 500/500, Extra credits 3,406.7/3,750 and Free model tokens 0 of
200,000,000 left. They asked why they can't use the other credits.

The test builds the usage answer workbuddy 0.2.16 gives for that card:
- the plan's credits are used up and set aside (usageOf);
- both credit windows leave the free models out (spareFree, notModels);
- the free model's window is refused, listing deepseek-v4.1-flash and
  -flash-sg (freeWindowOf).
It checks that routing reads this as:
- glm-5.1, kimi-k2.6 and deepseek-v4.1 on Extra credits' share, and
  never used up;
- the two flash ids used up until the window's reset;
- their refusal pooled to the model (Pooled);
- the account not held up and not week-used-up.
The code already does this, so nothing in magpie or the plugin changes.
The gateway rests a "切换其他模型" refusal on that model alone
(otherModels, #1669).

Run at this head (mote): go test -tags nogui ./internal/provider ok, and
gofmt is clean.

Broken by hand: with plugin_usage.go ignoring a window's models list, the
test fails on all three non-free models, on Pooled, on heldUp and on
WeekUsedUp.

Not tried:
- The reporter's real account or usage answer. The fixture is built
  from their card's numbers.
- Whether they turned on "仅免费模型" (Free models only), or pinned
  deepseek-v4.1-flash in their agent. Either one would leave the extra
  credits unused once the free tokens are gone.
2026-11-03 10:39:41 +08:00