diff --git a/docs/subsystems/providers-accounts.md b/docs/subsystems/providers-accounts.md index a199978c9..7efb9f58f 100644 --- a/docs/subsystems/providers-accounts.md +++ b/docs/subsystems/providers-accounts.md @@ -57,7 +57,7 @@ keys and accounts per request is in [Gateway routing and fallback](gateway-routi | Removing the signed-in account | `ForgetLogin` signs Codex or Claude Code in to another of its accounts first (`nextOnForget`: the first other that is on, else one whose sign-in holds, else any, never a setup-token account or one Codex keeps in another folder: `switchable`), then forgets this one; a switch that fails removes nothing (StringKe, #4532: Claude's was refused while Codex's switched). Codex's only account is signed out as `codex logout` does. Claude Code is never signed out: its last account it can be signed in to is refused with `SignedInError{Only}` (GUI code `signed_in_only`, and that account has no *Remove*). Claude Code's own credential is never deleted; the forgotten account's folder (`forgetClaudeDir`) is its own. `TestForgetLiveClaudeSwitchesFirst`, `TestForgetOnlyClaudeIsKept`, `codex-signout.test.cjs`. | | Claude Code's proxy | Claude Code on its own subscription asks Anthropic itself, through the proxy its env names. While any Claude account has a proxy of its own (`AccountProxies`), the `env` of Claude Code's `settings.json` names the proxy of the account it is signed in to (#1807): `HTTPS_PROXY` and `HTTP_PROXY` set to that account's own, else the subscription's `Proxy` (`ProxyOfLogin`), and `NO_PROXY` to loopback; none for `direct` or a SOCKS proxy, which Claude Code can't use. It is written on every switch (`switchLogin`, the user's or `SwitchWhenSpent`), when the Claude subscription is saved, and at the gateway's look every `loginSwitchEvery` (a sign-in made in Claude Code itself). Claude Code reads its env at start, so only sessions started after the switch take it. A proxy key the user set (in either case) is theirs: magpie then writes none and takes out none of theirs. What magpie wrote is kept in `claude-proxy-env.json`, and a key is magpie's only while it holds that value. A `settings.json` that doesn't parse is left as it is. Its log lines name the proxy through `netproxy.Redact`, without its user and password (#1886); the env gets it whole. | [`claude_proxy_env.go`](../../internal/provider/claude_proxy_env.go) | | Routing groups | User-made groups from the Routing view, and auto-found groups of the same model across providers (derived, never stored). The same model is the same id as vendors agree on it (`sameModel`): lowercase, without a vendor's prefix, a version's dot as `-`, a run of spaces, `_` and `-` as one `-` (a relay listing its display name as the id, `GPT-6 Sol`, joins `gpt-6-sol`, Chill on Discord: `TestSameModelDisplayNameAsID`), and without a YYYYMMDD or Ark YYMMDD snapshot date. Every word still counts (`gpt-6`, `gpt-6-mini` and `gpt-6-sol` stay apart), as do a `:variant`, a four-digit release and OpenAI's dashed date (`gpt-4o-2024-08-06`, a pinned snapshot whose group id agents may already name). A provider kept "Only through routing groups" joins them the same way. Members are `provider/model[:effort]`. A group can nest another (`group/`); `SaveGroup` refuses loops. A group given another id (`agent.RenameGroup`: the Routing page, `magpie groups rename`, the TUI) moves every agent field on `group/` to `group/`, spelled as the agent spells it, through the same `renameRefs` a provider's rename uses, then `SyncCatalog`; before, the agents stayed on a group magpie no longer had (lucis0116 on X, `TestRenameGroupMovesTheAgentsOnIt`). A provider's or group's display name needs no move: `store` and `SaveGroup` drop the catalog, and `SyncCatalog` writes the new labels into every agent's list. `Match` takes a glob or `re:` pattern (#766), both matched in any case (`compilePattern`; `(?-i)` inside a `re:` makes case matter). What a pattern matches follows the members named, in the catalog's order, until the user drags it elsewhere (usrname1833 on Discord): `Placed` keeps the whole order, named and matched alike, and the group is read and routed in it (`placedIn`); a model matched since goes last, one no longer matched drops out, a save that sends the named members only leaves the matched where they were (`placedOver`), and a provider's or group's rename carries it (`TestGroupPatternMembersKeepTheirPlace`, `group-member-drag.test.cjs`). A found group follows the providers magpie has: one removed leaves it, while one switched off stays in it (`foundGroups`, `heldOffEntries`; one without a key, such as a plugin not signed in, finds no group), skipped by `membersIn`, left off a found group's card, logos and TUI line with a count of those switched off (XYenon on Discord: `routing-provider-off.test.cjs`, `TestFoundGroupLineLeavesASwitchedOffProviderOut`) and said as switched off in its editor and the TUI's group page, so switching one of two providers off for a while doesn't take the group away from the agents, rules and groups set to it; it is back in its place once on again (#2671: `TestFoundGroupStaysWithAProviderOff`, `TestFoundGroupWithAProviderOff`, `TestReseatKeepsAFoundGroupWithAProviderOff`, `TestFoundGroupMemberOfASwitchedOffProvider`). A found group the user changed (an `auto-…` id stored) is read without the members of providers magpie no longer has (`withoutRemoved`, not written back, so a provider back under its id is back in it), except a manual group's pick, a rule's model, or all of them when none would be left. A switched-off provider's members stay in it, skipped by `membersIn`, and the Routing page says them as switched off (`memberJSON.providerOff`). The user's own groups keep their members. Three templates make a group in one click from the models the user has (`provider.Templates`, `AddTemplate`; the Routing page's cards before a first group and its Templates menu after, `magpie group template [kind] [name]`): `smart` sends a hard turn to the strongest model and an easy one or a compaction to a cheap one, asked by a classifier (the decision API when there is one, else the cheapest priced model that doesn't reason); `thrifty` starts on two cheap models of different providers and sends high reasoning to the strongest; `steady` fails over between the strongest model of up to three providers. A model is weighed by its maker's list price when known, else what its provider charges, else by its id's size words (`sizeOf`); one over `tooDear` (USD 100 a million output tokens) is never picked. A template that can't be made says what is missing (`Need`). It is saved under a name and id no group has (`freeGroupName`, shared with `CopyGroup`), never over one. A group is shared as text (`ShareGroup`, a group row's Copy to share): JSON marked `"magpie": "routing-group"` with a format `version` (`ShareVersion`), holding the group's members as it names them, patterns, routing, rules, classifier and settings. A group holds only `provider/model` ids, never a key, account or address, and the derived matches, found/hidden/off flags and the rules that hold by a folder (a path on the sharer's machine, `Rule.Folders`) stay behind; a pasted one is left out too. `ImportGroup` (the Routing page's Import, `POST /api/groups/import`) reads it with words or a code fence around it, refuses another text, a newer format or none (`ShareError`, said in the reader's language). A member whose provider the importer has is kept; else the same model (`AutoGroupOf`) under the first provider of theirs that serves it (`Instead`); else it is left out and named (`Missing`), with the rules that send to it, its place among the off and fast members, and a classifier gone takes the intent rules and auto effort with it. Nothing is added when no member is left; what is added gets a free name, never replacing a group. A group of patterns only that match nothing now (a plugin's models not listed) has no members: `/api/groups` says them, and an unmakeable template's, as `[]`, never `null`; the Routing page reads the response through `groupsFrom` and draws a group it still can't draw as one row saying so, so one bad group never hides the rest (#1585). | [`group.go`](../../internal/provider/group.go), [`grouptemplate.go`](../../internal/provider/grouptemplate.go), [`group_share.go`](../../internal/provider/group_share.go) | -| Allowance | `Quotas` asks every vendor at once: subscription windows (`SubscriptionUsage`), key-bought plans (`PlanQuotas`) and key balances (`KeyBalances`). The Usage page, `magpie quota --json` and `GET /v1/magpie/quotas` read it, each window with its whole-window estimate (`Holds`/`HoldsWhy`, `usage.WithWindowHolds`, which `quotaReport` reaches through the `ReckonHolds` hook since package provider can't import usage, #2333). A single card can be read again on its own (#840). A remote magpie's cards come from what it has kept (`CachedCards`, `GET /v1/magpie/quotas/cards`) and are never read there for this computer except by a card's refresh (`POST /v1/magpie/quotas/refresh`, throttled per card). What it has kept is the Usage page's cards with the readings made behind the requests since laid over them, a later one over an earlier by `readSeq` (`cards_kept.go`): each account's `LoginUsage` reading (the used-up switch, the Codex warm-up, routing's `Allowances`), and each key's `KeyAllowance` windows on its plan or balance card. A Claude account's windows Claude Code told as it answered (`NoteClaudeLimits`, kept in `claudeUsage` with their own `heardSeq`, which drops the account's `LoginUsage` reading) stand on its card over any reading started before them (`withHeardClaude`, #2206), so a magpie only requests reach still tells them. An account or key read that way and never on the page gets a card from that reading, and after a restart, before either is read again, the cards come from `quotas.json`, dated (`AsOf`). A magpie serving only other magpies has nobody on its page (#1313). Each key of a remote-magpie provider also gets a card of its own, under `/~keys`, one section per key (#1547, `remoteKeyCards` in `remote_key_limits.go`): the gateway key's limit as that magpie holds it, read from `GET /v1/magpie/limit` asked with that key alone, so a key never sees another's numbers. It shows a window per cap (tokens, spend) named for the period, used against the cap, with its reset, plus `GatewayKey` (what is left, calls, a cycle of days, used up); a key held to no limit shows `Unlimited`. It is kept for `remoteCardsFor` like the remote's cards and read again by the card's refresh (`?provider=/~keys&user=`). A read that fails keeps the last numbers, dated (`AsOf`); with none the card says why, never zero or no limit. A remote from before `/v1/magpie/limit` (404) says it is too old to tell (`errRemoteNoKeyLimit`). A remote's Codex card keeps its `Resets` (not a GLM team's, `ByWindow`), and its check-ins are dropped: **Use one…** there goes through `/api/usage/codex-reset` with the card's `provider`, and `UseRemoteCodexReset` asks the remote's `POST /v1/magpie/quotas/codex-reset?user=` with the provider's key (#3850). The remote spends it with `SpendCodexReset`, the same function as the Usage page (`UseCodexResetCard`, then `AwaitAllowance`). The account is always named. A 403 `gateway_key_read_only` is told as a read-only key there, and a 404 as a remote too old. No answer within `RemoteResetWait` says the reset may have been used, and it is never asked again by itself. A remote that holds the key to a budget, models or accounts answers its cards 403 `gateway_key_held` (#1981, `errKeyHeld`): the cards kept from before are dropped, and beside the key's own card the remote's card says it tells this key no quotas and that Quotas is turned on for the key on that computer (`errRemoteHeld`; yi_time on Discord saw the remote's Claude vanish from every page with no word). Its owner can let the key be told the cards of what it may use (#2216, `magpie gateway-key quotas on`); the remote then answers those, and 403 as before when that is none. A remote's cards are kept by provider and key (`remoteCardsID`), so a changed key never shows what the old one was told, and a read is kept only over one asked before it (`keepRemoteCards`). Cursor, Grok and a Kiro key keep the page's cards only. With Settings → Allowances → *Allowance reads* at *When I ask* (`QuotaReads == "asked"`, #1518: magpie started at login before the proxy app read by itself, direct), only a read the user asked for goes out: the Usage page or the tray panel's Allowances opened (no more than once in 30s, `quotasOpened`, #1588) or refreshed (`?asked=1`), a card's refresh (`RefreshUsage`), `magpie quota`, `magpie accounts`, `magpie quota wait` and the TUI's quotas (`Asked`). Any other read (`quotaReading` → `holdUnasked`) carries `netproxy.Hold`, so its requests fail before they leave, and every reader gives back what it last read, dated, or "not read yet" (`errNotAsked`): routing, the used-up switch, the menu bar and alerts go by that. An account refused for its quota (`StaleAllowance` → `markStaleRead`) or a key refused (`StaleKeyAllowance` → `refused`) is still read, once (`unheld`). Warm-up and check-in are not reads and are unchanged. A plugin's window may carry a prepaid wallet's `balance` in its `unit` and no share (`QuotaWindow.Balance`, #3950): the card and `magpie quota` show the figure (`BalanceText`), and routing reads it through `Allowance.Left`. | [`cards_kept.go`](../../internal/provider/cards_kept.go), [`quotas.go`](../../internal/provider/quotas.go), [`subscription_usage.go`](../../internal/provider/subscription_usage.go), [`planquota.go`](../../internal/provider/planquota.go), [`balance.go`](../../internal/provider/balance.go), [`quota_refresh.go`](../../internal/provider/quota_refresh.go), [`remote_quotas.go`](../../internal/provider/remote_quotas.go), [`remote_key_limits.go`](../../internal/provider/remote_key_limits.go), [`quota_asked.go`](../../internal/provider/quota_asked.go) | +| Allowance | `Quotas` asks every vendor at once: subscription windows (`SubscriptionUsage`), key-bought plans (`PlanQuotas`) and key balances (`KeyBalances`). The Usage page, `magpie quota --json` and `GET /v1/magpie/quotas` read it, each window with its whole-window estimate (`Holds`/`HoldsWhy`, `usage.WithWindowHolds`, which `quotaReport` reaches through the `ReckonHolds` hook since package provider can't import usage, #2333). A single card can be read again on its own (#840). A remote magpie's cards come from what it has kept (`CachedCards`, `GET /v1/magpie/quotas/cards`) and are never read there for this computer except by a card's refresh (`POST /v1/magpie/quotas/refresh`, throttled per card). What it has kept is the Usage page's cards with the readings made behind the requests since laid over them, a later one over an earlier by `readSeq` (`cards_kept.go`): each account's `LoginUsage` reading (the used-up switch, the Codex warm-up, routing's `Allowances`), and each key's `KeyAllowance` windows on its plan or balance card. A Claude account's windows Claude Code told as it answered (`NoteClaudeLimits`, kept in `claudeUsage` with their own `heardSeq`, which drops the account's `LoginUsage` reading) stand on its card over any reading started before them (`withHeardClaude`, #2206), so a magpie only requests reach still tells them. An account or key read that way and never on the page gets a card from that reading, and after a restart, before either is read again, the cards come from `quotas.json`, dated (`AsOf`). A magpie serving only other magpies has nobody on its page (#1313). Each key of a remote-magpie provider also gets a card of its own, under `/~keys`, one section per key (#1547, `remoteKeyCards` in `remote_key_limits.go`): the gateway key's limit as that magpie holds it, read from `GET /v1/magpie/limit` asked with that key alone, so a key never sees another's numbers. It shows a window per cap (tokens, spend) named for the period, used against the cap, with its reset, plus `GatewayKey` (what is left, calls, a cycle of days, used up); a key held to no limit shows `Unlimited`. It is kept for `remoteCardsFor` like the remote's cards and read again by the card's refresh (`?provider=/~keys&user=`). A read that fails keeps the last numbers, dated (`AsOf`); with none the card says why, never zero or no limit. A remote from before `/v1/magpie/limit` (404) says it is too old to tell (`errRemoteNoKeyLimit`). A remote's Codex card keeps its `Resets` (not a GLM team's, `ByWindow`), and its check-ins are dropped: **Use one…** there goes through `/api/usage/codex-reset` with the card's `provider`, and `UseRemoteCodexReset` asks the remote's `POST /v1/magpie/quotas/codex-reset?user=` with the provider's key (#3850). The remote spends it with `SpendCodexReset`, the same function as the Usage page (`UseCodexResetCard`, then `AwaitAllowance`). The account is always named. A 403 `gateway_key_read_only` is told as a read-only key there, and a 404 as a remote too old. No answer within `RemoteResetWait` says the reset may have been used, and it is never asked again by itself. A remote that holds the key to a budget, models or accounts answers its cards 403 `gateway_key_held` (#1981, `errKeyHeld`): the cards kept from before are dropped, and beside the key's own card the remote's card says it tells this key no quotas, and that on that computer Quotas is turned on for the key and it is let use every model of a provider whose usage it is to see (`errRemoteHeld`; yi_time on Discord saw the remote's Claude vanish from every page with no word). Its owner can let the key be told the cards of what it may use (#2216, `magpie gateway-key quotas on`); the remote then answers those, and 403 held as before when that is none (`writeCards`), so that key shows the same card. A remote's cards are kept by provider and key (`remoteCardsID`), so a changed key never shows what the old one was told, and a read is kept only over one asked before it (`keepRemoteCards`). Cursor, Grok and a Kiro key keep the page's cards only. With Settings → Allowances → *Allowance reads* at *When I ask* (`QuotaReads == "asked"`, #1518: magpie started at login before the proxy app read by itself, direct), only a read the user asked for goes out: the Usage page or the tray panel's Allowances opened (no more than once in 30s, `quotasOpened`, #1588) or refreshed (`?asked=1`), a card's refresh (`RefreshUsage`), `magpie quota`, `magpie accounts`, `magpie quota wait` and the TUI's quotas (`Asked`). Any other read (`quotaReading` → `holdUnasked`) carries `netproxy.Hold`, so its requests fail before they leave, and every reader gives back what it last read, dated, or "not read yet" (`errNotAsked`): routing, the used-up switch, the menu bar and alerts go by that. An account refused for its quota (`StaleAllowance` → `markStaleRead`) or a key refused (`StaleKeyAllowance` → `refused`) is still read, once (`unheld`). Warm-up and check-in are not reads and are unchanged. A plugin's window may carry a prepaid wallet's `balance` in its `unit` and no share (`QuotaWindow.Balance`, #3950): the card and `magpie quota` show the figure (`BalanceText`), and routing reads it through `Allowance.Left`. | [`cards_kept.go`](../../internal/provider/cards_kept.go), [`quotas.go`](../../internal/provider/quotas.go), [`subscription_usage.go`](../../internal/provider/subscription_usage.go), [`planquota.go`](../../internal/provider/planquota.go), [`balance.go`](../../internal/provider/balance.go), [`quota_refresh.go`](../../internal/provider/quota_refresh.go), [`remote_quotas.go`](../../internal/provider/remote_quotas.go), [`remote_key_limits.go`](../../internal/provider/remote_key_limits.go), [`quota_asked.go`](../../internal/provider/quota_asked.go) | | A remote magpie's prices | A local magpie asks a remote magpie's `/v1/models` with `X-Magpie-Prices` (`PricesHeader`, sent by `listHeaders`). The remote answers each model's `magpie_price`: what its own Usage page counts the model at (`EntryPriceIn`: the price its user set, else its provider's list price at its price rate; a routing group only when every member costs the same). It tells it only to a request from its own computer or one let in with a gateway key (`local` or `sharedWith`); a list that didn't ask gets no `magpie_price` (a remote request without a valid key never reaches the list: `lanGuard` refuses it); every list told to those callers also carries the same price as OpenRouter's `pricing`, for agents ([gateway routing](gateway-routing.md)). The local keeps the price with the fetched list (`catalog.Model.Price`; a value that isn't a price, or has a negative part, is dropped, the model kept) and uses it as that provider's list price (`ListPrice` → `remotePrice`). A price the local user set (`provider/model`, `provider/*`, `*/model`) still comes first, and the local provider's own price rate still applies on top. A remote from before this sends no field and the models stay priced as before; an older local sends no header and is sent nothing new. The model editor says the greyed price is the other magpie's (`remoteList`). | [`remote_magpie.go`](../../internal/provider/remote_magpie.go), [`models.go`](../../internal/provider/models.go), [`gateway.go`](../../internal/gateway/gateway.go) (`models`), [`live.go`](../../internal/catalog/live.go) | | A remote magpie's service tiers | A remote magpie's `/v1/models` gives each model the `service_tiers` its own Codex is offered on it (`codexTiers` → `codexcat.ServiceTiers`, from the same `CodexCatalog` and `codexcat.Entries` as its `/v1/codex/models`: Fast on a ChatGPT account's GPT model, the tiers of Codex's own entry on a relay's, none on a model it offers none). The local keeps the ids (`catalog.Model.Tiers` → `Entry.Tiers`), `codexListed` hands them on for the remote's models, and `codexcat.Entries` offers them to the local Codex with Codex's own names (`namedTiers`). The gateway sends the tier Codex asks for to a remote magpie as it was asked (`Request.OwnTier`, as for a provider added by its address; dropped and not sent again if refused), and the remote serves it as its own Codex's turn (#1234). An agent's picker offers the bolt on a remote's model whose tiers hold `priority` (`provider.CanFast` reads them with `RemoteTiers`; Ultrafast too where they hold `ultrafast`, `UltraOn`), and a fast pick of one goes on with `service_tier` `priority` on the remote's Chat or Responses: an agent on Messages, whose fast is Claude's `speed`, has it turned into the tier the remote offers (`forwardTranslated`), so Claude Code's pick reaches the remote's vendor too (littlekk88 on Discord; `TestRemoteMagpieFastPick`, red without either half). A remote from before this sends no tiers, and its models are offered none, as before. The list gives every client the tiers, not only a magpie asking with `X-Magpie-Drawers`: Cindy shows its Fast switch on a model whose `service_tiers` hold `priority` (#1914, `TestModelsListTiersForEveryClient`). | [`codexcat.go`](../../internal/codexcat/codexcat.go), [`codex_models.go`](../../internal/provider/codex_models.go), [`codex_catalog.go`](../../internal/gateway/codex_catalog.go), [`gateway.go`](../../internal/gateway/gateway.go), [`live.go`](../../internal/catalog/live.go) | | A relay's Codex entries | A provider the user added by its address with a Responses URL may list its models in Codex's own shape (`slug`, `supported_reasoning_levels`, `shell_type`, `base_instructions`: `catalog.CodexEntry`), plainly or when asked with Codex's `client_version`, as sub2api does (ctopsc on Discord: GPT-6.1 Terra was handed models.dev's 922000 window where the relay said 272000). `fetchOne` keeps such a row whole (`catalog.Model.Codex`, with its window, max window and inputs read off it), and when the plain list has none it asks the same URL once more with `client_version` (`codexEntries`): only where the list is fetched (add, key change, Refresh), never per Codex poll. The answer only adds entries to models the plain list has; one that fails or can't be read keeps the last list's entries (failed read = unknown), one that answers plainly says there are none. `codexcat.listedEntry` hands Codex the relay's entry as given, `base_instructions` included, with magpie's slug, name, priority and " via magpie" description; the user's window, compaction, levels and image setting still win (levels keep the relay's descriptions). A saved list from before is enriched at its next Refresh. `TestCodexListedEntry`, `TestCodexListedEntryInPlainList`. | [`codex_entries.go`](../../internal/provider/codex_entries.go), [`live.go`](../../internal/catalog/live.go), [`codexcat.go`](../../internal/codexcat/codexcat.go) | diff --git a/internal/gateway/quotas_scope_test.go b/internal/gateway/quotas_scope_test.go index 7146c5090..ff9d884c0 100644 --- a/internal/gateway/quotas_scope_test.go +++ b/internal/gateway/quotas_scope_test.go @@ -223,8 +223,9 @@ func seedKeptBalances(t *testing.T) { // #2216 from the other side: a magpie with that magpie as its provider, // through a key let see its quotas, shows the cards of what the key may -// use beside the key's own; a key told none shows its own card alone, not -// "nothing read on that magpie yet", which a refresh wouldn't change. +// use beside the key's own; a key told none is answered as held, so it +// shows its own card and the remote's saying why (yi_time), not "nothing +// read on that magpie yet", which a refresh wouldn't change. func TestRemoteMagpieShowsHeldKeyItsQuotas(t *testing.T) { fresh(t) t.Setenv("MAGPIE_ADDR", "") @@ -278,7 +279,8 @@ func TestRemoteMagpieShowsHeldKeyItsQuotas(t *testing.T) { if got := shown(secrets[0]); !slices.Equal(got, []string{"office/alpha:two:", "office/~keys:"}) { t.Errorf("a key held to alpha's Two: %v", got) } - if got := shown(secrets[1]); !slices.Equal(got, []string{"office/~keys:"}) { + if got := shown(secrets[1]); len(got) != 2 || got[0] != "office/~keys:" || + !strings.HasPrefix(got[1], "office::remote magpie tells this key none of its quotas") { t.Errorf("a key told no card: %v", got) } } diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index 23798b912..78c47383a 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -13608,7 +13608,7 @@ function quotaError(err, q) { if (/^nothing read on that magpie yet/.test(err)) return t("Nothing read on that computer yet — refresh this card to have it read"); if (/^remote magpie doesn't share its quotas/.test(err)) return t("That computer's magpie doesn't share its quotas yet — update magpie there"); if (/^remote magpie isn't shared/.test(err)) return t("That computer's magpie isn't shared — turn on Settings → Network and sharing → Share on local network there"); - if (/^remote magpie tells this key none of its quotas/.test(err)) return t("That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — turn on Quotas for the key under Gateway keys there"); + if (/^remote magpie tells this key none of its quotas/.test(err)) return t("That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — hover for what to change there"); if (/^remote magpie didn't take this key/.test(err)) return t("That computer's magpie didn't take this key — use one of its gateway keys in this provider"); if (/^couldn't reach the remote magpie/.test(err)) return t("Couldn't reach that computer's magpie — check that it is running and its address"); // a remote magpie's gateway key card (#1547, remote_key_limits.go) diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index 8a60f648b..2c0665d34 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -3303,7 +3303,7 @@ const I18N = { "That computer's magpie doesn't share its quotas yet — update magpie there": "那台电脑的 magpie 还不能共享额度 — 请在那台电脑上更新 magpie", "That computer's magpie isn't shared — turn on Settings → Network and sharing → Share on local network there": "那台电脑的 magpie 没有共享 — 请在那台电脑上打开 设置 → 网络与共享 → 局域网共享", "That computer's magpie didn't take this key — use one of its gateway keys in this provider": "那台电脑的 magpie 不认这个密钥 — 请在这个服务商里填它的一个网关密钥", - "That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — turn on Quotas for the key under Gateway keys there": "那台电脑的 magpie 不向这个密钥显示额度:那边给它限定了预算、模型或账号 — 请在那台电脑的「网关密钥」里打开这个密钥的「额度」", + "That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — hover for what to change there": "那台电脑的 magpie 不向这个密钥显示额度:那边给它限定了预算、模型或账号 — 悬停查看那边要改什么", "Couldn't reach that computer's magpie — check that it is running and its address": "连不上那台电脑的 magpie — 请确认它在运行、地址正确", "The magpie on {computer}, where this account is signed in, uses it.": "由 {computer} 上的 magpie 使用,这个账号登录在那里。", "This key is read-only on that computer's magpie — give this provider a key with full access to use a reset from here": "这个密钥在那台电脑的 magpie 上是只读的 — 想在这里使用重置,请给这个服务商填一个完全权限的密钥", @@ -7866,7 +7866,7 @@ const I18N = { "That computer's magpie doesn't share its quotas yet — update magpie there": "那臺電腦的 magpie 還不能共享額度 — 請在那臺電腦上更新 magpie", "That computer's magpie isn't shared — turn on Settings → Network and sharing → Share on local network there": "那臺電腦的 magpie 沒有共享 — 請在那臺電腦上開啟 設定 → 網路與共享 → 區域網共享", "That computer's magpie didn't take this key — use one of its gateway keys in this provider": "那臺電腦的 magpie 不認這個金鑰 — 請在這個服務商裡填它的一個閘道金鑰", - "That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — turn on Quotas for the key under Gateway keys there": "那臺電腦的 magpie 不向這個金鑰顯示額度:那邊給它限定了預算、模型或帳號 — 請在那臺電腦的「閘道金鑰」裡打開這個金鑰的「額度」", + "That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — hover for what to change there": "那臺電腦的 magpie 不向這個金鑰顯示額度:那邊給它限定了預算、模型或帳號 — 懸停查看那邊要改什麼", "Couldn't reach that computer's magpie — check that it is running and its address": "連不上那臺電腦的 magpie — 請確認它在執行、位址正確", "The magpie on {computer}, where this account is signed in, uses it.": "由 {computer} 上的 magpie 使用,這個帳號登入在那裡。", "This key is read-only on that computer's magpie — give this provider a key with full access to use a reset from here": "這個密鑰在那臺電腦的 magpie 上是唯讀的 — 想在這裡使用重置,請給這個供應商填一個完整權限的密鑰", @@ -12433,7 +12433,7 @@ const I18N = { "That computer's magpie doesn't share its quotas yet — update magpie there": "そのコンピューターの magpie はまだ利用枠を共有できません — そちらの magpie を更新してください", "That computer's magpie isn't shared — turn on Settings → Network and sharing → Share on local network there": "そのコンピューターの magpie は共有されていません — そちらで 設定 → ネットワークと共有 → ローカルネットワークで共有 をオンにしてください", "That computer's magpie didn't take this key — use one of its gateway keys in this provider": "そのコンピューターの magpie はこのキーを受け付けませんでした — このプロバイダーにそちらのゲートウェイキーを入れてください", - "That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — turn on Quotas for the key under Gateway keys there": "そのコンピューターの magpie はこのキーに利用枠を伝えません:そちらで予算・モデル・アカウントが制限されています — そちらの「ゲートウェイキー」でこのキーの「残量」をオンにしてください", + "That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — hover for what to change there": "そのコンピューターの magpie はこのキーに利用枠を伝えません:そちらで予算・モデル・アカウントが制限されています — そちらで変える点はホバーで表示", "Couldn't reach that computer's magpie — check that it is running and its address": "そのコンピューターの magpie に接続できません — 起動しているか、アドレスが正しいか確認してください", "The magpie on {computer}, where this account is signed in, uses it.": "このアカウントがサインインしている {computer} の magpie が使います。", "This key is read-only on that computer's magpie — give this provider a key with full access to use a reset from here": "このキーはそのコンピューターの magpie では読み取り専用です — ここからリセットを使うには、このプロバイダーにフルアクセスのキーを設定してください", @@ -17011,7 +17011,7 @@ const I18N = { "That computer's magpie doesn't share its quotas yet — update magpie there": "Das magpie dieses Computers teilt seine Kontingente noch nicht — aktualisiere magpie dort", "That computer's magpie isn't shared — turn on Settings → Network and sharing → Share on local network there": "Das magpie dieses Computers ist nicht freigegeben — schalte dort Einstellungen → Netzwerk und Freigabe → Im lokalen Netzwerk freigeben ein", "That computer's magpie didn't take this key — use one of its gateway keys in this provider": "Das magpie dieses Computers hat diesen Schlüssel nicht angenommen — trage bei diesem Anbieter einen seiner Zugangsschlüssel ein", - "That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — turn on Quotas for the key under Gateway keys there": "Das magpie dieses Computers nennt diesem Schlüssel keine Kontingente: Er ist dort auf ein Budget, Modelle oder Konten beschränkt — schalte dort unter „Zugangsschlüssel“ bei ihm „Kontingente“ ein", + "That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — hover for what to change there": "Das magpie dieses Computers nennt diesem Schlüssel keine Kontingente: Er ist dort auf ein Budget, Modelle oder Konten beschränkt — für das, was dort zu ändern ist, darüberfahren", "Couldn't reach that computer's magpie — check that it is running and its address": "Das magpie dieses Computers ist nicht erreichbar — prüfe, ob es läuft und die Adresse stimmt", "The magpie on {computer}, where this account is signed in, uses it.": "Das magpie auf {computer}, wo dieses Konto angemeldet ist, verwendet ihn.", "This key is read-only on that computer's magpie — give this provider a key with full access to use a reset from here": "Dieser Schlüssel ist im magpie dieses Computers schreibgeschützt — gib diesem Anbieter einen Schlüssel mit vollem Zugriff, um von hier einen Reset zu verwenden", diff --git a/internal/gui/tests/usage-remote-cards.test.cjs b/internal/gui/tests/usage-remote-cards.test.cjs index d1f364313..0982954ea 100644 --- a/internal/gui/tests/usage-remote-cards.test.cjs +++ b/internal/gui/tests/usage-remote-cards.test.cjs @@ -36,7 +36,7 @@ function fixtures(now) { // yi_time on Discord: a key held to models there was told no quotas, // and the remote's Claude showed nowhere here, with no word why { provider: "egret", name: "Egret", icon: "magpie", from: "Egret", kind: "subscription", windows: [], - error: "remote magpie tells this key none of its quotas, as it holds the key to a budget, models or accounts; turn on Quotas for the key under Gateway keys on that computer" }, + error: "remote magpie tells this key none of its quotas, as it holds the key to a budget, models or accounts; on that computer, turn on Quotas for the key under Gateway keys, and let it use every model of a provider whose usage it is to see" }, { provider: "heron", name: "Heron", icon: "magpie", from: "Heron", kind: "subscription", windows: [], error: "couldn't reach the remote magpie Heron: dial tcp 10.0.0.9:3425: connect: connection refused" }, ]; @@ -74,11 +74,11 @@ function serve(lang, state) { } const words = { - en: { none: "Nothing read on that computer yet — refresh this card to have it read", old: "That computer's magpie doesn't share its quotas yet — update magpie there", shed: "That computer's magpie isn't shared — turn on Settings → Network and sharing → Share on local network there", den: "That computer's magpie didn't take this key — use one of its gateway keys in this provider", held: "That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — turn on Quotas for the key under Gateway keys there", barn: "Couldn't reach that computer's magpie — check that it is running and its address" }, - zh: { none: "那台电脑还没有读过额度 — 刷新这张卡片让它读取", old: "那台电脑的 magpie 还不能共享额度 — 请在那台电脑上更新 magpie", shed: "那台电脑的 magpie 没有共享 — 请在那台电脑上打开 设置 → 网络与共享 → 局域网共享", den: "那台电脑的 magpie 不认这个密钥 — 请在这个服务商里填它的一个网关密钥", held: "那台电脑的 magpie 不向这个密钥显示额度:那边给它限定了预算、模型或账号 — 请在那台电脑的「网关密钥」里打开这个密钥的「额度」", barn: "连不上那台电脑的 magpie — 请确认它在运行、地址正确" }, - ja: { none: "そのコンピューターではまだ読み取っていません — このカードを更新すると読み取ります", old: "そのコンピューターの magpie はまだ利用枠を共有できません — そちらの magpie を更新してください", shed: "そのコンピューターの magpie は共有されていません — そちらで 設定 → ネットワークと共有 → ローカルネットワークで共有 をオンにしてください", den: "そのコンピューターの magpie はこのキーを受け付けませんでした — このプロバイダーにそちらのゲートウェイキーを入れてください", held: "そのコンピューターの magpie はこのキーに利用枠を伝えません:そちらで予算・モデル・アカウントが制限されています — そちらの「ゲートウェイキー」でこのキーの「残量」をオンにしてください", barn: "そのコンピューターの magpie に接続できません — 起動しているか、アドレスが正しいか確認してください" }, - de: { none: "Auf diesem Computer wurde noch nichts gelesen — diese Karte aktualisieren, um es lesen zu lassen", old: "Das magpie dieses Computers teilt seine Kontingente noch nicht — aktualisiere magpie dort", shed: "Das magpie dieses Computers ist nicht freigegeben — schalte dort Einstellungen → Netzwerk und Freigabe → Im lokalen Netzwerk freigeben ein", den: "Das magpie dieses Computers hat diesen Schlüssel nicht angenommen — trage bei diesem Anbieter einen seiner Zugangsschlüssel ein", held: "Das magpie dieses Computers nennt diesem Schlüssel keine Kontingente: Er ist dort auf ein Budget, Modelle oder Konten beschränkt — schalte dort unter „Zugangsschlüssel“ bei ihm „Kontingente“ ein", barn: "Das magpie dieses Computers ist nicht erreichbar — prüfe, ob es läuft und die Adresse stimmt" }, - "zh-TW": { none: "那臺電腦還沒有讀過額度 — 重新整理這張卡片讓它讀取", old: "那臺電腦的 magpie 還不能共享額度 — 請在那臺電腦上更新 magpie", shed: "那臺電腦的 magpie 沒有共享 — 請在那臺電腦上開啟 設定 → 網路與共享 → 區域網共享", den: "那臺電腦的 magpie 不認這個金鑰 — 請在這個服務商裡填它的一個閘道金鑰", held: "那臺電腦的 magpie 不向這個金鑰顯示額度:那邊給它限定了預算、模型或帳號 — 請在那臺電腦的「閘道金鑰」裡打開這個金鑰的「額度」", barn: "連不上那臺電腦的 magpie — 請確認它在執行、位址正確" }, + en: { none: "Nothing read on that computer yet — refresh this card to have it read", old: "That computer's magpie doesn't share its quotas yet — update magpie there", shed: "That computer's magpie isn't shared — turn on Settings → Network and sharing → Share on local network there", den: "That computer's magpie didn't take this key — use one of its gateway keys in this provider", held: "That computer's magpie tells this key no quotas: it holds the key to a budget, models or accounts — hover for what to change there", barn: "Couldn't reach that computer's magpie — check that it is running and its address" }, + zh: { none: "那台电脑还没有读过额度 — 刷新这张卡片让它读取", old: "那台电脑的 magpie 还不能共享额度 — 请在那台电脑上更新 magpie", shed: "那台电脑的 magpie 没有共享 — 请在那台电脑上打开 设置 → 网络与共享 → 局域网共享", den: "那台电脑的 magpie 不认这个密钥 — 请在这个服务商里填它的一个网关密钥", held: "那台电脑的 magpie 不向这个密钥显示额度:那边给它限定了预算、模型或账号 — 悬停查看那边要改什么", barn: "连不上那台电脑的 magpie — 请确认它在运行、地址正确" }, + ja: { none: "そのコンピューターではまだ読み取っていません — このカードを更新すると読み取ります", old: "そのコンピューターの magpie はまだ利用枠を共有できません — そちらの magpie を更新してください", shed: "そのコンピューターの magpie は共有されていません — そちらで 設定 → ネットワークと共有 → ローカルネットワークで共有 をオンにしてください", den: "そのコンピューターの magpie はこのキーを受け付けませんでした — このプロバイダーにそちらのゲートウェイキーを入れてください", held: "そのコンピューターの magpie はこのキーに利用枠を伝えません:そちらで予算・モデル・アカウントが制限されています — そちらで変える点はホバーで表示", barn: "そのコンピューターの magpie に接続できません — 起動しているか、アドレスが正しいか確認してください" }, + de: { none: "Auf diesem Computer wurde noch nichts gelesen — diese Karte aktualisieren, um es lesen zu lassen", old: "Das magpie dieses Computers teilt seine Kontingente noch nicht — aktualisiere magpie dort", shed: "Das magpie dieses Computers ist nicht freigegeben — schalte dort Einstellungen → Netzwerk und Freigabe → Im lokalen Netzwerk freigeben ein", den: "Das magpie dieses Computers hat diesen Schlüssel nicht angenommen — trage bei diesem Anbieter einen seiner Zugangsschlüssel ein", held: "Das magpie dieses Computers nennt diesem Schlüssel keine Kontingente: Er ist dort auf ein Budget, Modelle oder Konten beschränkt — für das, was dort zu ändern ist, darüberfahren", barn: "Das magpie dieses Computers ist nicht erreichbar — prüfe, ob es läuft und die Adresse stimmt" }, + "zh-TW": { none: "那臺電腦還沒有讀過額度 — 重新整理這張卡片讓它讀取", old: "那臺電腦的 magpie 還不能共享額度 — 請在那臺電腦上更新 magpie", shed: "那臺電腦的 magpie 沒有共享 — 請在那臺電腦上開啟 設定 → 網路與共享 → 區域網共享", den: "那臺電腦的 magpie 不認這個金鑰 — 請在這個服務商裡填它的一個閘道金鑰", held: "那臺電腦的 magpie 不向這個金鑰顯示額度:那邊給它限定了預算、模型或帳號 — 懸停查看那邊要改什麼", barn: "連不上那臺電腦的 magpie — 請確認它在執行、位址正確" }, }; for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) { diff --git a/internal/provider/remote_quotas.go b/internal/provider/remote_quotas.go index 2399b4662..6e0696895 100644 --- a/internal/provider/remote_quotas.go +++ b/internal/provider/remote_quotas.go @@ -75,7 +75,7 @@ const errRemoteNotShared = "remote magpie isn't shared; turn on Share on local n // on, rather than leaving the remote's Claude or Codex out with no word // (yi_time on Discord: a Claude shared from another computer showed no // usage on any page here, its key held to Claude's models there). -const errRemoteHeld = "remote magpie tells this key none of its quotas, as it holds the key to a budget, models or accounts; turn on Quotas for the key under Gateway keys on that computer" +const errRemoteHeld = "remote magpie tells this key none of its quotas, as it holds the key to a budget, models or accounts; on that computer, turn on Quotas for the key under Gateway keys, and let it use every model of a provider whose usage it is to see" // errRemoteKey is a remote magpie that didn't take this provider's key (401). const errRemoteKey = "remote magpie didn't take this key; use one of its enabled gateway keys"