Files
magpie/internal/gui
yetone 578053d6aa gui: the menu bar's picker leaves out a card of text alone (Google AI Studio)
LuckymanJC on Discord ticked Google AI Studio in Settings › Allowances
in the menu bar, and the macOS menu bar never showed it. The card comes
from the magpie-gemini-web plugin's ai-studio provider (AIStudio2API).
Its usage reports no allowance: Google AI Studio gives none to read,
and the plugin only knows which models its accounts are cooling down on.
With nothing cooling, the card holds just two text lines (代理出口,
管理页). quotaOfPlugin marks those Text and Aside, trayWindows has no
window left, and trayCardText gives no label, so the menu bar draws
nothing. The picker still offered the card because it asked only
q.windows?.length.

The picker now offers a card with a window that isn't text, or with a
balance. That is what trayCardText can draw (withTrayKinds gives the
same set its trayKind). While an account is cooling, the card has a
used-100 window and is offered and drawn as before. A card ticked
earlier stays in the list, under its card's name instead of its
provider id, so it can be unticked. Comments in renderTrayUsage were
cut to pay for this: app.js is 1,311,353 bytes against 1,311,462 at
origin/main, and no budget was raised.

Run on mote at this tree (970a86ff3 + this change):
- go test ./internal/gui -run 'TestTray|TestCoreScriptBudget': ok
  (new TestTrayTextOnlyCardShowsNothing)
- go test ./internal/provider -run
  'TestPluginTextRowIsText|TestAIStudioServiceLinesAreText': ok
- node --test tray-text-only (new), tray-inuse, tray-totals,
  tray-windows, tray-usage-redraw: ok, Chromium and WebKit, en/zh
  (tray-totals in five languages)
- i18n-keys: "a plugin's words are its own" red, and red the same on
  origin/main 970a86ff3 in a clean worktree. It is already filed as
  #5332, #5327, #5482 and #5426. Nothing in this change touches it.
- gofmt -l clean; GOOS=linux go vet -tags nogui and GOOS=windows go vet
  of internal/gui and internal/provider: ok
Broken by hand: putting back q.windows?.length makes tray-text-only red
("nothing cooling: its card is text alone, not offered").
Not tried: the real app with the real plugin and a Google account. The
plugin's card shape was read from magpie-gemini-web 0.10.0's
lib/studio.mjs (usage, poolUsage, accountUsage, serviceWindows) from npm.

Reported-by: LuckymanJC
2026-11-07 22:36:03 +08:00
..
…
…
upstream: the vendors' own status pages say when their API is down (#971, emo172: an Anthropic or OpenAI outage looked like a sign-in or quota problem) — a provider that calls Anthropic's, OpenAI's or Moonshot's API (by its base URL's host: api.anthropic.com, which the Claude subscription calls too; api.openai.com and chatgpt.com, Codex's; api.moonshot.cn/.ai) carries "API outage" (red), "API degraded" or "API maintenance" beside its name on its Providers row and its Usage card while the vendor's page says so; its title names the parts and the open incidents, and a click opens the incident (or the page), not the row. internal/upstream reads each page's Statuspage-style summary.json (status.claude.com; status.openai.com, incident.io's; status.moonshot.cn), checked by hand on 2026-10-06, and only the API's own parts (Claude API and Claude Code, not claude.ai; Chat Completions, Responses, Codex, Codex CLI, not "Codex in ChatGPT Desktop", which was degraded that day); an incident naming no parts (OpenAI's) counts only while those parts are affected. Pages are read only when the Providers or Usage page asks (GET /api/upstream), at most once in five minutes, never on a request's way; a page that fails, isn't JSON or no longer lists the API's parts is unknown and marks nothing. A relay serving the same models is never marked. DeepSeek's page (Flashduty) has nothing readable and is only known for its link; OpenRouter, xAI, Mistral and z.ai have no page read. The gateway's failure messages, TUI, CLI and tray aren't changed. zh/ja/de added. upstream_test (fake pages from the real summaries: API down, claude.ai down isn't the API, Claude Code degraded, OpenAI's app isn't the API, 503/HTML/changed page unknown, read once in Fresh and Of never waits, hosts; -race -count=5) and gui's TestUpstreamRoute pass; upstream-status (Anthropic down: its provider and the Claude subscription marked, relay/OpenAI/unread Moonshot not, click opens the incident not the row, all well marks nothing; 900 and 440px, the badge whole, the name giving way) passes in Chromium and WebKit, en and zh, and fails 8/8 without the app.js change. i18n-keys, gui-ja, gui-de, click-scroll, account-return, account-models, usage-keys-fold, deprecated-subscriptions and add-sheet pass; go vet, go test ./internal/gui/, linux/windows/nogui builds pass.
2026-10-06 12:36:05 +08:00