remote quotas: a key with Quotas on but told no card shows why too (yi_time)
ef6bd155fmade a held remote read show the remote's own card saying why. A key with Quotas on that may use no provider's cards is answered 403 held too (writeCards), so it now shows that card as well, and the full suite went red on TestRemoteMagpieShowsHeldKeyItsQuotas, which expected the key's own card alone. The test now expects the held card, and the words tell such a key what is missing: let it use every model of a provider whose usage it is to see, not only turn Quotas on. The GUI string ends "hover for what to change there" in every language; the core weighs 21 bytes less than before (1,533,980; main is over its budget under #5139, not by this). Run (mote, at 053fc9f9c, once21ea856): - go test -count=1 -run 'Remote|Quota|HeldKey' ./internal/provider ./internal/gateway: ok, ok - node --test usage-remote-cards, routing-remote-windows, i18n-keys (Chromium + WebKit; en, zh, zh-TW, ja, de): 36 pass, 0 fail - TestCoreScriptBudget: red as on main (#5139) - gofmt -l: clean Broken by hand: errRemoteHeld's wording changed, the gateway test went red with the new card's text; restored. Not tried: a real Windows magpie against a real Mac one.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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"])) {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user