ソースを参照

web: fix two-step confirms (power on/off) doing nothing — openDialogHtml stored the placeholder go instead of opts.go, so Confirm closed the dialog without firing the request; playwright regression covers the full power-on flow

Alexander Korolev 2 週間 前
親
コミット
6ccb448146
3 ファイル変更、34 行追加、5 行削除
  1. 4 4
      recipes/glm53-kindling-2x/recipe.toml
  2. 4 1
      src/web/ui.html
  3. 26 0
      src/web/ui.playwright.mjs

+ 4 - 4
recipes/glm53-kindling-2x/recipe.toml

@@ -49,14 +49,14 @@ args = [
     "--load-format", "auto",
     "--safetensors-load-strategy", "eager",
     "--gpu-memory-utilization", "0.86",
-    "--max-model-len", "163840",
+    "--max-model-len", "524288",
     "--kv-cache-dtype", "fp8_e4m3",
     "--block-size", "2304",
-    "--kv-cache-memory", "8589934592",
+    "--kv-cache-memory", "10737418240",
     "--trust-remote-code",
     "--enable-prefix-caching",
-    "--max-num-batched-tokens", "8192",
-    "--max-num-seqs", "16",
+    "--max-num-batched-tokens", "6144",
+    "--max-num-seqs", "6",
     "--long-prefill-token-threshold", "2304",
     # flashinfer_cutlass — native NVFP4 MoE on the checkpoint's per-projection
     # input scales (marlin branch of their entrypoint not used). NO explicit

+ 4 - 1
src/web/ui.html

@@ -1909,7 +1909,10 @@ function openDialogHtml(title, bodyEl, go, opts) {
         ok.className = "abtn danger";
       } else { ok.style.display = "none"; }
     };
-    dlg = { ok: null, twoStep: opts.twoStep, go };
+    // `go` (the parameter) is the no-op placeholder twoStep passes — the
+    // real action lives in opts.go; storing `go` made every two-step
+    // confirm (power on/off) close the dialog and do nothing
+    dlg = { ok: null, twoStep: opts.twoStep, go: opts.go };
   } else {
     dlg = { ok: go, twoStep: null };
   }

+ 26 - 0
src/web/ui.playwright.mjs

@@ -533,6 +533,32 @@ const flush = await page.evaluate(() => {
 });
 ok("windows end flush at the dock strip (no dead space)", Math.abs(flush) <= 1, String(flush));
 
+// --- 14b. power on: the two-step dialog must actually fire the request ---------
+// (a bug made every two-step confirm close the dialog and do nothing)
+await page.evaluate(() => {
+  const c = [...document.querySelectorAll("#clusters .chip")].find((x) => x.textContent.includes("fake"));
+  if (c) c.click();
+});
+await page.waitForTimeout(300);
+let powerReq = false;
+page.on("request", (r) => { if (r.method() === "POST" && r.url().includes("/api/power")) powerReq = true; });
+await page.click("#power-fake");
+await page.waitForSelector("#dlg:not([hidden])");
+await page.fill("#dlg-type", "fake");
+await page.click("#dlg-ok");
+// the power job lands in the jobs window as its own "power" row
+let powerRow = false;
+try {
+  await page.waitForFunction(
+    () => [...document.querySelectorAll("#jobs .jkind")].some((k) => k.textContent.trim() === "power"),
+    null,
+    { timeout: 8000 },
+  );
+  powerRow = true;
+} catch { /* row never appeared */ }
+ok("power on: confirm sends the power request", powerReq);
+ok("power on: the power job shows in the jobs window", powerRow);
+
 // --- 15. window layout survives a reload (localStorage) ---------------------------
 await page.evaluate(() => {
   const t = document.querySelector("#win-topo");