Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.
gateway: a 429 per minute that calls itself a quota rests as a rate limit
yetoned83f887a7419
diff --git a/docs/subsystems/gateway-routing.md b/docs/subsystems/gateway-routing.mdindex 6fd072b81..c5cc65e30 100644--- a/docs/subsystems/gateway-routing.md+++ b/docs/subsystems/gateway-routing.md@@ -210,6 +210,7 @@ recorded as a prediction failure (`noPrediction`).- A 429 that says in words it is back within `soonest` (`PatienceLongest`, 240s) is a rate limit (`failRate`), whatever plan words it has besides, unless it speaks of money (`creditWords`): `backSoon` reads `resetsAfter` (now with seconds and Chinese minutes, `soonWords`: "try again in 30 seconds", "请 1 分钟后重试") and `tryAgainIn`. A LAN aggregator's "Usage has exceeded the frequency limit. We will switch you to another model. Your usage limit for the original model will reset in 1 minutes." read as a plan used up ("usage limit") and reached the agent at once; now it is `busy`, rests the minute it says (`rateRest` reads `resetsAt`), and a lone provider waits it out within its patience (zoecats on Discord; `TestShortResetIsARateLimit`, `TestShortResetRestsWhatItSays`, `TestSingleProviderWaitsOutAFrequencyLimit`). One that says hours is still out of quota and not waited (`TestSingleProviderPassesALongLimitThrough`). "Frequency limit" is a rate word, as 频率 is.- A 5xx is a server error, not quota, unless the vendor's own quota code says so (`quotaCodes`: `usage_limit_reached`, `RESOURCE_EXHAUSTED`, Claude Code's `usage limit reached|<unix>`). A relay's 500 "当前模型 gpt-5.5 负载已经达到上限,请稍后重试" names its load, not the key's allowance: it was read as out of quota by `usedUpWords` (上限), which rested the key till a reset and kept a group's Patience from waiting it out (#1418). The quota words (`usedUpWords`) still apply to a 4xx.- A 429 that names in words when the account is back (WorkBuddy's "将在 2026-10-11 20:16:02 UTC+8重置" and "your usage will reset at 2026-10-11 12:37:53 UTC+8, …", #1669; Volcengine Ark's "You have exceeded the monthly usage quota. It will reset at 2026-10-25 23:59:59 +0800 CST.", #3251, #3276) is out of quota in either language (`resetsWhen`), and rests until that time (`resetsWritten`, read in the offset written). Only the reset phrasing right beside a whole date and time with its UTC/GMT offset, or its offset as Go prints one (four digits, then the zone's name, which isn't read), followed by 重置 or punctuation, is read, so a refusal cut short isn't read as UTC and another vendor's date in passing is no reset; a time past, not a real date, or further off than `longestSaid` isn't read: `longestWritten` (7 days), or `longestMonthly` (35 days) when the refusal says its allowance is a month's (`monthlyWords`: Ark's, Zhipu's 1310 "Weekly/Monthly Limit Exhausted"). Such a reset is the one rest out of quota held past `longestQuota`, to `longestMonthly`; a window read full or the user's own rest is still held to 8 days (`TestMonthlyWrittenResetRestsTheMonth`). Ark's windows as its AccessKey reads them (`volcPlanQuotas`) still reach only its usage card, not routing (#3251). Zhipu's 1308 and 1310 (Z.ai and bigmodel.cn, GLM Coding Plan: "Your limit will reset at 2026-10-15 20:12:13", "您的限额将在 … 重置") write the time with no zone; it is Beijing's, and is read as UTC+8 in those words only (`zhipuResets`, `resetsZhipu`), never when a digit, colon or zone of its own follows (Player on Discord: read by nothing, the key rested `quotaRest` and the refusal said "not asked again before 17:12" while Z.ai said 20:12; `TestZhipuRestsUntilItsReset`). One that points to the account's other models (`otherModels`: "切换其他模型", "switch to the other models") rests that model alone (`restID`). Out of credit or quota on a model that costs credits, where the subscription serves other models free (`catalog.Model.Free`: WorkBuddy's x0.00, Qoder's is_free, Cline's free models; `Provider.PaidBesideFree`), rests that model alone too: the free ones draw on no credits (Creat.wu on Discord, `TestOutOfCreditLeavesFreeModels`). A Credits window leaves the free models out the same way, so an account at 100% isn't ranked spent for them: the WorkBuddy plugin's lists them as `notModels` (0.1.23), and the built-in's scopes itself by the provider's last fetched list (`wbSpareFree`; with no list read, every model counts) (plugins#138, hheei: an account at 560 / 560 was still served deepseek-v4.1-flash; `TestWorkBuddyCreditsSpareFreeModels`). A free model the vendor refuses all the same (WorkBuddy refuses even 0-rate models to an account with no package) rests the account on its own refusal. Cline's daily limit of one free model, 429 "Daily free limit reached on model deepseek/deepseek-v4-flash. Try again in 23h 59m" (the words Cline's own clients read it by, `isClineFreeModelLimitMessage`), rests that model alone (`clineFreeLimit`, `clineModelLimited`, keyed by `restID`) until the time it names (`clineBackIn`, `tryAgainIn`, held to `longestWritten`; `resets`), from a provider whose requests reach Cline's API (`ClinePinnable`: the ClinePass preset, one at cline.bot, the Cline plugin's). The key's other models, free or the plan's, are still served, and the model out of its day is answered with its refusal without asking Cline again (#1398, wuasakura: one free model's 429 sent the whole Cline account to the back; `TestClineFreeLimitRestsTheModel`, `TestClineFreeLimitLeavesOtherModels`). Another vendor's same words, and a Cline 429 that doesn't name the model's limit, rest the key as before. WorkBuddy's 429 14018 "Credits exhausted" is out of credit (`brokeWords`), not a rate limit, on the built-in's raw body and the plugin's `insufficient_quota` alike (`TestCreditsExhaustedIsOutOfCredit`). On the rate-limit branch, a reset time the refusal names (`resetsAt`, or `resetsHeader` as `keepRetry` noted it) is believed up to `longestQuota`, as out of quota believes it, and the Routing page says it rests until then (`resets`); a `Retry-After` or a rate-limit reset header is still held to `longestWait` (an hour) (`rateRest`). The same rest runs for a plugin's requests: the WorkBuddy plugin passes these 429s on as they come (`TestPluginWrittenResetRests`). A JSON error body that escapes what isn't ASCII as `\uXXXX` (Python's json.dumps does by default) has its strings decoded before any word list (`creditWords`, `rateWords`, `plannedWords`, `usedUpWords`, `resetsWhen`, …) is matched (`wordsOf`), so an escaped 余额不足 or 用量 reads as an unescaped one does.+- A 429 that names a limit per minute or second (`minuteWords`: per minute, per second, TPM, RPM, `PerMinute` in Gemini's quotaId, Azure's "token rate limit" and "call rate limit") is a rate limit even when it calls itself a quota, unless it also names a longer window or a plan's limit (`longWords`: hour, day, week, month, usage limit, 用量, 套餐) or money spent (`brokeWords`, `insufficient_quota`) (`minuteLimit`). Gemini's "You exceeded your current quota … PerMinute", Vertex's "Quota exceeded for …requests_per_minute…" and Azure's rate limit, whose link is aka.ms/oai/quotaincrease, each rested a key the quarter of an hour of a quota with balance left (monater.114514 on Discord); now they rest as `rateRest` does, a minute or the vendor's `Retry-After`. Words inside a link (`urlWords`) don't make a rate limit a plan used up. DashScope words its TPM/TPS limit as a quota too, `Allocated quota exceeded, please increase your quota limit.` or OpenAI's `insufficient_quota`; from a DashScope provider (`dashScope`) those are rate limits (`dashScopeRate`, in `failureOf`), while its "Free allocated quota exceeded." and a Coding Plan's hour/week/month stay out of quota, and OpenAI's `insufficient_quota` stays out of credit (`TestMinuteLimitIsNotQuota`, `TestMinuteLimitRestsAMinute`, `TestDashScopeAllocationQuotaIsRate`).- Antigravity's 429 for a model's quota used up writes how long until it is back as Go prints a duration: "You have exhausted your capacity on this model. Your quota will reset after 3h19m30s." (`quotaResetAfter`, read by `resetsAfter` beside Factory's "resets in …", held to `longestWritten`). The account (or, as `pooled` says, that model on it) rests that long (`resets`), and the agent's Retry-After says it when no account is left. Unread, it rested `quotaRest`, so the account first in order was asked again, and refused, every 15 minutes while the next ticked account had its quota (Dani Ariyanto on Discord, 10-24; `TestAntigravityQuotaRestsUntilItsReset`). Its other 429, "Resource has been exhausted (e.g. check quota).", names no time and rests `quotaRest` as before.- A ZCode plugin account's Start Plan trial entry (`<model>-Trial`) that the plugin refuses before sending anything rests that entry alone (`zcodeTrialRefused`, `restID`), not the account: a 400 "ZCode has no active limited quota for GLM-5.3-Trial" when no live plan holds it any more (the trial ended), and a 429 "ZCode's limited quota for glm-5.3 is exhausted or temporarily unavailable" when its bucket is spent (the plugin names the bucket, the entry less `-Trial`). Read as `failQuota` by their words, both rested `zcode@…`, and the account's GLM Coding Plan models were paused with the trial (#3661, orion-nebula-dev; after skygunner's e04a1b994, which covered the 400). Only the plugin's exact words naming the model asked for count: another model named, a model without `-Trial`, the words on another status, the account's own quota or key, and the same words from another vendor still rest the account (`TestZCodeTrialRefusalRestsTheTrialAlone`). An expired trial still kept in a group is asked first and refused locally, as the guessed quota rest is asked again a minute on; the Routing page strikes it as skipped, which the gateway doesn't do for a member no account lists (#3805).- An account resting out of its window (a Claude account by the time Claude Code's refusal named, `resets`, or any by `window`) is back once magpie's reading of its windows (`provider.Allowances`) finds it full till sooner: the window used below `SpentShareOf`, or its reset passed, with no other window over the same models still full. The reading tells `provider.OnRenewed` as the account's `UsageAgent` and user, and `renewed` lifts that account's rests out of quota or by `window`; its rests for a rate limit, its credit, a verification or a failure stay, as a key's do, and so does every rest of other accounts still out of their windows. Planning reads every account candidate's allowance, ordered groups included, so this needs no step of its own in `restingOf`.diff --git a/internal/gateway/minute_limit_test.go b/internal/gateway/minute_limit_test.gonew file mode 100644index 000000000..7da32bf29--- /dev/null+++ b/internal/gateway/minute_limit_test.go@@ -0,0 +1,103 @@+package gateway++import (+ "net/http"+ "testing"+ "time"++ "github.com/yetone/magpie/internal/provider"+)++// Vendors' 429s for a limit per minute — tokens or requests — as they+// write them. A body that also says "quota", in its words or in a link,+// read as a plan used up and rested the key a quarter of an hour with+// balance left (monater.114514 on Discord). Those that say a longer+// window, or money spent, still rest as a plan or credit used up.+var minuteLimitBodies = map[string]string{+ // Gemini API (ai.google.dev/gemini-api/docs/rate-limits): a quota per+ // minute, its quotaId ending PerMinute+ `{"error":{"code":429,"message":"You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits.\n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_paid_tier_input_token_count, limit: 2000000, model: gemini-2.5-pro\nPlease retry in 33.517s.","status":"RESOURCE_EXHAUSTED","details":[{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_paid_tier_input_token_count","quotaId":"GenerateContentPaidTierInputTokensPerModelPerMinute","quotaDimensions":{"location":"global","model":"gemini-2.5-pro"},"quotaValue":"2000000"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"33s"}]}}`: failRate,+ // Vertex AI+ `{"error":{"code":429,"message":"Quota exceeded for aiplatform.googleapis.com/generate_content_requests_per_minute_per_project_per_base_model with base model: gemini-2.5-pro. Please submit a quota increase request. https://cloud.google.com/vertex-ai/docs/generative-ai/quotas-genai.","status":"RESOURCE_EXHAUSTED"}}`: failRate,+ // Azure OpenAI, its link to aka.ms/oai/quotaincrease+ `{"error":{"code":"429","message":"Requests to the ChatCompletions_Create Operation under Azure OpenAI API version 2024-10-21 have exceeded token rate limit of your current AIServices S0 pricing tier. Please go here: https://aka.ms/oai/quotaincrease if you would like to further increase the default rate limit. For Free Account customers, upgrade to Pay as you Go here: https://aka.ms/429TrialUpgrade."}}`: failRate,+ `{"error":{"code":"RateLimitReached","message":"Your requests to gpt-4o for gpt-4o in East US have exceeded the call rate limit for your current AIServices S0 pricing tier. This request was for ChatCompletions_Create under Azure OpenAI API version 2024-10-21. Please retry after 41 seconds. To increase your default rate limit, visit: https://aka.ms/oai/quotaincrease."}}`: failRate,+ // a rate limit pointing to a page about quotas, with nothing of when+ `{"error":{"message":"Rate limit exceeded. See https://example.com/docs/quota","type":"rate_limit_error"}}`: failRate,+ // already rate limits: they stay so+ `{"error":{"message":"Rate limit reached for gpt-4o in organization org-abc on tokens per min (TPM): Limit 30000, Used 28543, Requested 2391. Visit https://platform.openai.com/account/rate-limits to learn more.","type":"tokens","param":null,"code":"rate_limit_exceeded"}}`: failRate,+ `{"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed the rate limit for your organization (abc) of 30,000 input tokens per minute. For details, refer to: https://docs.claude.com/en/api/rate-limits."}}`: failRate,+ `{"error":{"code":"1302","message":"您的账户已达到速率限制,请您控制请求频率"}}`: failRate,+ `{"code":50603,"message":"Request was rejected due to rate limiting. Details: TPM limit reached.","data":null}`: failRate,+ `{"error":{"code":"RateLimitExceeded.EndpointTPMExceeded","message":"The request failed because you have exceeded the TPM limit for the Endpoint. Request id: 0217","type":"TooManyRequests"}}`: failRate,++ // a longer window, or money spent: as before+ `{"error":{"message":"You exceeded your current quota, please check your plan and billing details.","type":"insufficient_quota","param":null,"code":"insufficient_quota"}}`: failCredit,+ `{"error":{"code":"1113","message":"余额不足或无可用资源包,请充值。"}}`: failCredit,+ `{"error":{"code":429,"message":"Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 50, model: gemini-2.5-pro","status":"RESOURCE_EXHAUSTED","details":[{"violations":[{"quotaId":"GenerateRequestsPerDayPerProjectPerModel-FreeTier"}]}]}}`: failQuota,+ `{"error":{"message":"Rate limit reached for model x in organization y on tokens per day (TPD): Limit 100000, Used 99000, Requested 3000.","type":"tokens","code":"rate_limit_exceeded"}}`: failQuota,+ `{"error":{"message":"Rate limit exceeded: free-models-per-day. Add 10 credits to unlock 1000 free model requests per day"}}`: failQuota,+ `{"error":{"message":"Resource has been exhausted (e.g. check quota).","status":"RESOURCE_EXHAUSTED"}}`: failQuota,+}++func TestMinuteLimitIsNotQuota(t *testing.T) {+ for body, want := range minuteLimitBodies {+ if got := failure(429, []byte(body)); got != want {+ t.Errorf("%s: %s, want %s", body, got, want)+ }+ }+}++// A key refused for a limit per minute rests as a rate limit: a minute,+// or as long as the vendor's Retry-After or x-ratelimit-reset asks —+// never the quarter of an hour of a quota.+func TestMinuteLimitRestsAMinute(t *testing.T) {+ old := allowances+ defer func() { allowances = old }()+ allowances = func(string) map[string]provider.Allowance { return nil }+ clineRestsCleared(t)+ s := &Server{}+ body := []byte(`{"error":{"code":429,"message":"Quota exceeded for aiplatform.googleapis.com/generate_content_requests_per_minute_per_project_per_base_model with base model: gemini-2.5-pro. Please submit a quota increase request.","status":"RESOURCE_EXHAUSTED"}}`)+ for i, h := range []http.Header{{}, {"Retry-After": {"20"}}, {"X-Ratelimit-Reset-Tokens": {"45s"}}} {+ clineRestsCleared(t)+ p := provider.Provider{ID: "vertex", Chat: "https://aiplatform.example/v1", Key: "k"}+ c := candidate{p: p, model: "gemini-2.5-pro", rest: p.ID}+ r := s.restAfter(c, 429, h, body)+ left := time.Until(r.Until)+ if r.Why != failRate || left > 2*time.Minute || left <= 0 {+ t.Errorf("header %d: rests %v as %s by %s, want a rate limit's minute or its header's wait", i, left, r.Why, r.By)+ }+ }+}++// DashScope words its tokens-per-minute limit as a quota, in OpenAI's+// shape insufficient_quota too (help.aliyun.com/zh/model-studio/+// error-code: Throttling.AllocationQuota / insufficient_quota, "超出+// TPM/TPS限制"): from DashScope it is a rate limit. Its free allowance used+// up stays out of quota, and OpenAI's insufficient_quota out of credit.+func TestDashScopeAllocationQuotaIsRate(t *testing.T) {+ dash := candidate{p: provider.Provider{ID: "bailian", Chat: "https://dashscope.aliyuncs.com/compatible-mode/v1", Key: "k"}, model: "qwen3-max"}+ oai := candidate{p: provider.Provider{ID: "oai", Chat: "https://api.openai.com/v1", Key: "k"}, model: "gpt-5"}+ alloc := `{"error":{"message":"Allocated quota exceeded, please increase your quota limit.","type":"limit_requests","param":null,"code":"limit_requests"},"request_id":"x"}`+ native := `{"code":"Throttling.AllocationQuota","message":"Allocated quota exceeded, please increase your quota limit.","request_id":"x"}`+ insufficient := `{"error":{"message":"You exceeded your current quota, please check your plan and billing details.","type":"insufficient_quota","param":null,"code":"insufficient_quota"}}`+ free := `{"code":"Throttling.AllocationQuota","message":"Free allocated quota exceeded.","request_id":"x"}`+ hour := `{"code":"Throttling.AllocationQuota","message":"hour allocated quota exceeded.","request_id":"x"}`+ for _, tc := range []struct {+ c candidate+ body string+ want string+ }{+ {dash, alloc, failRate},+ {dash, native, failRate},+ {dash, insufficient, failRate},+ {dash, free, failQuota},+ {dash, hour, failQuota},+ {oai, insufficient, failCredit},+ {oai, alloc, failQuota},+ } {+ if got := failureOf(tc.c, 429, []byte(tc.body)); got != tc.want {+ t.Errorf("%s %s: %s, want %s", tc.c.p.ID, tc.body, got, tc.want)+ }+ }+}diff --git a/internal/gateway/routing.go b/internal/gateway/routing.goindex fcc80bfd6..090bb3290 100644--- a/internal/gateway/routing.go+++ b/internal/gateway/routing.go@@ -223,6 +223,23 @@ var (// 5-hour, day or 7-day limit ("api key 7天限额已用完", sent as// rate_limit_exceeded).plannedWords = regexp.MustCompile(`(?i)quota|usage.?limit|hit your .*limit|limit.{0,24}resets|per.?(day|week|month)|daily|weekly|monthly|额度|用量|套餐|限额已用完`)+ // minuteWords: a 429 that names a window of a minute or less, or the+ // rate itself — tokens or requests per minute, TPM, RPM — which some+ // vendors call a quota all the same: Gemini's "You exceeded your+ // current quota … quotaId GenerateContentPaidTierInputTokensPerModel+ // PerMinute … Please retry in 33s", Vertex's "Quota exceeded for+ // …requests_per_minute_per_project…", Azure's "exceeded token rate+ // limit". Read as a used-up plan, each rested the quarter of an hour+ // of a quota that says nothing of when, with balance left+ // (monater.114514 on Discord). A longer window named beside it+ // (longWords) is still the plan's.+ minuteWords = regexp.MustCompile(`(?i)per.?(second|minute)|per.?(sec|min)\b|\b[rt]p[ms]\b|(token|call|request) rate limit|每分钟|每秒`)+ // longWords: a window longer than a minute, or a plan's own limit,+ // named in a 429 — what minuteWords' rate limit is not.+ longWords = regexp.MustCompile(`(?i)usage.?limit|hit your .*limit|limit.{0,24}resets|per.?(hour|day|week|month)|\bhours?\b|hourly|daily|weekly|monthly|\b[rt]p[dh]\b|额度已用|用量|套餐|限额已用完|小时|每天|每日|每周|每月`)+ // urlWords: a link in an error, whose words are its path, not what the+ // vendor said: Azure's rate limit points to aka.ms/oai/quotaincrease+ urlWords = regexp.MustCompile(`https?://\S+`)// resetsWords: Claude Code's "usage limit reached|<when it resets>".resetsWords = regexp.MustCompile(`(?i)limit reached\|(\d{10})\b`)// resetsWhen: a 429 that says in words when the account is back, as@@ -376,6 +393,10 @@ func failure(status int, body []byte) string {// English one as a rate limit, and each rested its own fallback// (#1669)return failQuota+ case status == 429 && minuteLimit(body):+ // a limit per minute, whatever it calls itself: back in a+ // minute, not a plan used up (minuteWords)+ return failRatecase status == 429 && !creditWords.Match(body) && backSoon(body):// back within a wait a provider's patience can cover, as it says// itself, whatever else it says: a LAN aggregator's "Usage has@@ -385,7 +406,7 @@ func failure(status int, body []byte) string {// for (zoecats on Discord). A limit that says it is back in// hours stays out of quota belowreturn failRate- case status == 429 && rateWords.Match(body) && !plannedWords.Match(body):+ case status == 429 && rateWords.Match(body) && !plannedWords.Match(urlWords.ReplaceAll(body, nil)):return failRatecase status >= 500 && quotaCodes.Match(body), status < 500 && usedUpWords.Match(body), status == 429 && plannedWords.Match(body):return failQuota@@ -395,6 +416,41 @@ func failure(status int, body []byte) string {return failOther}+// minuteLimit says a 429's words name a limit per minute or less+// (minuteWords), and nothing longer or spent beside it: no longer window+// (longWords), no balance spent (brokeWords, insufficient_quota). Words+// in a link don't count.+func minuteLimit(body []byte) bool {+ body = urlWords.ReplaceAll(body, nil)+ return minuteWords.Match(body) && !longWords.Match(body) && !brokeWords.Match(body) && !bytes.Contains(body, []byte("insufficient_quota"))+}++// dashScopeTokenRate: DashScope's (Model Studio's) 429 for the tokens+// per minute or second its account is allowed, which it words as a+// quota: Throttling.AllocationQuota "Allocated quota exceeded, please+// increase your quota limit.", or in OpenAI's shape insufficient_quota+// "You exceeded your current quota, please check your plan and billing+// details." — both "超出TPM/TPS限制" in its error-code list+// (help.aliyun.com/zh/model-studio/error-code). Its free allowance used+// up ("Free allocated quota exceeded."), its Coding Plan's hour, week or+// month ("hour allocated quota exceeded") and arrears (400 Arrearage) are+// worded otherwise. OpenAI's own insufficient_quota is out of credit, so+// this is DashScope's alone.+var dashScopeTokenRate = regexp.MustCompile(`Allocated quota exceeded, please increase your quota limit|"(?:code|type)"\s*:\s*"insufficient_quota"`)++// dashScopeRate says p is DashScope and its 429 is a rate per minute or+// second (dashScopeTokenRate), not its free allowance or a plan's window.+func dashScopeRate(p provider.Provider, status int, body []byte) bool {+ if status != http.StatusTooManyRequests || !dashScope(p) {+ return false+ }+ w := wordsOf(body)+ if bytes.Contains(bytes.ToLower(w), []byte("free allocated quota")) || longWords.Match(urlWords.ReplaceAll(w, nil)) {+ return false+ }+ return dashScopeTokenRate.Match(w)+}+// failureOf says why c's reply failed: a Claude account's sign-in that// Anthropic refused is told as one (provider/claude_auth.go), passed over// till it is signed in again; another vendor saying the same words fails@@ -410,6 +466,9 @@ func failureOf(c candidate, status int, body []byte) string {if restrictedRefused(c.p, status, body) {return failRestricted}+ if dashScopeRate(c.p, status, body) {+ return failRate+ }return failure(status, body)}