Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

Web page: a request that timed out in the queue shows a Timeout badge in Recent requests (PR #3991 by thisisspartan)

thisisspartancd72accac335
diff --git a/serve/test_web_badges.py b/serve/test_web_badges.py
new file mode 100644
index 000000000..fcfb8860d
--- /dev/null
+++ b/serve/test_web_badges.py
@@ -0,0 +1,32 @@
+"""serve/test_web_badges.py - the Recent requests table has a badge for every way a request can end (#3991).
+
+A request that waits past the queue limit ends with finish "timeout"; the Status cell showed the raw word. Reads the page source.
+"""
+from __future__ import annotations
+
+import re
+import unittest
+from pathlib import Path
+
+APP = Path(__file__).resolve().parent / "web" / "app.js"
+SERVER = Path(__file__).resolve().parent / "server.py"
+
+
+class FinishBadges(unittest.TestCase):
+ def test_a_timed_out_request_has_a_badge(self):
+ src = APP.read_text(encoding="utf-8")
+ table = src[src.index("const badge = {stop:"):]
+ table = table[:table.index("};")]
+ self.assertRegex(table, r'timeout: \["st-badge--queued", "Timeout"\]')
+
+ def test_every_finish_the_server_stores_has_a_badge(self):
+ src = APP.read_text(encoding="utf-8")
+ table = src[src.index("const badge = {stop:"):]
+ table = table[:table.index("};")]
+ for finish in ("stop", "length", "cancel", "disconnect", "error", "timeout"):
+ self.assertRegex(table, rf"\b{finish}:", finish)
+ self.assertIn('"timeout"', SERVER.read_text(encoding="utf-8"))
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/serve/web/app.js b/serve/web/app.js
index 5dedc3531..856df8ca8 100644
--- a/serve/web/app.js
+++ b/serve/web/app.js
@@ -344,7 +344,8 @@ function renderMonitor(live, hw, st, eng, h, last, requests, totals, kept) {
body.innerHTML = `<tr><td colspan="9" class="muted">No requests yet</td></tr>`;
} else {
const badge = {stop: ["", "Done"], length: ["", "Max tokens"], cancel: ["st-badge--queued", "Stopped"],
- disconnect: ["st-badge--queued", "Closed"], error: ["st-badge--error", "Error"]};
+ disconnect: ["st-badge--queued", "Closed"], error: ["st-badge--error", "Error"],
+ timeout: ["st-badge--queued", "Timeout"]};
body.innerHTML = requests.slice(0, reqShowAll ? requests.length : 12).map((r) => {
const [cls, text] = badge[r.finish] || ["", r.finish || "–"];
const t = new Date(r.time * 1000).toLocaleTimeString([], {hour: "2-digit", minute: "2-digit", second: "2-digit"});