Commit Graph
7 Commits
Author SHA1 Message Date
yetone 461f9b1ff9 providers: a model chip's right-click turns its image input on or off (archsiono on X)
archsiono on X: "Magpie 给模型开图片输入的开关藏在「名称与推理档位」里,谁能找到 😅
建议在模型右键提供配置". The only place to tell agents a model sees images was
the Accepts images tick inside Names, prices & levels.

A model chip's right-click menu in the provider editor now has Turn on
image input / Turn off image input (开启/关闭图片输入, zh-TW, ja, de too),
under Copy model ID, for every model but a decision model. It stages the
same modelPrefs images value the tick stages: the tick follows, the footer
says "{model} accepts images once saved", and the Save sends it. Nothing
is saved, picked or scrolled by the item.

The core scripts were already 105 bytes over TestCoreScriptBudget on
origin/main 7dd2434d3 (1,533,907 > 1,533,802). This change pays for itself
and that by cutting ten of the provider editor's model-list comments to one
line each: the core is 1,533,139, app.js 1,311,013, no raise.

model-test-as, model-test-why and model-api-preset count the menu's items;
they now expect the image item as the third.

Run on mote (macOS 27), at this tree:
- GUI: model-images-menu (new), model-kind, model-api-preset,
  model-test-as, model-test-why, model-test-one, provider-levels-save,
  i18n-keys, click-scroll, provider-detect-models: 102 of 102 pass,
  Chromium and WebKit; the new file covers en/zh/ja/de at 900 and 420.
- Broken by hand: the new file on origin/main without this change, 8 of
  8 red (no such item).
- go test ./internal/gui: ok except TestMainWindowCorners/macOS_26_SDK,
  red on macOS 27 and filed as #3949. TestCoreScriptBudget passes.
- gofmt -l: clean.
Seen on the way: model-copy-id is 4 of 4 red alone on origin/main
7dd2434d3 (gpt-5.1's chip isn't drawn); commented on #4621.
Not tried: the real app window.
2026-11-04 19:23:24 +08:00
yetone ce8b67de37 gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called
page.goto with no timeout of its own, so Playwright held the first load
of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a
busy box (a whole-suite run at load 130-160) that load took longer and
goto timed out. The same pattern is in 988 GUI test files (1174 pages):
every one of them now also sets setDefaultNavigationTimeout(60000) on
the same page, right after its default, so goto, reload and waitForURL
wait on the load itself with room, while clicks and waits keep their
short bar. group-from-model-add's own 20s navigation bar is raised to the
same minute. claude-switch-only also gives its first provider row (drawn
from the page's first reads) a minute before clicking it.

nav-timeout.test.cjs (no browser) reads every GUI test file and names
each page given a default under a minute without a navigation timeout of
at least a minute, so a new file can't bring the pattern back.

What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from
other sessions):
- node --check on every file in internal/gui/tests: all parse.
- nav-timeout.test.cjs against origin/main's test files: red (names the
  1174 pages); against this tree: its only reds were my own probe copies
  of the old files, since removed.
- By hand: claude-switch-only with app.js served 7s late (a busy box's
  first load), --test-name-pattern "1100 en": origin/main's file 4 of 4
  red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green.
- claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420:
  32 of 32. group-from-model-add, usage-access-key-card and i18n-keys:
  green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red
  on a 5s waitForFunction at line 115 (a wait after load, not the
  navigation), at load ~230.

