gui: an agent's own models' section says it is the agent's own sign-in (maxleebeta)
An agent's model picker (Pi and every agent with own-provider groups)
lists the providers the agent is signed in to itself below magpie's
models. Their section header was only the vendor's name, e.g. "OPENCODE
GO", the same as the user's magpie provider of that name, so maxleebeta
read Pi's own OpenCode Go list as magpie ignoring the one model picked
for magpie's OpenCode Go.
A section of direct options (Option.Direct) not already named for the
agent now reads "OpenCode Go · Pi's own sign-in" ("OpenCode Go · Pi 自己的
登录"), in sentence case, faint like the header, no accent. Its key is
distinct, so magpie's and the agent's own groups of one vendor are two
headers. Claude Code's "Claude Code" groups (named for the agent)
are unchanged. New string in zh, zh-TW, ja, de.
Run (mote, playwright chromium + webkit):
- agent-own-direct.test.cjs, extended: headings are exactly
["OpenCode Go", "OpenCode Go · <own sign-in>"], the own one between
magpie's and Pi's models, no text-transform, same height as magpie's
header, no left border or background image; 20/20 (both engines x
en/zh/zh-TW/ja/de x 980/420). i18n-keys, claude-picker-fold,
claude-picker-magpie-first, rail-tip green.
- Broken by hand (chromium en 980): suffix never added -> red; header
key not distinct -> red (headings ["DeepSeek","OpenCode Go"]).
- Whole GUI suite on WSL magpie-desktop (mote was at load ~600):
19,997 tests, 538 fail across 125 files. Those 125 files rerun at
main f177c36a9 and at this head: 490 vs 481 fail, the same files; the
names differing either way are scattered timing tests (Routing rules,
thumbs, scroll) on a loaded Linux box, none in the picker. The
picker files that fail (zero-priced-free etc.) fail alike on main.
- go test ./internal/gui: TestCoreScriptBudget red on main too (#5139):
main 1,533,907, this head 1,533,906 (one byte less; comments trimmed,
no raise). TestMainWindowCorners/macOS_26_SDK red on main (#3949).
Not tried: the real app or a real Pi sign-in; Linux WebKitGTK and the
Windows webview.
This commit is contained in:
@@ -2368,6 +2368,9 @@ body .foot .status.lift { white-space: normal; overflow-wrap: anywhere; text-ove
|
||||
.pop li.cur .check { display: inline-flex; }
|
||||
.pop li.group { height: 22px; padding: 6px 8px 0; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); pointer-events: none; }
|
||||
.pop li.group:not(:first-child) { margin-top: 2px; }
|
||||
/* the agent's own sign-in, after a group of its own models' name: quiet, in the sentence's own case */
|
||||
.pop li.group.own { gap: 4px; white-space: nowrap; }
|
||||
.pop li.group .own-sign { min-width: 0; overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; font-weight: 500; }
|
||||
.pop li.reset { margin-bottom: 3px; }
|
||||
.pop li.reset .v { color: var(--fg); }
|
||||
.pop li.reset .ic { opacity: .75; }
|
||||
|
||||
+19
-15
@@ -5276,19 +5276,11 @@ function loadTag(n) {
|
||||
return g;
|
||||
}
|
||||
|
||||
// modelTells: what tells apart the models of one list that would show the
|
||||
// same label (sunset on Discord). items are the list's entries, label(x)
|
||||
// what each shows, id(x) its id, and key(x) the part of the list it is
|
||||
// shown in (a picker's provider): labels are compared within a key.
|
||||
// Returns a Map of id → tell for the entries whose label another of the
|
||||
// same key shares; one whose label is its own gets none.
|
||||
//
|
||||
// A tell is the part of its id the others' don't share: the path segments
|
||||
// every id of the label begins with and ends with are dropped, so buddy/x
|
||||
// and cline/x say "buddy" and "cline", p/buddy/x and p/cline/x the same,
|
||||
// and buddy/x-fast and buddy/x-slow "x-fast" and "x-slow". An id left with
|
||||
// nothing (x beside buddy/x) says itself whole; and where tells would
|
||||
// still read alike, each says its whole id.
|
||||
// modelTells: id → tell for the entries whose label (label(x)) another of
|
||||
// the same key(x) shares (sunset on Discord). A tell is the id less the
|
||||
// path segments every id of the label starts and ends with (buddy/x,
|
||||
// cline/x → buddy, cline); an id left with nothing, or tells alike, say
|
||||
// the whole id.
|
||||
function modelTells(items, label = (x) => x.name || x.id, id = (x) => x.id, key = () => "") {
|
||||
const by = new Map();
|
||||
for (const x of items || []) {
|
||||
@@ -5400,6 +5392,17 @@ function loadOf(ref) {
|
||||
return modelLoads[k] ?? (at > k.indexOf("/") + 1 ? modelLoads[k.slice(0, at)] : null);
|
||||
}
|
||||
|
||||
// groupHead: a picker section's header; the agent's own models' says whose
|
||||
// sign-in, not magpie's provider of that name (maxleebeta)
|
||||
function groupHead(o) {
|
||||
const li = el("li", "group", o.group === ROUTING_GROUPS ? t(o.group) : o.group);
|
||||
const a = pick.agent?.name;
|
||||
if (!o.direct || !a || o.group === a || o.group.startsWith(a + " ")) return { key: o.group, li };
|
||||
li.classList.add("own");
|
||||
li.append(el("span", "own-sign", " · " + t("{agent}'s own sign-in", { agent: a })));
|
||||
return { key: o.group + "\0own", li };
|
||||
}
|
||||
|
||||
function renderList() {
|
||||
const list = $("#list");
|
||||
list.replaceChildren();
|
||||
@@ -5408,8 +5411,9 @@ function renderList() {
|
||||
const q = $("#q").value.trim();
|
||||
let group = null;
|
||||
pick.items.forEach((o, idx) => {
|
||||
if (!q && o.group && o.group !== group) list.append(el("li", "group", o.group === ROUTING_GROUPS ? t(o.group) : o.group));
|
||||
if (!q) group = o.group ?? group;
|
||||
const head = o.group && groupHead(o);
|
||||
if (!q && head && head.key !== group) list.append(head.li);
|
||||
if (!q) group = head ? head.key : o.group ?? group;
|
||||
if (o.fold) { list.append(foldRow(o, idx, hasIcons)); return; }
|
||||
const li = el("li", (idx === pick.cursor ? "sel" : "") + (o.value === pick.field.value || pick.field.picked?.(o.value) ? " cur" : "") + (o.custom ? " custom" : "") + (o.reset ? " reset" : ""));
|
||||
li.dataset.i = idx;
|
||||
|
||||
@@ -2219,6 +2219,7 @@ const I18N = {
|
||||
"turned off in Alma": "在 Alma 里是关闭的",
|
||||
"it is the agent's own sign-in; add the subscription in magpie": "这是 agent 自己的登录,请在 magpie 里添加订阅",
|
||||
"it is the agent's own sign-in": "这是 agent 自己的登录",
|
||||
"{agent}'s own sign-in": "{agent} 自己的登录",
|
||||
"it is a sign-in, not a key; add the subscription in magpie": "这是登录账号而不是密钥,请在 magpie 里添加订阅",
|
||||
"it has no Azure OpenAI endpoint": "没有 Azure OpenAI 接口地址",
|
||||
"it points at magpie itself": "它指向的就是 magpie 自己",
|
||||
@@ -6808,6 +6809,7 @@ const I18N = {
|
||||
"turned off in Alma": "在 Alma 裡是關閉的",
|
||||
"it is the agent's own sign-in; add the subscription in magpie": "這是 agent 自己的登入,請在 magpie 裡新增訂閱",
|
||||
"it is the agent's own sign-in": "這是 agent 自己的登入",
|
||||
"{agent}'s own sign-in": "{agent} 自己的登入",
|
||||
"it is a sign-in, not a key; add the subscription in magpie": "這是登入帳號而不是金鑰,請在 magpie 裡新增訂閱",
|
||||
"it has no Azure OpenAI endpoint": "沒有 Azure OpenAI 端點",
|
||||
"it points at magpie itself": "它指向的就是 magpie 自己",
|
||||
@@ -11373,6 +11375,7 @@ const I18N = {
|
||||
"turned off in Alma": "Alma でオフになっています",
|
||||
"it is the agent's own sign-in; add the subscription in magpie": "エージェント自身のサインインです。magpie でサブスクリプションを追加してください",
|
||||
"it is the agent's own sign-in": "エージェント自身のサインインです",
|
||||
"{agent}'s own sign-in": "{agent} 自身のサインイン",
|
||||
"it is a sign-in, not a key; add the subscription in magpie": "キーではなくサインインです。magpie でサブスクリプションを追加してください",
|
||||
"it has no Azure OpenAI endpoint": "Azure OpenAI のエンドポイントがありません",
|
||||
"it points at magpie itself": "magpie 自身を指しています",
|
||||
@@ -15969,6 +15972,7 @@ const I18N = {
|
||||
"turned off in Alma": "in Alma ausgeschaltet",
|
||||
"it is the agent's own sign-in; add the subscription in magpie": "es ist die eigene Anmeldung des Agenten; fügen Sie das Abo in magpie hinzu",
|
||||
"it is the agent's own sign-in": "es ist die eigene Anmeldung des Agenten",
|
||||
"{agent}'s own sign-in": "eigene Anmeldung von {agent}",
|
||||
"it is a sign-in, not a key; add the subscription in magpie": "es ist eine Anmeldung, kein Schlüssel; fügen Sie das Abo in magpie hinzu",
|
||||
"it has no Azure OpenAI endpoint": "es hat keinen Azure-OpenAI-Endpunkt",
|
||||
"it points at magpie itself": "es zeigt auf magpie selbst",
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
// pick is asked first, Cancel leaving Pi connected, as Claude Code's own
|
||||
// models are (#726). The options are what /api/state sends since the fix:
|
||||
// an own model carries direct. Every language, wide and narrow.
|
||||
// Its section's heading was OPENCODE GO alone, the name of the user's own
|
||||
// OpenCode Go provider in magpie, read as magpie's section that ignored
|
||||
// the one model picked there (maxleebeta); it now says it is Pi's own
|
||||
// sign-in, below magpie's OpenCode Go.
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs/promises");
|
||||
const path = require("node:path");
|
||||
@@ -21,6 +25,7 @@ const options = [
|
||||
{ value: "opencode-go/kimi-k2.6", note: "Kimi K2.6", group: "OpenCode Go", direct: "OpenCode Go" },
|
||||
{ value: DS, label: "DeepSeek V4.1 Flash", ref: "deepseek/deepseek-v4.1-flash", group: "DeepSeek", note: "DeepSeek · via magpie" },
|
||||
{ value: "magpie/deepseek/deepseek-v4.1-pro", label: "DeepSeek V4.1 Pro", ref: "deepseek/deepseek-v4.1-pro", group: "DeepSeek", note: "DeepSeek · via magpie" },
|
||||
{ value: "magpie/opencode-go/minimax-m2.7", label: "MiniMax M2.7", ref: "minimax/minimax-m2.7", group: "OpenCode Go", note: "OpenCode Go · via magpie" },
|
||||
];
|
||||
|
||||
function server(lang, posts) {
|
||||
@@ -55,7 +60,7 @@ function server(lang, posts) {
|
||||
}
|
||||
|
||||
const row = '.row.agent[data-id="pi"]';
|
||||
const KEYS = ["direct, not via magpie", "via magpie", "Take {agent} off magpie?", "Cancel", "Use {model}",
|
||||
const KEYS = ["{agent}'s own sign-in", "direct, not via magpie", "via magpie", "Take {agent} off magpie?", "Cancel", "Use {model}",
|
||||
"{model} is {agent}'s own model: {agent} asks {vendor} for it itself, with its own sign-in, not through magpie. Picking it takes {agent} off magpie, and it starts on {model}."];
|
||||
|
||||
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
|
||||
@@ -92,6 +97,25 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
const at = (s) => order.findIndex((x) => x.includes(s));
|
||||
assert.ok(at("DeepSeek V4.1 Pro") >= 0 && at("DeepSeek V4.1 Pro") < at("GLM-5.1"), `magpie's first: ${JSON.stringify(order)}`);
|
||||
|
||||
// magpie's OpenCode Go section is OpenCode Go; Pi's own says whose
|
||||
// sign-in it is, in the page's language, quiet and on one line
|
||||
const heads = (await page.locator("#pop #list li.group").allTextContents()).map((s) => s.trim());
|
||||
const own = "OpenCode Go · " + await tr("{agent}'s own sign-in", { agent: "Pi" });
|
||||
assert.deepEqual(heads.filter((h) => h.startsWith("OpenCode Go")), ["OpenCode Go", own], JSON.stringify(heads));
|
||||
const ownHead = order.findIndex((x) => x.trim() === own);
|
||||
assert.ok(at("MiniMax M2.7") < ownHead && ownHead < at("GLM-5.1"), `Pi's own heading over its own models: ${JSON.stringify(order)}`);
|
||||
const head = page.locator("#pop #list li.group.own");
|
||||
const look = await head.evaluate((li) => {
|
||||
const s = li.querySelector(".own-sign"), cs = getComputedStyle(s), r = li.getBoundingClientRect(), list = li.closest("#pop").getBoundingClientRect();
|
||||
return { transform: cs.textTransform, height: r.height, inside: r.right <= list.right + 0.5, border: getComputedStyle(li).borderLeftWidth, image: getComputedStyle(li).backgroundImage };
|
||||
});
|
||||
assert.equal(look.transform, "none", "the words read as written");
|
||||
const plain = await page.locator("#pop #list li.group:not(.own)", { hasText: "OpenCode Go" }).evaluate((li) => li.getBoundingClientRect().height);
|
||||
assert.equal(look.height, plain, "one line, as tall as magpie's OpenCode Go heading");
|
||||
assert.ok(look.inside, `inside the picker at ${width}px`);
|
||||
assert.equal(look.border, "0px", "no stripe");
|
||||
assert.equal(look.image, "none", "no gradient");
|
||||
|
||||
// the OpenCode Go model is asked first; Cancel leaves Pi connected
|
||||
await item("GLM-5.1").click();
|
||||
const ask = page.locator("#modal .leave-ask");
|
||||
|
||||
Reference in New Issue
Block a user