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++

server: death_note scans the last 256 KB for the watchdog line, so a long verify trace cannot hide it (#1705)

Niko122152f548f45afa
diff --git a/serve/server.py b/serve/server.py
index c21f335af..0f034bc2a 100644
--- a/serve/server.py
+++ b/serve/server.py
@@ -797,15 +797,17 @@ class StrataEngine:
"""Why the engine most likely ended, from the end of its log: its own watchdog (issue #29), else RAM."""
if getattr(self, "silent_note", None): # #481: the server ended it, not the OS or the engine itself
return self.silent_note
- tail = ""
+ tail = wide = ""
try:
with open(self.log_path, "rb") as f:
f.seek(0, 2)
- f.seek(max(0, f.tell() - 4096))
- tail = f.read().decode("utf-8", "replace")
+ f.seek(max(0, f.tell() - 262144))
+ wide = f.read().decode("utf-8", "replace")
+ tail = wide[-4096:]
except (OSError, TypeError):
pass
- for line in reversed(tail.splitlines()):
+ # #1705: STRATA_VERIFY_TRACE dumps are ~30 KB and push the watchdog's line out of a 4 KB tail
+ for line in reversed(wide.splitlines()):
if "issue #29" in line:
return ("The engine stopped itself because it had stopped making progress - a hang it caught. Its log "
"line: " + line.strip() + " - please report it at github.com/Niko1221/Strata/issues.")
diff --git a/serve/test_server.py b/serve/test_server.py
index ccd8408c7..2fd3a4b1c 100644
--- a/serve/test_server.py
+++ b/serve/test_server.py
@@ -4072,6 +4072,18 @@ class SilentEngine(unittest.TestCase):
self.assertIn("#481", engine.death_note())
self.assertNotIn("STOP", engine.proc.stdin.getvalue()) # nothing is listening: no STOP, no drain
+ def test_death_note_finds_the_watchdog_line_under_a_long_trace(self):
+ # #1705: STRATA_VERIFY_TRACE dumps (~30 KB) after the watchdog's line must not hide it
+ import tempfile
+ engine = self.bare(0.3)
+ with tempfile.TemporaryDirectory() as d:
+ engine.log_path = os.path.join(d, "e.log")
+ with open(engine.log_path, "w", encoding="utf-8") as f:
+ f.write("strata serve: no progress for 60 s during a request (issue #29)\n")
+ f.write("strata verify trace: dump\n" * 1500)
+ engine.proc.poll.return_value = -6
+ self.assertIn("a hang it caught", engine.death_note())
+
def test_prompt_chunks_set_the_wait(self):
# a PP line every second, at 100 tok/s: far over a 0.3 s silence, but each chunk is on time for its size
engine = self.bare(0.3)