Files
magpie/internal/gui
yetone 2c644da040 settings: a Quick check tests image, speech, transcription and search with one real call (EV_John_Liu on X)
EV_John_Liu on X: "现在不是有图片生成、asr、tts管线和网络搜索。能不能做个快速
检测。可用". Settings › Models now ends with a Quick check: a row per
pipeline, each with Test, and Test all. A check makes the smallest real
call through the gateway, the way an agent's request goes:

- image generation: the image model in force (drawer), prompt "a dot", n 1
  (quality low for gpt-image);
- text to speech: the first enabled model that serves speech, "Hi.";
- speech to text: the first that serves transcription, 1s of silence as a
  16 kHz WAV;
- web search: one query through the searcher in force.

A row says ok with the model and how long it took, the vendor's error with
its status (provider.APIError's reading), or that nothing is set up. A 200
with an empty body is not ok. A check costs the user money, so it runs only
on a click: drawing the page calls nothing (the GUI test counts calls).
Disabled models are skipped. tts/whisper models are read from the
provider's own list, since the kept listing leaves them out.
POST /api/pipelines/check answers "Another magpie serves the gateway"
when this one doesn't serve it. pipecheck.js is loaded lazily, so the
core script budget is unchanged.

Run at this head (rebased on ce0cbff61). mote's disk was full (113 MB
free), so the Go and GUI runs went to the Linux box (WSL magpie-desktop):
- gofmt -l clean; go vet linux (-tags nogui) and windows on the Linux box,
  darwin on mote once it had room: all clean.
- go test -tags nogui ./internal/gui/ ok (2033s); go test -run
  'TestCheck|TestPipeline|TestAudio|TestSpeech|TestTranscri'
  ./internal/gateway/ ok; go build -tags nogui . ok.
- pipeline-check.test.cjs, chromium and webkit, en/zh/zh-TW/ja/de, 1100px
  and 400px: 16 of 16 ok. i18n-keys, search-key-list and video-gen-pick
  ok.
- Red the same at origin/main ce0cbff61, not this change: old-webkit
  (headerpresets.js #6030, Safari 15 :has() #5919), settings-search
  (/api/update/using, #5982), settings-hints ja/de 420px in both engines
  (#6073, Linux numbers added there).

The test brings a row into view with the wheel and waits for the scroll
to rest (WebKit's runs on after the event; script scrolls are put back
by app.js), then presses where the button is.

Broken by hand, each red, then restored:
- FirstServing ignoring the provider's own model list: SpeechSaysAWord,
  SpeechSaysTheVendorsError, TranscriptionSendsASecondOfSilence red.
- taking a disabled model: TestCheckSkipsADisabledModel red.
- any answer counted ok: SpeechSaysTheVendorsError red (OK:true Status:400).
- a check run when the page draws: pipeline-check.test.cjs 8 of 8 red in
  chromium (a row showing "Testing…").
- not red: a press that scrolls #view-settings, or that adds 60px above
  the list. app.js holds the clicked element in both cases, so the test's
  "stays put" check guards that app-wide rule (click-scroll owns it), not
  pipecheck.js.

Not tried: a real call to any vendor (fakes only); the real app window
on Windows, Linux or macOS; the whole GUI suite (only the files this can
reach, listed above).
2026-11-11 15:10:25 +08:00
..
gui, proc: the Gateway card quits an older magpie serving the gateway and takes it over, or restarts the gateway (leslie_luo on Discord) — the card said an older magpie served the gateway and to quit it, with no way to tell which process that was. With an older magpie on the port it now has "Quit magpie {v} and take over": the process listening on the gateway's port is found (lsof on a Mac, /proc on Linux, Get-NetTCPConnection on Windows), its program path checked to be magpie's (magpie, magpie-*, dial, .exe/.old), asked to quit (SIGTERM, then SIGKILL after 5 s; TerminateProcess on Windows) and this magpie serves the gateway at once instead of within 15 s. Otherwise the card has "Restart gateway" ("Start gateway" when none runs); a magpie of this version or newer gets no button. Anything else on the port is never ended: a program that isn't magpie, one of another user or an administrator, one that won't quit, or a magpie a LaunchAgent/systemd unit/scheduled task starts again is said under the button with its path and pid, in en/zh/ja/de. TestGatewayFixQuitsOnlyAMagpie (copies of the test binary on a port of its own: one named other-server answering as magpie is left running, one named magpie is quit and the gateway is served here, then restarted) and gateway-takeover.test.cjs (WebKit and Chromium, en and zh, no scroll, no left border) fail without the change; TestListeningOn/TestIsMagpie pass on macOS and in a Linux container. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass.
2026-10-05 15:05:31 +08:00
…
…
update, gui: a new version Windows won't start is never left in place — tried before it goes in, and a restart into one that doesn't say it is up puts the running one back; that version isn't downloaded again by the clock, and Settings › About › Version says why (#894, hisiling) — on Windows 11 with Smart App Control on, the update put the new unsigned exe in place of the running one and restarted into it; CodeIntegrity (3033/3077) refused it, magpie never started again and the working version sat in .old. Now, on Windows, the downloaded exe is first started suspended with no window and ended at once (Windows checks a program when its process is created), and one refused stays out: the running exe isn't moved. At the restart the new process is given MAGPIE_STARTED, a file it writes first thing (AwaitPredecessor); the old one waits up to 20s for it and, if the start fails (ERROR_SYSTEM_INTEGRITY_POLICY_VIOLATION 4551, 1260 or any other), the new process quits before saying so, or it says nothing in time (then it is ended), puts the running exe back over the new one (the new one renamed .blocked if it can't go) and keeps running instead of quitting; nothing notes it as updated in the app. The version is noted in the config folder (update-blocked.json, this machine's only, never synced; gone once a version at least as new runs); the clock's checks leave it alone and show why, a Check clicked downloads and tries it once more. Settings › About › Version: for an application control policy, "0.1.x didn't start on this computer: Windows' Smart App Control (or another app control policy) blocked the new version, which isn't signed. magpie stays on 0.1.y. Download it and run it yourself, or turn Smart App Control off and check again", else the reason, with Download and Check; the error in full on hover. en/zh/ja/de. A user who double-clicks the refused exe is refused by Windows before magpie runs; only signing helps there. TestRelaunchRefusedPutsBack (4551 at the start), TestRelaunchSilentPutsBack (no word in time, killed; quit at once), TestRelaunchReportedStays, TestReportStarted, TestBlockedNote and TestUpdateThatWontStart (the restart doesn't quit, the note, the clock not downloading it again, a Check that does) are new and fail without the change; on Windows TestInstallBinaryRefusedStaysOut, TestTrialStart and TestStartCheckedPutsBackForReal (real processes: not a program, quits at once, runs on silent) pass on the Windows 11 test box with the whole internal/update package (Smart App Control itself isn't on there, so the refusal is simulated). update-blocked.test.cjs (Chromium and WebKit, en and zh: the reason and both versions, full error on hover, Download opens the release, Check downloads, the other reason, no select, no scroll, no left border) fails without the change; update-check, update-mirror, update-auto, update-wait and update-download-percent pass in WebKit; click-scroll's request-list case fails now and then the same on main. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass.
2026-10-05 19:43:31 +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