1ccacad63281094de8a3372d5a507d38f9969e5c
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9cdeb485bb |
gateway: a limit that names one model rests that model, not the whole key (WJaunita45604 on X)
A 429 or quota refusal whose body names the model asked (Groq's per-model TPD, OpenAI's per-model TPM, Gemini's QuotaFailure, any vendor's "limit for model X") used to rest the account's key, so every other model of the provider waited. modelNamed (routing.go) now sends such a refusal down the same path as modelCooledDown: it rests restID (key/model). Readers of rest state (restingOf, sink, GUI badges via Rest.Model) already understood those. Account-wide refusals (no model named, another model named, credit, auth) still rest the key. The id match is on whole ids (gpt-4o is not gpt-4o-mini). Cline's and ZCode's guard tests expected another vendor's words to rest the key even when they named the very model; they now expect the model alone. The "not a trial" ZCode row moved to the new test. Run (mote): the new TestModelNamedLimitRestsTheModelNotTheKey, TestLimitNamingNoModelRestsTheKey and TestModelNamedReads, red on the old code (mr-red.log); gateway tests matching Rest|Rate|Quota|Fallback|Limit| Cooled|Pool|Overload|Sink|Credit|ZCode|Cline; gofmt; darwin, linux and windows go vet of internal/gateway. Broken by hand: modelLimited back to modelCooledDown only, the new tests go red. Not tried: a real vendor account; the full suite (started after the tag). |
||
|
|
5068e46fb6 |
provider: raise ZCode's plugin min to 0.1.58; a coding plan's 1310 leaves the trials (plugins#438)
takomitkm (plugins#438) hit two problems. The busy hold armed with one account and one agent. A GLM Coding Plan model's weekly or monthly limit (1310) also rested the whole account, so its -Trial models got the cached 1310 without being asked. zcode 0.1.58 (ea3573bf in the plugins repo, on npm) fixes the first in the plugin and lists the -Trial entries free. magpie's PaidBesideFree then rests only the refused coding-plan model. Raising the min brings every moved user up to 0.1.58. TestZCodeCodingPlanLimitLeavesTrials holds both sides. With the trials free, the 1310 rests GLM-5.3 alone and GLM-5.3-Trial is still sent. With no free entries, or with another vendor, the same refusal still rests the account. The fake plugin's $FAKE_ZCODE_FREE marks the trials free, as 0.1.58 does. Run (mote): go test ./internal/gateway -run 'TestZCode' -count=1, ok; go test ./internal/provider ./internal/plugin -count=1, ok; go vet of the three packages on mote, in WSL (magpie-desktop) and on Windows (xiaomi-gpu), ok; gofmt -l is clean. All of this at this head, rebased on origin/main. A whole-tree Linux vet in WSL stops at Wails' cgo (webkitgtk-6.0 and gtk4 aren't installed there), so it doesn't cover the GUI. Broken by hand: with the fake's free mark dropped, the zcode 0.1.58 subtest fails, because the 1310 rests the account key. Not tried: a real dual ZCode account that has reached its weekly limit. Reported-by: takomitkm |
||
|
|
0978a68681 |
gateway: a ZCode trial entry's 3012 rests that entry, not the account
young02036 (Discord, 11-07): on an account with a GLM Coding Plan, GLM-5.3-Flash-Trial answered 405 code 3012 (ZCode's risk control) while the account's paid models worked. The plugin's 3012 words read as failRestricted, which rested the whole account for two hours (restrictedRest), so magpie stopped sending the paid models the account still served. A -Trial entry goes to zcode.z.ai's Start Plan, and a dual account's plain models to its GLM Coding Plan on api.z.ai, so the 3012 is zcode.z.ai's: zcodeTrialRestricted rests the entry alone (restID), as zcodeTrialBlocked already does for the edge block page. On a gift-only account the plain model goes to zcode.z.ai too, gets its own 3012 and rests the account, at the cost of that one more refused request per rest. riskRefused still walls the provider's other accounts off for the rest of the request. TestZCodeTrialRefusalRestsTheTrialAlone: "trial risk control" now wants the entry's rest and the account's GLM-5.3 served after it; new cases "plain risk control" and "another vendor's risk control" want the account's rest. docs/subsystems/gateway-routing.md says so. Run (mote): go test -count=1 -run 'TestZCode|TestRisk|TestRestricted|TestMovedZCode' ./internal/gateway/ ok; gofmt -l clean; GOOS=linux and GOOS=windows go vet ./internal/gateway/ ok. Broken by hand: the routing.go check removed, trial_risk_control red (rested "zcode@api key", want ".../GLM-5.3-Flash-Trial"), then restored. Not tried: a real 3012 account (the reporter's); the full suite runs after this push. Reported-by: young02036 |
||
|
|
e2d52b5012 |
provider: ZCode's mover min is 0.1.49, whose -Trial entry is no longer answered "quota exhausted" after a free-first refusal (Can4ry_ on X)
Can4ry_ on X: GLM-5.3-Flash-Trial answered "429 · ZCode's limited quota
for glm-5.3-flash is exhausted or temporarily unavailable" in magpie while
ZCode's own app was served. The plain GLM-5.3-Flash also kept going to
the Coding Plan after the Start Plan opened at 23:00. And there was no
freeFirst under Providers › ZCode.
zcode 0.1.49 (plugins 36a017a):
- A free-first gift refusal that isn't a quota answer (405/3012) now
rests only free first's use of the model. Before, it shared the rest a
-Trial entry obeys, so the Trial answered a local 429 without asking
ZCode.
- The local 429 keeps the spent words last. 0.1.48 appended "(ZCode
answered 429 …)" after them, so zcodeSpentWords didn't match and the
account rested whole.
- free first is a switch, "Free quota first", in the provider's editor
under Plugin options, just above Advanced (auth.options free_first,
on by default).
keepMovedCurrent updates every moved user to 0.1.49.
The gateway test gets 0.1.49's rested wording, which rests the Trial
entry alone, and 0.1.48's, which rested the account.
Correction to plugins 36a017a's body: its old-code block-page test
fails because the old code has no `sidelined` map. Its second plain
request did not go to the gift again.
Run on mote, at this tree (rebased on origin/main
|
||
|
|
394a92f0f3 |
gateway: a ZCode trial entry zcode.z.ai's firewall blocks rests alone
A -Trial entry goes to zcode.z.ai's Start Plan only. On an account with a GLM Coding Plan too, the plain models go to api.z.ai, which kept answering while zcode.z.ai served its block page (jinpy666, plugins#545). The block page on a Trial rested the whole account, so the coding plan's models stopped too. zcodeTrialBlocked now rests such a refusal on the account/model, like the Trial refusals of #3661. Unchanged: the block page on a plain model still rests the account (on a gift-only account, windy_66454's, the plain model is the same gift on the same host), 3012 risk control rests the account as restricted, and another vendor's block page rests its account. Run (mote, at this tree): - TestZCodeTrialRefusalRestsTheTrialAlone's new "trial edge block" case: red without the routing.go line (rested "zcode@api key", want "zcode@api key/GLM-5.3-Flash-Trial"), green now; "plain edge block", "trial risk control" and "another vendor's block" rest the account. - go test ./internal/gateway -run 'ZCode|Edge|Relay|Restricted|WorkBuddy|Blocked|Refusal': ok. - gofmt -l clean; go vet darwin/linux/windows ok. Not tried: a real dual account while zcode.z.ai blocks. |
||
|
|
65ee8c65c6 |
gateway: a ZCode Start Plan trial that ended or is spent rests that trial alone, not the account (#3661)
orion-nebula-dev's routing log: GLM-5.3-Flash-Trial and GLM-5.3-Trial,
whose Start Plan trial had ended, were refused by the ZCode plugin with
400 "ZCode has no active limited quota for GLM-5.3-Trial". The word
"quota" made it failQuota, and restAfterMarked rested the account
("zcode@zcode"), so the subscription's GLM-5.3 and GLM-5.3-Flash were
paused with it.
zcodeTrialRefused narrows that rest to the trial entry (restID) when the
candidate is a zcode plugin account, the model ends in -Trial, and the
refusal is the plugin's own words naming that model:
- 400 "ZCode has no active limited quota for <model>" (the trial ended);
- 429 "ZCode's limited quota for <bucket> is exhausted or temporarily
unavailable", where the bucket is the entry less -Trial (its bucket
spent). skygunner's patch covered the 400 only and kept this 429 as an
account rest; it is the trial bucket's, given by the plugin before
anything is sent, so it rests the entry too.
Another model named, a model without -Trial, the ended words on a 429,
the account's own quota (400 or 429) or key (401), and the same words
from another vendor still rest the account.
The plugin is not changed: zcode 0.1.31 already leaves ended trials out
of its model list and its two refusals are exact, and open plugins PRs
#395 and #421 hold zcode's next version. A member the user kept in a
group is still asked, refused locally, and asked again a minute on (a
guessed quota rest); the Routing page strikes such a member as
"skipped", which the gateway doesn't do: filed as #3805.
Ported from skygunner's e04a1b994 (branch
fix/r25-expired-model-not-account-fault): the test plugin's
FAKE_ZCODE_TRIAL and FAKE_NO_FREE fixture is his; the matcher, the 429
case and the test were rewritten. Reported by orion-nebula-dev.
Run:
- TestZCodeTrialRefusalRestsTheTrialAlone: 12 cases, the reporter's
literal plugin bodies. Each posts to a group of the trial then another
provider, checks the try's rest key, then posts to a group of the
account's GLM-5.3 then another provider: served by the account when
only the trial rests, by the other provider when the account does.
- Broken by hand: the routing.go hook off -> the four trial cases red
("refusal rested \"zcode@api key\", want \"zcode@api key/GLM-5.3-Trial\"");
the 429 branch off -> "trial spent" red; the zcode-only check off ->
"another vendor's words" red. Green again after each.
- gofmt -l clean; go vet ./... on darwin, GOOS=linux -tags nogui and
GOOS=windows; GOOS=linux go build -tags nogui ./...
- go test -timeout 45m -count=1 ./internal/gateway ./internal/plugin at
f34a9f8cf (this change on
|