f2eb56c6bbde1300dddc402861b59cd4e45e0215
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
1390aa458f |
provider: a usage window's count is its share when used is left out (plugins#468)
A plugin window that sent amount and limit but no used was text alone (Text, Aside), and an account whose windows all did so was unknown to routing, weighed behind accounts it should beat. quotaOfPlugin now fills Used from amount/limit when both are above 0 and used is absent: 370 of 1000 is 37. An amount of 0 is what a left-out amount reads as, so a limit alone still says nothing (#3650 unchanged). aside still keeps a window out of routing whatever its count. amount is the amount used: the guide ("amount of limit used") and host.js's usageOf say so, and every community plugin that sends it (magpie-community/plugins 95fa761) sends the used count, never what is left: codearts (limit - remain), joycode (item.used), kiro, minimax (total - left), raccoon (granted - avail), cloudflare-workers-ai, cline (used, or total - remaining), zcode (used, total - remaining, or currentValue), gcp-ai (credits.used), copilot (limit - remaining), trae, workbuddy. None reaches the new path: each of these windows sends a finite used beside amount/limit. The one that can leave used out, cloudflare-workers-ai with no Analytics reading, sends amount null, which reads as 0, so its window stays text as before. The path is for plugins outside the community repo (GitHub-tagged or local) that send a count and no share. Run (mote, at this tree): gofmt -l clean; vet on three OSes; go test -tags nogui -timeout 45m ./... (go test -tags nogui -timeout 45m ./... at base |
||
|
|
9733ed1b4a |
usage: a plugin window that doesn't say used is no reading (#3650)
A plugin usage window that leaves out `used` was read as 0 in host.js
usageOf. The card then showed "100% left" (or NaN% once the GUI saw a
missing value), and allowanceOf ranked the account as the one with all
of its allowance left, so smart routing put spent accounts first.
Now a left-out used is null from the host, plugin.UsageWindow.Used is a
*float64, and quotaOfPlugin makes such a window Text and Aside: the card
shows its display (else "No allowance reported"), with no percentage and
no meter, and routing leaves it out. An account whose windows all tell no
share has no allowance and is not known to routing (routedAllowance), as
one never read: not preferred and not rested. A window that says used:0
is a reading at 0, as before.
Ported from skygunner's fix/usage-absent-used (6791aa99). Changed from
the branch:
- lastAllowances (the reading kept on disk) built an empty allowance for
such an account, which routing read as known with all of it left. Both
it and Allowances now go through routedAllowance.
- quotaText shows "No allowance reported" for a no-share window with no
display, rather than a blank.
- A host-level test (the bun host with the fake plugin) and the GUI test
widened to both engines, every language, 900 and 390px, used and left.
- The branch's check-in wording change is its own commit.
Note: an account whose windows are all aside or text was known with 0%
used before; it is now not known, so loginRoom won't pick it as the
next account with room.
Run at this tree (base
|