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: <queue>", 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/main8608ce024): - 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/main8608ce024(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 onto07f7e0b45(nothing under internal/gui changed since8608ce024): 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.
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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; } }
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
@@ -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",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -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/);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user