ac4af582301a4e8a29245dbba767eba31334ddf9
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
78c92bb852 |
provider, gateway: a rest the vendor gave the time of keeps till it ends, and the reading that lifted it does not bring the image picker back to the account (#2718)
What changed:
A refusal that says when its quota comes back (ChatGPT's resets_at, or
a Retry-After: restAfterMarked keeps it by "resets" or "retry-after")
rested the account till then, but the rest did not keep. Every failure
asks the usage read again (staleAllowance), and when the reading came
back finding the window less than full — which the vendor's own usage
endpoint can say while its refusal stands — renewedFrom read it as full
till sooner, and renewed lifted the rest. The account went first in its
group and was refused again, every few minutes, all saying the same
reset: parkavenue9639 counted 11 such tries in 92 minutes, and 21 more
from magpie's own image descriptions, without one gaining anything.
What a reading may lift is now told from what only a window truly
starting again may. Allowances still tells renewed by renewedFrom, and
renewed lifts by it what no vendor gave the time of (by "quota",
"window"): unchanged. A new startedAgain says whether a window full at
the last reading — a pool of some models as much as the whole account's
— has its reset gone by, or stands a new, later cycle: the two ways a
window really restarted. Allowances tells that to a second hook
(OnStarted), which alone lifts what the vendor itself timed ("resets",
"retry-after"). A reset spent tells both hooks (renewedNow), and lifts
at once, as before. A Claude account whose /usage finds its five hours
started again before Claude Code's word said is told by the new read's
reset standing a new cycle, and its rest is lifted as it was. A key's
own readings tell the two the same way (keyAllowance's keep returns
both).
AutoVision needed nothing of its own: it has kept off a resting
describer since #1801 (spentModel counts a quota rest as spent, and
autoSpent asks none "until one is back"). Its 21 refusals in the report
were this lifting: the rest gone, the pick went back to the refused
account, and the next image asked it again. The test drives both: with
the rest standing, a reading that finds the window at 80% with the same
reset lifts nothing, and AutoVision keeps the other describer.
Run: TestReadingKeepsARefusalsRest,
TestAutoVisionKeepsOffARefusedAccount red on
|
||
|
|
8cb0946fbe |
gateway: a Factory usage-limit 402 that arrives before the account's windows are read rests only that model once they are (#2036, Ziqi-Cui)
#1979 rests only the model when Factory answers 402 "You've reached your weekly standard usage limit" and the account's windows say Standard's pool is the one used up. Before the windows are read (just after a start, or after a reading failed) nothing tells the pool from the account, so the whole account rested, Droid Core's models with it, until the reset the refusal named, often days. Such a rest now starts narrowWhenRead in the background: it waits for a reading (provider.AwaitAllowance, up to a minute), and if the reading says the model's pool is the one used up, moves the rest to the model alone (restID) with the same end. No reading in time, a reading that says the whole account, or a rest lifted or made again meanwhile leaves the account's rest as it is. CodeAlex52's patch (c623610) waited for the reading inside the request for up to 10s. That holds the failover the client is waiting on, so the wait is off the request instead: the request has failed over already, and the rest's scope only matters to later ones. The gateway's TestMain turns the wait off so no test's goroutine asks a fake upstream after the test ends; the tests that need it swap it in and wait on narrowing. Run: TestFactoryStandardOutLeavesCore's new unread case (built-in and plugin windows) and TestResetsInWords' no-reading case; the unread case fails with the narrowing removed; -race -count=3 on both; full go test -tags nogui ./internal/gateway in a sandbox HOME; gofmt -l clean; go vet darwin, linux nogui, windows nogui. docs/subsystems/gateway-routing.md's 402 paragraph says so. |
||
|
|
0337ce4bc7 |
factory: Haiku 5.5 and Mistral Large 4, in droid 0.240.0's picker, are offered, and moved users get plugin 0.1.25 (JL on Discord)
JL (Windows, droid 0.240.0, Factory desktop 0.197.1, magpie 0.1.1226, opencode-factory-auth 0.1.24): droid and Factory desktop offer claude-haiku-5-5; droid through magpie couldn't pick it. droid's models are the registry bundled in its npm binary (@factory/cli-<platform> 0.240.0, bin/droid). Against 0.233.0's registry, 0.240.0 adds claude-haiku-5-5, mistral-large-4 and gpt-6-astra-ultrafast. The plugin (magpie-community/plugins e4023d9, published as 0.1.25, npm view checked) now offers Haiku 5.5 (Anthropic Messages, 872000/128000, efforts low..max) and Mistral Large 4 (chat completions, x-api-provider mistral, Droid Core, 524288/64000, images). GPT-6 Astra Ultra Fast stays out: droid offers it only once the user accepts Factory's high-cost terms. - migrate_factory.go: the mover's min is 0.1.25, so keepMovedCurrent updates moved users (JL is on the plugin). - factory.go: the built-in had the same gap; its table gets the same two rows for users who haven't moved. - factory_pool_rest_test.go: the plugin's Core list, copied from its usage, gains Mistral Large 4. - TestFactoryDroid0240Models is new; its fixture is droid 0.240.0's registry bytes (the same as the plugin's models.test.mjs). It fails with the Haiku 5.5 row removed. Run, under a temp HOME: go test -tags nogui ./... with the machine at load 35-190 (other sessions). Every package passed except five that hit the 10m timeout mid-test (agent, gateway, library, plugin, provider, in tests that don't touch Factory). Rerun with -timeout 40m: provider ok; gateway still timed out at load ~130 (TestCodexHeardWithinItsIdleTimeout failed on its timing, unrelated); -run 'Factory|Moved' on gateway ok. agent, library and plugin were not rerun to the end; this change doesn't touch them. gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui on internal/provider and internal/gateway ok. Not tried against Factory itself (no Factory account here); droid was read, not run. |
||
|
|
af39ee4b5f |
gateway: a 402 for a usage limit rests the model out of quota, until the window renews (#1979)
Factory answers a Standard pool used up with 402 "You've reached your weekly standard usage limit (resets in 0h 19min). Switch to Droid Core ...". failure() read every 402 as out of credit, so the whole account rested a fixed 30 minutes: its Droid Core models (GLM-5.3, the reporter's fallback) were skipped with it, the "resets in" was ignored, and renewed() never lifted the rest when the window came back, since it lifts only failQuota or By=="window" rests (Ziqi-Cui, 09:16Z). - failure(): a 402 that matches usedUpWords and says nothing of money (creditWords, insufficient_quota) is failQuota. A payment 402, an empty one, Kiro's monthly count, Command Code's credits stay credit. - With failQuota the pooled check applies: Factory's Standard windows are scoped away from Core (built-in factoryQuota matches; the plugin's notModels/models through quotaOfPlugin), so only the model rests, and only until its window's end. - resetsAt also reads "resets in Xd Yh Zmin" (resetsAfter) when no windows are known, capped at longestWritten. - FactoryAllowanceForTest / PluginAllowanceForTest let the gateway test build both paths' allowances from their real payloads. Run: TestFactoryStandardOutLeavesCore (built-in and plugin:factory), TestPaymentRequiredReadByItsWords, TestResetsInWords; full internal/gateway (327s) and internal/provider ok; gofmt -l; go vet darwin, windows, linux -tags nogui. Broken by hand: the new failure() case removed -> both subtests red (account rested for credit, GLM resting); resetsAfter returning 0 -> TestResetsInWords red; quotaOfPlugin's notModels ignored -> plugin subtest red. Not tried: a live Factory account; Factory's Droid Core used-up wording is assumed to read like Standard's. |