Not tried: the whole GUI suite (about 1000 files; the change is one
mechanical line per page), Windows or mote (mote's browsers, #4125).
2026-10-31 02:09:18 +08:00
yetone 82be8c14a5 gui tests: a model chip's right-click settles in Chromium before its menu is read
model-api-preset, model-test-why, provider-detect-models and model-copy-id
failed in Chromium only, on main. They were stale tests, not app bugs:
- To right-click a chip out of sight, Playwright scrolls the editor first.
  Chromium sends that scroll's event a frame later, after the menu has
  opened, and a menu closes on a scroll, so its items were detached under
  the click. rclick() now scrolls the chip in with a trial click, lets two
  frames pass, then right-clicks.
- model-copy-id read the footer as soon as the fake server had the id,
  before the page had the answer. It now waits for the footer.
- model-api-preset's one-API chip menu now has Copy model ID beside its
  test (81879b90). It expects those two items and no "Asked on".

All four pass in Chromium and WebKit, en and zh.
2026-10-06 05:07:13 +08:00
FanbuzandClaude Opus 5.5 3ce0a0bf27 fix: 收敛中文界面文案 (#846)
删去中文提示里的过程叙述和动机解释,保留数字、条件和后果;同步更新相关测试的中文断言。

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 10:27:19 +08:00
yetone 71d96e28e8 system one: a decision provider's own models-list URL is asked as given, and its models can each be tested (Discord, ARNO: OpenRouter added as a System One provider with the list https://openrouter.ai/api/v1/models?limit=500&output_modalities=decisions didn't get its models, and a model typed in by hand couldn't be tested from its right-click) — a System One-only provider went to fetchDecide before its ModelsURL was read, so magpie asked …/models, which at OpenRouter lists the 466 chat models, and kept only Jev's ids of those: typesafe/jev-router alone. With a ModelsURL, fetchDecide now asks it as written, query included, and keeps every id in it, since that list is of decision models already (OpenRouter's answers 13: pplx-decider, liquid/d1, cloudflare/clef, respan/span-01, typesafe/jev-1.13 …). Without one nothing changes, Bailian included. Testing a decision model was refused outright (the chip's Test this model off, Test models leaving them out); where the API takes System One's own body (System One, TypeSafe, OpenRouter, Vercel's TypeSafe API) each model is now sent AskSystemOne's yes-or-no question, the one Detect already asks, and the editor offers Test for it (providerJSON.decideTest); Vercel's evaluation models and Workers AI, which wrap it their own way, still say why not. TestDecideModelsURLAndModelTest (a fake OpenRouter: the plain list, the decisions list, a hand-added model through /systemone, an unknown one failing) and TestModelTest's Workers AI case fail on the old code; model-test-why.test.cjs gains a hand-added System One model tested from its chip and Test models, and a Workers AI one still off (WebKit en and zh pass, with model-test-one and model-copy-id; Chromium doesn't launch in this sandbox). OpenRouter's live decisions list returns the 13 models. Not tried with an OpenRouter key: the /systemone question itself. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. 2026-10-04 18:40:13 +08:00
yetone 81879b90f3 providers: a model chip's right-click menu copies the model's id (Discord, ARNO on v0.1.815: 希望provider的模型右击菜单除了测试模型外,还能添加拷贝模型id的功能) — the menu a chip opens in a provider's editor had Test this model (and Asked on … where the provider has more than one API) and nothing to take the id with; a chip shows the model's name where it has one, so the id (zai/glm-5.3-flash under "GLM 5.3 Flash") had to be read off its tooltip and typed. The menu now has Copy model ID / 复制模型 ID under Test this model, through the app's own menu (openRowMenu) and copy(): magpie's /api/copy, the page's clipboard and the copy command after it, as every other copy in the app; the footer says "Model ID {model} copied" / 已复制模型 ID {model}. It is on where the model can't be tested (an own-API subscription's, a classifier's) too. The app has English and Chinese strings only (i18n.js has no Japanese table). model-copy-id.test.cjs (a relay's prefixed, plain and hand-picked ids and an own-API account's: the id, not the name, is posted to /api/copy, the footer says so, nothing is tested, picked or scrolled, no left-border accent; en and zh) fails on the old code and passes in WebKit; model-test-why expects the second item beside the disabled test one. model-test-one, model-test-why, provider-typed, provider-detect-models and click-scroll pass in WebKit; Chromium doesn't launch here, so not tried there. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried in the app's own window (its /api/copy path is the one the other copies use). 2026-10-04 13:36:54 +08:00
yetone a6b9a7517d providers: a ClinePass model's test is asked as Cline asks, and every provider's model chips say on a right-click whether they can be tested (ARNO on Discord: clinepass的free模型在右击检测的时候会报错 cline-free/xxxxx 没有响应: 500·empty response content; 有些provider里的模型可以右击检测,有些却不可以,为什么?) — the test already carried Cline's desktop headers (probe sets ClineClient), but its body was the generic smallest one: not streamed, max_tokens 16. Cline's free models (deepseek-v4.1-flash, mimo…) reason first, so 16 tokens left nothing to say and the Cline API answered 500 "empty response content", while agents' requests (streamed, with room) were answered (lml). A Cline probe (clineProbe) is now asked as Cline's clients ask: stream true, max_tokens 1024; and probe reads any streamed answer only to the model's first word, thought or tool call (Chat, Responses and Anthropic events), so the room isn't spent, and an error the stream gives after its 200 (an error chunk, Anthropic's error event, response.failed) fails the test with its message instead of passing it — this also applies to the probes that already streamed (stream-only accounts, OpenCode Zen's free tier); a stream that ends with neither is answered, as a 200 was. Which models could be tested was !decide && !account in app.js, with no reason: every signed-in account lost the right-click and Test models, even those magpie sends requests at an endpoint (Claude, Codex, Copilot, Grok, WorkBuddy, ZCode, plugins), whose endpoint Test was offered and which TestModels already handled. provider.ModelTest now says why a provider's models can't each be tested — "decide" for a classifier, "own-api" for a sign-in reached only through its agent's own API (Cursor, Devin, Kiro, Zed, Qoder, a Google sign-in), whose requests the gateway translates and which has no endpoint to probe — and providerJSON carries it as modelTest. The chip's right-click and Test models are offered wherever it is empty; elsewhere the right-click still opens the menu, its Test this model off with the reason under it and as its title (openRowMenu items take a why), and Test models is shown off with the reason as its title; en and zh, no coloured left border, nothing scrolls. TestModels refuses a classifier's model rather than probe its endpoint. No request was made to Cline. TestClineModelTestStreams (a fake Cline API that answers 500 "empty response content" to a non-streamed 16-token request and a stream to Cline's), TestProbeReadsTheStream and TestModelTest fail without the change; model-test-why.test.cjs (WebKit, and Chromium through a temp copy on plain chromium.launch(); en and zh: a Codex account's chip tests its model and Test models is on; a Kiro account's right-click shows the item off with the reason in the menu and its title, the menu fits, Test models off with the reason, nothing posted, nothing moved) fails without it. model-test-one, click-scroll, account-models, provider-typed and models-free-only pass in WebKit and Chromium. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./... under a temp HOME pass (TestFXInState failed once on its TempDir cleanup race, passes on the rerun; untouched). 2026-10-02 14:20:08 +08:00