diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index 984092ba0..672df48e9 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -428,6 +428,7 @@ function renderAgentsLoading() { page.setAttribute("aria-busy", "true"); const list = $("#agents"); list.replaceChildren(); + homeAgentPrefRows(); for (let i = 0; i < 5; i++) { const row = el("div", "row agent ag-sk-row"); const who = el("div", "who"); @@ -454,6 +455,7 @@ function renderAgents() { page.removeAttribute("aria-busy"); const list = $("#agents"); list.replaceChildren(); + homeAgentPrefRows(); // an opened row's, back in the page (ysm119) agentsLead(list); if (!state.agents.length) { const e = el("div", "empty-state"); @@ -19713,19 +19715,10 @@ function renderSettings() { (v) => savePrefs({ ...keep, noWSLAgents: v === "off" }))); renderSessionTerminal(s, keep); renderBarIcon(); - // what each row does, kept in its tooltip, the row saying its name - // alone as Settings › General does (#2120); Open at login's says where - // the Mac lists it: a launch agent, under App Background Activity - for (const [row, en] of [ - ["#codexTitlesRow", "Names each thread in a hidden request of its own; same as the session, it goes on the session’s model, as Codex sends it when that is one of Codex’s own"], - ["#codexDescriptionsRow", "Writes each thread’s short description in a hidden request of its own; same as the session, it goes on the session’s model, as Codex sends it when that is one of Codex’s own"], - ["#codexPredictionsRow", "Guesses your next message for the composer, reading the whole conversation again each time; same as the session, it goes on the session’s model"], - ["#codexAutoReviewRow", "Decides an approval in your place when Codex’s approvals are on auto-review; Codex’s own pick is codex-auto-review, else the conversation’s model at low effort; on a ChatGPT Free plan, where codex-auto-review isn’t free, unset follows the session"], - ["#codexMemoriesRow", "Writes Codex’s memories of past threads, in the background; same as the session, on the session’s model, or on gpt-5.6-terra and gpt-5.6-luna when that is one of Codex’s own"], - ["#loginRow", document.body.classList.contains("mac") - ? "Opens in the menu bar with no window. System Settings › General › Login Items lists it under App Background Activity, not Open at Login" - : "Opens in the tray with no window"], - ]) $(row + " .who").title = t(en); + // what it does in its tooltip (#2120), and where the Mac lists it + $("#loginRow .who").title = t(document.body.classList.contains("mac") + ? "Opens in the menu bar with no window. System Settings › General › Login Items lists it under App Background Activity, not Open at Login" + : "Opens in the tray with no window"); // the system's record, set on its own, not with the other choices $("#loginSegs").replaceChildren(segs([["off", t("Off")], ["on", t("On")]], s.login ? "on" : "off", (v) => prefWrite(api("settings/login", { on: v === "on" })))); @@ -21163,6 +21156,14 @@ function renderAgentPrefs() { const s = prefs; if (!s) return; homeAgentPrefRows(); + // what each row does, in its tooltip (#2120) + for (const [row, en] of [ + ["#codexTitlesRow", "Names each thread in a hidden request of its own; same as the session, it goes on the session’s model, as Codex sends it when that is one of Codex’s own"], + ["#codexDescriptionsRow", "Writes each thread’s short description in a hidden request of its own; same as the session, it goes on the session’s model, as Codex sends it when that is one of Codex’s own"], + ["#codexPredictionsRow", "Guesses your next message for the composer, reading the whole conversation again each time; same as the session, it goes on the session’s model"], + ["#codexAutoReviewRow", "Decides an approval in your place when Codex’s approvals are on auto-review; Codex’s own pick is codex-auto-review, else the conversation’s model at low effort; on a ChatGPT Free plan, where codex-auto-review isn’t free, unset follows the session"], + ["#codexMemoriesRow", "Writes Codex’s memories of past threads, in the background; same as the session, on the session’s model, or on gpt-5.6-terra and gpt-5.6-luna when that is one of Codex’s own"], + ]) $(row + " .who").title = t(en); // Codex's own models in multi-agent V1 (their subagents' tasks go as text), // so a GPT lead can run a subagent on magpie's other models (#141). Where // Codex's own multi_agent_v2 is on in the config magpie routes it wins, and diff --git a/internal/gui/tests/agent-prefs.test.cjs b/internal/gui/tests/agent-prefs.test.cjs index 80977b0d7..4fcf90a3c 100644 --- a/internal/gui/tests/agent-prefs.test.cjs +++ b/internal/gui/tests/agent-prefs.test.cjs @@ -138,6 +138,34 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", }); } + // ysm119 on Discord (v0.1.2519, WebKit): Codex's row opened and shut + // again, then Settings, threw "null is not an object (evaluating + // '$(row + ".who").title = t(en)')". Shut, the row was drawn again + // without its opened part, and Codex's settings rows went with that + // part, out of the page, where Settings and a language change look + // for them. Shut, they are back in it; Settings opens on its own + // button, with no reload, and says what each row does. + for (const width of [1100, 440]) { + test(`${engine} ${lang} ${width}: Settings opens after Codex's row was opened and shut`, async (t) => { + const { page, errors } = await newPage(engine, t, width, lang); + await page.goto("http://magpie.test/?view=agents"); + await openAgentSettings(page, "codex"); + await page.locator('.row.agent[data-id="codex"] .ag-link').click(); + await page.locator('.row.agent[data-id="codex"] .ag-prefs').waitFor({ state: "detached" }); + await page.locator('.row.agent[data-id="codex"] .ag-link[aria-expanded="false"]').waitFor(); + for (const id of CODEX) assert(await page.evaluate((id) => document.getElementById(id)?.isConnected === true, id), `${lang} ${width}: ${id} in the page once shut`); + await page.locator("#prefs").click(); + await page.locator("#view-settings").waitFor(); + await page.waitForFunction(() => __settingsReads.asked > 0 && __settingsReads.asked === __settingsReads.drawn); + assert.deepEqual(errors, [], `${lang} ${width}: no error opening Settings`); + assert.equal(await page.locator("#status.err").textContent().catch(() => ""), "", `${lang} ${width}: no red error line`); + const tip = await page.evaluate(() => document.querySelector("#codexTitlesRow .who")?.title); + assert.equal(tip, await page.evaluate(() => t("Names each thread in a hidden request of its own; same as the session, it goes on the session’s model, as Codex sends it when that is one of Codex’s own")), `${lang}: the titles row says what it does`); + if (lang !== "en") assert(!/^Names each/.test(tip), `${lang}: in the language`); + await noSideScroll(page, `${lang} ${width} Settings`); + }); + } + test(`${engine} ${lang}: in the panel a Settings line and the agent's menu open its sheet`, async (t) => { const { page, errors } = await newPage(engine, t, 360, lang); const w = want[lang];