From a24a5f6af45cf0050b8fe81a9bcd54eacee0f1ff Mon Sep 17 00:00:00 2001 From: yetone Date: Mon, 16 Nov 2026 22:03:02 +0800 Subject: [PATCH] gui: a model test its vendor queued shows queued, not green (sufeng1894 on X) sufeng1894 (v0.1.4248) added Qoder China and QwenWork providers (both served by the Qoder plugin): their models were green in the provider's Test, and every request through Routing failed with 503. A Qoder/QwenWork plan queues a model (code 10605, e.g. "this plan's queue: p4"). The test sends x-magpie-fallback, the plugin answers the queue's 503 at once, and probe counts it OK with Result.Queued (d3aecfe95). The GUI drew that as a green dot and "answered", while routing gives way from a queued member at once (503 busy) and the last member's wait ends in the queue's 503 (4 minutes unstreamed; a frozen queue after 5 minutes with qoder 0.2.71, v0.1.4321). So Test said the opposite of what Routing does. Now a queued result is its own state: an amber dot, its title "Queued at its vendor, not answered: ", and Test models' and Test this model's status say the same and are not "ok". Working only still keeps a queued model, as the test's OK says (a queue clears). renderEndpoints is not a sibling: it is drawn only when no address is plugin://, and only plugins report queued. core_budget_test.go: +135 for it, the reason in the comment; one string (queuedSaid) shared by all three places. Run (mica-run/mote-run, at origin/main 8608ce024): - models-queued.test.cjs (chromium, webkit): 4/4 ok; with the old app.js 4/4 red ("a queued model's dot isn't green", and the single test's status timed out waiting for the queued dot). - go test -run Budget ./internal/gui: ok. - every models-*, model-*, provider*, i18n-* and test-* GUI file: 2430 tests, 2323 ok, 107 red (mote). The same 107 in the same 11 files are red at untouched origin/main 8608ce024 (146 run, 107 red), all filed: i18n-keys (#6877), models-works-only (#4391), model-chip-steady (#4388), model-copy-id (#4621), model-api-preset (#5838), provider-max-output and provider-many-keys (#6209), provider-fetch-again, provider-models-rest, provider-picks-stay and provider-typed (#6532). A first run on mica died of ENOSPC (its disk is full) and tested nothing. - Rebased onto 07f7e0b45 (nothing under internal/gui changed since 8608ce024): the budget test and models-queued + model-test-one (8/8) ran again there, ok. Not tried: a real Qoder China or QwenWork account; the reporter's 503 body, so which queue (or another cause) their 503s carry is not confirmed. --- docs/subsystems/provider-plugins.md | 2 +- internal/gui/assets/app.css | 1 + internal/gui/assets/app.js | 19 +++++++--- internal/gui/assets/i18n.js | 4 ++ internal/gui/core_budget_test.go | 4 +- internal/gui/tests/models-queued.test.cjs | 46 ++++++++++++++++++----- 6 files changed, 59 insertions(+), 17 deletions(-) diff --git a/docs/subsystems/provider-plugins.md b/docs/subsystems/provider-plugins.md index cc00f9a94..6274c5c0b 100644 --- a/docs/subsystems/provider-plugins.md +++ b/docs/subsystems/provider-plugins.md @@ -174,7 +174,7 @@ So `forwardOnce` sets two more headers on every plugin request, each dropped fir A free model's vendor may queue a request for minutes: Qoder answers its code 10605 and its plugin waits in Qoder's queue as Qoder's client does (up to 4 minutes), CodeArts answers a 429 with `queue-status: queued` and its plugin polls the trace for up to 5 minutes. While another account, provider or routing group member could answer at once, that wait only keeps the agent waiting (axuhere on X: "模型请求正在排队 · 预计等待超过 10 分钟"). -So the try loop marks a try that isn't the last candidate (`withFallback` in [`continuation.go`](../../internal/gateway/continuation.go), from `!last` in the loop), and `forwardOnce` sets `x-magpie-fallback: 1` (`provider.FallbackHeader`) on that plugin request; a header the agent sent under that name is dropped first. A plugin told so answers a queued request at once, a 503 with the queue's Retry-After and a message that says the queue (Qoder 0.2.40: "Qoder queued the request for dfmodel (this plan's queue: p3, 3 ahead); try again in 30s"; CodeArts 0.2.3 leaves the queue first). The 503 is `busy`, so the next candidate is asked, the trace shows the try's reason, and the queued one may be asked again in a replan round after its Retry-After. The last candidate is never told, and its plugin waits in the queue as the vendor's client does. `unsaid` in `host.js` takes the header off whatever the plugin sends on. A plugin model's test sends it as well, so a queued model is said at once there too; the test counts that 503 as answered (`Result.Queued` holds the queue's message, shown as the chip's title; Working only keeps the model), since a queued model is served and an agent's turn waits it out (`probe` in [`test.go`](../../internal/provider/test.go), `TestPluginModelTestSaysQueued`, `models-queued.test.cjs`). +So the try loop marks a try that isn't the last candidate (`withFallback` in [`continuation.go`](../../internal/gateway/continuation.go), from `!last` in the loop), and `forwardOnce` sets `x-magpie-fallback: 1` (`provider.FallbackHeader`) on that plugin request; a header the agent sent under that name is dropped first. A plugin told so answers a queued request at once, a 503 with the queue's Retry-After and a message that says the queue (Qoder 0.2.40: "Qoder queued the request for dfmodel (this plan's queue: p3, 3 ahead); try again in 30s"; CodeArts 0.2.3 leaves the queue first). The 503 is `busy`, so the next candidate is asked, the trace shows the try's reason, and the queued one may be asked again in a replan round after its Retry-After. The last candidate is never told, and its plugin waits in the queue as the vendor's client does. `unsaid` in `host.js` takes the header off whatever the plugin sends on. A plugin model's test sends it as well, so a queued model is said at once there too; the test counts that 503 as no failure (`Result.OK` with `Result.Queued` holding the queue's message; Working only keeps the model), since a queued model is served and an agent's turn waits it out. It didn't answer either: routing gives way from it at once while another member is left, and its last member's wait can end in the queue's 503, so the GUI shows it queued, an amber dot whose title, like the status line, says the queue and "not answered", never green or "answered" (@sufeng1894 on X) (`probe` in [`test.go`](../../internal/provider/test.go), `TestPluginModelTestSaysQueued`, `models-queued.test.cjs`). `TestPluginToldAnotherFollows` ([`plugin_fallback_test.go`](../../internal/gateway/plugin_fallback_test.go)) sends a group of two members through the fake plugin: the first is told, gives way with a 503, and the second answers untold; a lone model is never told, and the vendor never gets the header. diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index 7ff9dde89..06f1be03b 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -4061,6 +4061,7 @@ body:not(.side-nav) #addSheet > .row-head.stuck::before { opacity: 1; box-shadow /* how a model answered Test models: a dot after its name */ .mchip .tdot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--faint); } .mchip .tdot.ok { background: var(--green); } +.mchip .tdot.queued { background: var(--amber); } .mchip .tdot.bad { background: var(--red); -webkit-mask: var(--x-mark) center / contain no-repeat; mask: var(--x-mark) center / contain no-repeat; border-radius: 0; transform: scale(1.5); } .mchip .tdot.wait { animation: tdot 1s ease-in-out infinite alternate; } @keyframes tdot { to { opacity: .25; } } diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index ce2abb68d..61e3fcf15 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -11390,17 +11390,22 @@ function emptyModelsHint(p) { if (providers?.fetching && !p.fetched && !p.listError) return "Asking your resource for its deployments with this key…"; return "No deployments came back for this key. Fetch models again, or type a deployment's name as a model id."; } +// queuedSaid: a model test's result its vendor queued, which is no answer: +// routing gives way to the next member at once, and the last one's wait +// can end in the queue's 503 (@sufeng1894 on X) +const queuedSaid = (x) => t("Queued at its vendor, not answered: {queue}", { queue: x.queued }); function renderModels(p) { // a chip's dot: how its model answered, when it has been asked const tested = (c, id) => { const got = modelTests[p.id]; if (!got || !(id in got)) return; const x = got[id]; - c.append(el("span", "tdot " + (!x ? "wait" : x.ok ? "ok" : "bad"))); + // queued: neither green nor a failure (queuedSaid) + c.append(el("span", "tdot " + (!x ? "wait" : x.queued ? "queued" : x.ok ? "ok" : "bad"))); // the API it was asked on said, where the answer says (01huadalang: // 右键选择测试只能测试出是不是通的,不能说什么协议是通的) const via = x?.protocol ? apiLabel(x.protocol) : ""; - c.title = !x ? t("Testing…") : x.ok && x.queued ? x.queued : x.ok ? (via ? t("Answered via {api} in {took}", { api: via, took: ledTook(x.ms) }) : t("Answered in {took}", { took: ledTook(x.ms) })) : (via ? via + " · " : "") + (x.status ? x.status + " · " : "") + x.error; + c.title = !x ? t("Testing…") : x.queued ? queuedSaid(x) : x.ok ? (via ? t("Answered via {api} in {took}", { api: via, took: ledTook(x.ms) }) : t("Answered in {took}", { took: ledTook(x.ms) })) : (via ? via + " · " : "") + (x.status ? x.status + " · " : "") + x.error; }; // a chip's right-click tests that model alone (yonghe); off, saying why, where it can't be (ARNO) const noTest = modelTestWhy(p); @@ -12166,7 +12171,11 @@ function renderModels(p) { const r = await provTest(p.id, { ...asTyped(), test: ids }); r.results.forEach((x, i) => { got[ids[i]] = x; }); const i = r.results.findIndex((x) => !x.ok), x = r.results[i], bad = r.results.filter((x) => !x.ok).length; - status(x ? t("{n} of {all} models didn't answer; {model}: {error}", { n: bad, all: ids.length, model: ids[i], error: (x.status ? x.status + " · " : "") + x.error }) : t("All {n} models answered", { n: ids.length }), x ? "err" : "ok"); + // a queued model didn't answer, though it isn't a failure either + const k = r.results.findIndex((x) => x.queued); + status(x ? t("{n} of {all} models didn't answer; {model}: {error}", { n: bad, all: ids.length, model: ids[i], error: (x.status ? x.status + " · " : "") + x.error }) + : k >= 0 ? ids[k] + ": " + queuedSaid(r.results[k]) + : t("All {n} models answered", { n: ids.length }), x ? "err" : k >= 0 ? "" : "ok"); } catch (e) { delete modelTests[p.id]; testErr(e); } draw(); }); @@ -12180,8 +12189,8 @@ function renderModels(p) { const r = await provTest(p.id, { ...asTyped(), test: [id], as, account }); const x = got[id] = r.results[0]; const api = x.protocol ? apiLabel(x.protocol) : "", took = ledTook(x.ms), model = id, error = (x.status ? x.status + " · " : "") + x.error; - status((x.ok ? (api ? t("{model} answered via {api} in {took}", { model, api, took }) : t("{model} answered in {took}", { model, took })) - : api ? t("{model} didn't answer via {api}: {error}", { model, api, error }) : t("{model} didn't answer: {error}", { model, error })) + (p.testPicks && x.account ? " · " + x.account : ""), x.ok ? "ok" : "err"); + status((x.queued ? model + ": " + queuedSaid(x) : x.ok ? (api ? t("{model} answered via {api} in {took}", { model, api, took }) : t("{model} answered in {took}", { model, took })) + : api ? t("{model} didn't answer via {api}: {error}", { model, api, error }) : t("{model} didn't answer: {error}", { model, error })) + (p.testPicks && x.account ? " · " + x.account : ""), x.queued ? "" : x.ok ? "ok" : "err"); } catch (e) { delete got[id]; testErr(e); } draw(); }; diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index bc3de918d..0932fddbc 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -3099,6 +3099,7 @@ const I18N = { "Send a tiny request to each model agents see, to find the ones that don't answer": "向 Agent 可见的每个模型发一个极小请求,找出无响应的模型", "{n} of {all} models didn't answer; {model}: {error}": "{all} 个模型中有 {n} 个没有响应;{model}:{error}", "All {n} models answered": "{n} 个模型全部可用", + "Queued at its vendor, not answered: {queue}": "在供应商处排队,尚未响应:{queue}", "Right-click to test just this model": "右键可单独测试这个模型", "Right-click a model to test just it": "右键点击某个模型可单独测试它", "Each model is tested with the first ticked key that can serve it": "每个模型用第一个已勾选、能提供它的密钥测试", @@ -8426,6 +8427,7 @@ const I18N = { "Send a tiny request to each model agents see, to find the ones that don't answer": "向 Agent 可見的每個模型發一個極小請求,找出無回應的模型", "{n} of {all} models didn't answer; {model}: {error}": "{all} 個模型中有 {n} 個沒有回應;{model}:{error}", "All {n} models answered": "{n} 個模型全部可用", + "Queued at its vendor, not answered: {queue}": "在供應商處排隊,尚未回應:{queue}", "Right-click to test just this model": "右鍵可單獨測試這個模型", "Right-click a model to test just it": "右鍵點選某個模型可單獨測試它", "Each model is tested with the first ticked key that can serve it": "每個模型用第一個已勾選、能提供它的金鑰測試", @@ -13774,6 +13776,7 @@ const I18N = { "Send a tiny request to each model agents see, to find the ones that don't answer": "エージェントに見える各モデルに小さなリクエストを送り、応答しないモデルを見つけます", "{n} of {all} models didn't answer; {model}: {error}": "{all} 個中 {n} 個のモデルが応答しませんでした。{model}:{error}", "All {n} models answered": "{n} 個のモデルすべてが応答しました", + "Queued at its vendor, not answered: {queue}": "提供元で順番待ち中で、まだ応答していません:{queue}", "Right-click to test just this model": "右クリックでこのモデルだけをテスト", "Right-click a model to test just it": "モデルを右クリックするとそのモデルだけをテストできます", "Each model is tested with the first ticked key that can serve it": "各モデルは、それを提供できる最初のチェック済みキーでテストされます", @@ -19131,6 +19134,7 @@ const I18N = { "Send a tiny request to each model agents see, to find the ones that don't answer": "Eine winzige Anfrage an jedes Modell senden, das Agenten sehen, um die nicht antwortenden zu finden", "{n} of {all} models didn't answer; {model}: {error}": "{n} von {all} Modellen haben nicht geantwortet; {model}: {error}", "All {n} models answered": "Alle {n} Modelle haben geantwortet", + "Queued at its vendor, not answered: {queue}": "Beim Anbieter in der Warteschlange, keine Antwort: {queue}", "Right-click to test just this model": "Rechtsklick, um nur dieses Modell zu testen", "Right-click a model to test just it": "Rechtsklick auf ein Modell testet nur dieses", "Each model is tested with the first ticked key that can serve it": "Jedes Modell wird mit dem ersten angehakten Schlüssel getestet, der es bereitstellen kann", diff --git a/internal/gui/core_budget_test.go b/internal/gui/core_budget_test.go index 2bde6d71c..49cd2dacb 100644 --- a/internal/gui/core_budget_test.go +++ b/internal/gui/core_budget_test.go @@ -17,8 +17,8 @@ import ( // never what pays for a change (#5918); the history of each number is in // `git log -L` of this file. const ( - appScriptBudget = 1_087_246 // app.js: 1,080,614 at 8016205e3, with the 5,653 of room it had; +123 for a sidebar list folded from its page's row (hkwok06 on X), its chevron and fold in navicons.js, imported with the first list; +57 for each account of a provider's Usage card in a card of its own (normalcoder_ on X), past the 24 of room left; +17 for an allowance card's wallet line under its rings (apple_test_src on X), the one filter shared with its text line; +338 for the Daily update channel (fishmagic80 on X): its segment, its line under Update channel and the version row's two Up to date on Daily words, packed to the shortest form (one t() per choice); Settings › About and renderUpdate draw them on every window, so there is no page to move them to; +35 for Baidu Qianfan's Token Plan sign-in (yuushabu_buyinn on X, #5860): its field in qianfanplan.js, imported when such a provider's editor opens, drawn by renderStepPlan now told whose sign-in it brings, and what is left is the import and two quotaError lines, past the room there was; quotaError reads every card's error, so there is no page to move it to; +27 for Windows' title bar (258a14 on X): the caption buttons, their clicks, the bar's double click and what keeps them over a dialog in wincap.js, imported in Windows' window alone, the header's room for them in app.css, and what is left is the one line that imports it, past the 29 of room there was; that window's frame is drawn on every start, so there is no page to move it to; +107 for the pages in the reader's own order (chet030714 on X): the order, the sidebar and tab bar put in it, and the menu's drag and keys in navorder.js and navpages.js, imported once an order is kept or Settings draws, and what is left is the one line in navHides that imports it; navHides runs on every start, so there is no page to move it to; +275 for the grants Alibaba's Token Plan asks of a RAM user's AccessKey in the reader's language (MetalHqa on X): one string (ALI_RAM) shown under the editor's AccessKey ID and on the card that names them, less the 48 of the wrong "a RAM user that may use Model Studio is enough" it replaces; the editor and quotaError draw them on every window, so there is no page to move them to - coreScriptBudget = 1_271_336 // every core script at 8016205e3, the old measure 682 over its cap there (#5918); +367 for the model test on a chosen account (tmr11235), no page left to move it to; +151 for the provider menu's "Only on this device" item and its four translations; +458 for Settings › About's Report a problem row and its translations; +113 for withScheme, the one rule every typed address goes through (eachg0 on X), cut to the shortest form that keeps it whole; +10 for the kept whole's tooltip (Musikrv77852 on X), the past-cycle line reused for it, no page left to move it to; +1,112 for Codex's Open button and its Open Codex with menu (Yink88564391 on X), packed to the shortest form, no page left to move them to; +168 for Discover's long lists drawn in part (the owner, 11-13), after the rest of its hook moved into plugingrid.js, imported when Plugins first draws; +296 for the cap toggle and Smart sentences that say what they do and the Sign in on another computer row (Wing8Aqua on X), packed to the shortest form, no page left to move them to; +333 for In turn's figure in a provider's editor and its words naming the message that goes round (Wing8Aqua on X), the figure itself in rotfig.js, imported when In turn is first shown, the hook packed to the shortest form; +236 for a lone capped Codex account's row saying its turns go to the fallbacks when Codex is connected (not_4O4 on X), the two helpers inlined, no page left to move it to; +717 for omp's advisor (Awad_Yoo on X, #6408): its three rows moved into ompadvisor.js, imported when an omp's settings show, and what is left is the import, the role's " · off" and the Settings line's name, packed to the shortest form; +468 for a plugin's own file import (auth.import) in the import sheet, in the plugin's words (marchen_cc on X), packed to one statement; importSay is read as the Providers rows draw, so it has no lazy page to go to, and nothing else was moved out; +180 for Claude Magpie's own Claude Code folder (xMopf7RF on X, #6459): its Advanced fold in claudemagpie.js, imported when it first shows, and what is left is the import and the fold's place in the Separate app line, 216 bytes packed to the shortest form, less the 36 of room there was; +81 for the Use Claude Magpie button on Claude Desktop's row (xMopf7RF on X), drawn by claudemagpie.js too, what is left the one line that places it (#2710); +225 for the Hermes row's Other profiles lines (Norethcy on X), which 1d60b165c took out while each profile had a row and c96f33d65 left with no place at all, packed to the shortest form; the dead hermes# Default note went with it, and the Agents rows draw it, so there is no page to move it to; +397 for a key's own price rate (tnt12231 on X): its lines, check and placeholder in keyrates.js, imported when a provider with two or more keys opens, and what is left is the import, the draft's copy, Advanced opening for it, the save's one line and proxyLines drawing another kind of line; +316 for an image or video model's chip saying what it makes from its right-click (iceloon on X): the chat chip's Makes… now shared with it, and the media chip's Copy model ID left out, packed to the shortest form; the provider's editor draws it, so there is no page to move it to; +67 for the Claude Code · Claude Magpie row saying it is on magpie through Claude Magpie (xMopf7RF on X), one line in connectLine with the shortest words that say it; the Agents rows draw it, so there is no page to move it to; +12 for AIGoCode's logo in pngIcons (MindfulReturn on X), the list every drawn icon is looked up in; +491 for each cost in the tray panel's and Requests' chart and ranking in its own provider's currency (onkashiko on X): ledProv and the provider passed through, packed to the shortest form; drawLedColumns and drawLedRank are shared by the panel, so there is no page to move it to; +326 for the Qwen AI platform's Token Plan sign-in (imthe99galaxy on X): its field, sign-in and wait in qianwenplan.js, imported when such a provider's editor opens, and what is left is the import and one quotaError line for its two refusals, packed to the shortest form; quotaError reads every card's error, so there is no page to move it to; +72 for Copy all keys (emilochen on X): its row in keyrates.js, imported when a provider with two or more keys opens through keyRateField, now told which of its parts to draw, and what is left is the one line that places it; +83 for the page saying it has gone from view, so what its Sessions and Usage pages keep goes in 30 s and not 7 minutes (P0 memory): folded into the visibilitychange listener every window has, packed to the shortest form, so there is no page to move it to; +270 for Providers' Select, to remove several at once (eiyuuzaki2333 on X): its rows, bar, removal and keys in pvpick.js, imported when Select is first clicked, and what is left is pvSel, the button's click and two lines in renderProviders, which draws the list, so there is no page to move it to; +81 for each account of a provider's Usage card in a card of its own (normalcoder_ on X): one line that makes the box, its brief look left to CSS, and renderQuotas, which draws every card, so there is no page to move it to; +17 for Kimi Code's booster balance under an allowance card's rings in the tray panel (apple_test_src on X): the card's text line and the wallet line share one filter, packed to the shortest form; panelQuotaCard draws every card, so there is no page to move it to; +51 for what a failed plugin install left in plugins/, listed under Installed with a Remove (CHENGJIAHEGOXIS on X): its section in plugininstalled.js as pmLeftovers, imported when Plugins first draws, and what is left is the one call after drawInstalled; draw is what draws the page, so there is no page to move it to; +123 for a sidebar list folded from its page's row (hkwok06 on X): the chevron, its click and the fold kept per page in navicons.js, imported with the first list, and what is left is the folded list read beside the hidden pages' (navList, which navMine now shares) and the two rows' clicks asking navFold first; navSubs draws every list, so there is no page to move it to; +338 for the Daily update channel (fishmagic80 on X): its segment, its line under Update channel and the version row's two Up to date on Daily words, packed to the shortest form (one t() per choice); Settings › About and renderUpdate draw them on every window, so there is no page to move them to; +35 for Baidu Qianfan's Token Plan sign-in (yuushabu_buyinn on X, #5860): its field in qianfanplan.js, imported when such a provider's editor opens, drawn by renderStepPlan now told whose sign-in it brings, and what is left is the import and two quotaError lines, past the room there was; quotaError reads every card's error, so there is no page to move it to; +27 for Windows' title bar (258a14 on X): the caption buttons, their clicks, the bar's double click and what keeps them over a dialog in wincap.js, imported in Windows' window alone, the header's room for them in app.css, and what is left is the one line that imports it, past the 29 of room there was; that window's frame is drawn on every start, so there is no page to move it to; +107 for the pages in the reader's own order (chet030714 on X): the order, the sidebar and tab bar put in it, and the menu's drag and keys in navorder.js and navpages.js, imported once an order is kept or Settings draws, and what is left is the one line in navHides that imports it; navHides runs on every start, so there is no page to move it to; +275 for the grants Alibaba's Token Plan asks of a RAM user's AccessKey in the reader's language (MetalHqa on X): one string (ALI_RAM) shown under the editor's AccessKey ID and on the card that names them, less the 48 of the wrong "a RAM user that may use Model Studio is enough" it replaces; the editor and quotaError draw them on every window, so there is no page to move them to + appScriptBudget = 1_087_381 // app.js: 1,080,614 at 8016205e3, with the 5,653 of room it had; +123 for a sidebar list folded from its page's row (hkwok06 on X), its chevron and fold in navicons.js, imported with the first list; +57 for each account of a provider's Usage card in a card of its own (normalcoder_ on X), past the 24 of room left; +17 for an allowance card's wallet line under its rings (apple_test_src on X), the one filter shared with its text line; +338 for the Daily update channel (fishmagic80 on X): its segment, its line under Update channel and the version row's two Up to date on Daily words, packed to the shortest form (one t() per choice); Settings › About and renderUpdate draw them on every window, so there is no page to move them to; +35 for Baidu Qianfan's Token Plan sign-in (yuushabu_buyinn on X, #5860): its field in qianfanplan.js, imported when such a provider's editor opens, drawn by renderStepPlan now told whose sign-in it brings, and what is left is the import and two quotaError lines, past the room there was; quotaError reads every card's error, so there is no page to move it to; +27 for Windows' title bar (258a14 on X): the caption buttons, their clicks, the bar's double click and what keeps them over a dialog in wincap.js, imported in Windows' window alone, the header's room for them in app.css, and what is left is the one line that imports it, past the 29 of room there was; that window's frame is drawn on every start, so there is no page to move it to; +107 for the pages in the reader's own order (chet030714 on X): the order, the sidebar and tab bar put in it, and the menu's drag and keys in navorder.js and navpages.js, imported once an order is kept or Settings draws, and what is left is the one line in navHides that imports it; navHides runs on every start, so there is no page to move it to; +275 for the grants Alibaba's Token Plan asks of a RAM user's AccessKey in the reader's language (MetalHqa on X): one string (ALI_RAM) shown under the editor's AccessKey ID and on the card that names them, less the 48 of the wrong "a RAM user that may use Model Studio is enough" it replaces; the editor and quotaError draw them on every window, so there is no page to move them to; +135 for a model test its vendor queued shown queued and not green (sufeng1894 on X): queuedSaid, one string shared by the chip's title, Test models' and Test this model's status, and the chip's amber dot; renderModels draws the provider editor's chips, so there is no page to move it to + coreScriptBudget = 1_271_471 // every core script at 8016205e3, the old measure 682 over its cap there (#5918); +367 for the model test on a chosen account (tmr11235), no page left to move it to; +151 for the provider menu's "Only on this device" item and its four translations; +458 for Settings › About's Report a problem row and its translations; +113 for withScheme, the one rule every typed address goes through (eachg0 on X), cut to the shortest form that keeps it whole; +10 for the kept whole's tooltip (Musikrv77852 on X), the past-cycle line reused for it, no page left to move it to; +1,112 for Codex's Open button and its Open Codex with menu (Yink88564391 on X), packed to the shortest form, no page left to move them to; +168 for Discover's long lists drawn in part (the owner, 11-13), after the rest of its hook moved into plugingrid.js, imported when Plugins first draws; +296 for the cap toggle and Smart sentences that say what they do and the Sign in on another computer row (Wing8Aqua on X), packed to the shortest form, no page left to move them to; +333 for In turn's figure in a provider's editor and its words naming the message that goes round (Wing8Aqua on X), the figure itself in rotfig.js, imported when In turn is first shown, the hook packed to the shortest form; +236 for a lone capped Codex account's row saying its turns go to the fallbacks when Codex is connected (not_4O4 on X), the two helpers inlined, no page left to move it to; +717 for omp's advisor (Awad_Yoo on X, #6408): its three rows moved into ompadvisor.js, imported when an omp's settings show, and what is left is the import, the role's " · off" and the Settings line's name, packed to the shortest form; +468 for a plugin's own file import (auth.import) in the import sheet, in the plugin's words (marchen_cc on X), packed to one statement; importSay is read as the Providers rows draw, so it has no lazy page to go to, and nothing else was moved out; +180 for Claude Magpie's own Claude Code folder (xMopf7RF on X, #6459): its Advanced fold in claudemagpie.js, imported when it first shows, and what is left is the import and the fold's place in the Separate app line, 216 bytes packed to the shortest form, less the 36 of room there was; +81 for the Use Claude Magpie button on Claude Desktop's row (xMopf7RF on X), drawn by claudemagpie.js too, what is left the one line that places it (#2710); +225 for the Hermes row's Other profiles lines (Norethcy on X), which 1d60b165c took out while each profile had a row and c96f33d65 left with no place at all, packed to the shortest form; the dead hermes# Default note went with it, and the Agents rows draw it, so there is no page to move it to; +397 for a key's own price rate (tnt12231 on X): its lines, check and placeholder in keyrates.js, imported when a provider with two or more keys opens, and what is left is the import, the draft's copy, Advanced opening for it, the save's one line and proxyLines drawing another kind of line; +316 for an image or video model's chip saying what it makes from its right-click (iceloon on X): the chat chip's Makes… now shared with it, and the media chip's Copy model ID left out, packed to the shortest form; the provider's editor draws it, so there is no page to move it to; +67 for the Claude Code · Claude Magpie row saying it is on magpie through Claude Magpie (xMopf7RF on X), one line in connectLine with the shortest words that say it; the Agents rows draw it, so there is no page to move it to; +12 for AIGoCode's logo in pngIcons (MindfulReturn on X), the list every drawn icon is looked up in; +491 for each cost in the tray panel's and Requests' chart and ranking in its own provider's currency (onkashiko on X): ledProv and the provider passed through, packed to the shortest form; drawLedColumns and drawLedRank are shared by the panel, so there is no page to move it to; +326 for the Qwen AI platform's Token Plan sign-in (imthe99galaxy on X): its field, sign-in and wait in qianwenplan.js, imported when such a provider's editor opens, and what is left is the import and one quotaError line for its two refusals, packed to the shortest form; quotaError reads every card's error, so there is no page to move it to; +72 for Copy all keys (emilochen on X): its row in keyrates.js, imported when a provider with two or more keys opens through keyRateField, now told which of its parts to draw, and what is left is the one line that places it; +83 for the page saying it has gone from view, so what its Sessions and Usage pages keep goes in 30 s and not 7 minutes (P0 memory): folded into the visibilitychange listener every window has, packed to the shortest form, so there is no page to move it to; +270 for Providers' Select, to remove several at once (eiyuuzaki2333 on X): its rows, bar, removal and keys in pvpick.js, imported when Select is first clicked, and what is left is pvSel, the button's click and two lines in renderProviders, which draws the list, so there is no page to move it to; +81 for each account of a provider's Usage card in a card of its own (normalcoder_ on X): one line that makes the box, its brief look left to CSS, and renderQuotas, which draws every card, so there is no page to move it to; +17 for Kimi Code's booster balance under an allowance card's rings in the tray panel (apple_test_src on X): the card's text line and the wallet line share one filter, packed to the shortest form; panelQuotaCard draws every card, so there is no page to move it to; +51 for what a failed plugin install left in plugins/, listed under Installed with a Remove (CHENGJIAHEGOXIS on X): its section in plugininstalled.js as pmLeftovers, imported when Plugins first draws, and what is left is the one call after drawInstalled; draw is what draws the page, so there is no page to move it to; +123 for a sidebar list folded from its page's row (hkwok06 on X): the chevron, its click and the fold kept per page in navicons.js, imported with the first list, and what is left is the folded list read beside the hidden pages' (navList, which navMine now shares) and the two rows' clicks asking navFold first; navSubs draws every list, so there is no page to move it to; +338 for the Daily update channel (fishmagic80 on X): its segment, its line under Update channel and the version row's two Up to date on Daily words, packed to the shortest form (one t() per choice); Settings › About and renderUpdate draw them on every window, so there is no page to move them to; +35 for Baidu Qianfan's Token Plan sign-in (yuushabu_buyinn on X, #5860): its field in qianfanplan.js, imported when such a provider's editor opens, drawn by renderStepPlan now told whose sign-in it brings, and what is left is the import and two quotaError lines, past the room there was; quotaError reads every card's error, so there is no page to move it to; +27 for Windows' title bar (258a14 on X): the caption buttons, their clicks, the bar's double click and what keeps them over a dialog in wincap.js, imported in Windows' window alone, the header's room for them in app.css, and what is left is the one line that imports it, past the 29 of room there was; that window's frame is drawn on every start, so there is no page to move it to; +107 for the pages in the reader's own order (chet030714 on X): the order, the sidebar and tab bar put in it, and the menu's drag and keys in navorder.js and navpages.js, imported once an order is kept or Settings draws, and what is left is the one line in navHides that imports it; navHides runs on every start, so there is no page to move it to; +275 for the grants Alibaba's Token Plan asks of a RAM user's AccessKey in the reader's language (MetalHqa on X): one string (ALI_RAM) shown under the editor's AccessKey ID and on the card that names them, less the 48 of the wrong "a RAM user that may use Model Studio is enough" it replaces; the editor and quotaError draw them on every window, so there is no page to move them to; +135 for a model test its vendor queued shown queued and not green (sufeng1894 on X): queuedSaid, one string shared by the chip's title, Test models' and Test this model's status, and the chip's amber dot; renderModels draws the provider editor's chips, so there is no page to move it to ) // codeBytes is how many bytes of b are code: its blank lines, its lines diff --git a/internal/gui/tests/models-queued.test.cjs b/internal/gui/tests/models-queued.test.cjs index 878862fb1..89cb4ce51 100644 --- a/internal/gui/tests/models-queued.test.cjs +++ b/internal/gui/tests/models-queued.test.cjs @@ -1,7 +1,9 @@ // Run with Node's test runner and Playwright on the module path; see README.md. // A plugin's model its vendor has queued (Qoder's "queued the request for -// ...", Mr7Faith on X) answers its test OK: a green dot whose title says the -// queue, and Working only keeps it picked. +// ...", Mr7Faith on X) is no failed test: Working only keeps it picked. But +// it didn't answer either, and routing gives way at once or ends with the +// queue's 503, so its dot is the queued one, not green, and the status +// says the queue, not "answered" (@sufeng1894 on X). const assert = require("node:assert/strict"); const fs = require("node:fs/promises"); const path = require("node:path"); @@ -24,7 +26,7 @@ const answers = { "qwen4-max": { ok: true, ms: 380, protocol: "openai" }, "deepseek-v4": { ok: false, status: 503, error: "no available channel", protocol: "openai" }, }; -const KEPT = ["glm-5", "minimax-m3", "qwen4-max"]; +const KEPT = ["glm-5", "qwen4-max"]; function serve(lang, posts) { const providers = { providers: [relay], presets: [], excluded: [], gateway: { running: true, window: true } }; @@ -52,7 +54,31 @@ function serve(lang, posts) { for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) { - test(`${engine}: a queued model's test is green and says the queue`, async (t) => { + test(`${engine}: a queued model's test says the queue, not green`, async (t) => { + const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" })); + t.after(() => browser.close()); + const page = await (await browser.newContext({ viewport: { width: 900, height: 700 }, reducedMotion: "reduce" })).newPage(); + page.setDefaultTimeout(5000); + page.setDefaultNavigationTimeout(60000); + const posts = []; + await page.route("**/*", serve("en", posts)); + await page.goto("http://magpie.test/?view=providers"); + const editor = page.locator("#modal:not([hidden]) .editor"); + await page.locator(".row.provider", { hasText: "Mixed Relay" }).click(); + await editor.locator(".mchips .mchip").first().waitFor(); + await editor.getByRole("button", { name: "Test models", exact: true }).click(); + await editor.locator(".mchips .tdot.ok").first().waitFor(); + const chip = editor.locator(".mchips .mchip", { hasText: "glm-5" }); + assert.equal(await chip.locator(".tdot.ok").count(), 0, "a queued model's dot isn't green"); + assert.equal(await chip.locator(".tdot.queued").count(), 1); + assert.match(await chip.getAttribute("title"), /^Queued at its vendor, not answered: Qoder queued the request for glm-5/); + // Working only unpicks the two that failed and keeps the queued one + await editor.locator(".works-only").click(); + for (const id of KEPT) assert.equal(await editor.locator(".mchips .mchip.on", { hasText: id }).count(), 1, id + " stays picked"); + assert.equal(await editor.locator(".mchips .mchip.on", { hasText: "kimi-k3" }).count(), 0, "a failed one is unpicked"); + }); + + test(`${engine}: a queued model's single test isn't "answered"`, async (t) => { const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" })); t.after(() => browser.close()); const page = await (await browser.newContext({ viewport: { width: 900, height: 700 }, reducedMotion: "reduce" })).newPage(); @@ -62,11 +88,13 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", await page.goto("http://magpie.test/?view=providers"); const editor = page.locator("#modal:not([hidden]) .editor"); await page.locator(".row.provider", { hasText: "Mixed Relay" }).click(); - await editor.locator(".mchips .mchip").first().waitFor(); - await editor.getByRole("button", { name: "Test models", exact: true }).click(); - await editor.locator(".mchips .tdot.ok").first().waitFor(); const chip = editor.locator(".mchips .mchip", { hasText: "glm-5" }); - assert.equal(await chip.locator(".tdot.ok").count(), 1); - assert.match(await chip.getAttribute("title"), /queued the request for glm-5/); + await chip.waitFor(); + await chip.click({ button: "right" }); + await page.getByRole("menuitem", { name: "Test this model" }).click(); + await chip.locator(".tdot.queued").waitFor(); + const said = await page.locator("#status").textContent(); + assert.match(said, /^glm-5: Queued at its vendor, not answered: Qoder queued/); + assert.doesNotMatch(said, /answered in/); }); }