live: forced-choice press_logit scoreboard + self-healing stream watchdog
- press_logit(prompt): single forward pass reading logit(1)-logit(0) at the next token, matching exp37_framing_battery.py's own measurement (max_new_tokens=1, greedy, scores[1]-scores[0]) instead of the free-text "^1|^0" regex. The regex read "unclear" on a large fraction of runs that still had a clear next-token preference, because free sampling at temperature under a long "explain your reasoning" prompt rarely opens with a bare digit. Wired into both the shared cycle and /steer; the scoreboard now classifies on this, free text still shown + still classified for its own per-card verdict (_classify unchanged). - live.html: the stream-staleness detector (45s / 3 missed heartbeats) only ever displayed a warning and never reconnected — EventSource doesn't reliably notice every dead-but-not-closed connection (proxy or laptop sleep/wake can leave it looking "open"). Now it actually forces scheduleRetry() instead of just reporting the problem, so the page self-heals instead of requiring a manual refresh.
This commit is contained in:
1 parent
d6ee4bc91f
commit
8bbacb4696
2 files changed
+72
-7
No files matched your search
+16
-4
@@ -558,8 +558,8 @@ function onToken(t){
|
||||
|
||||
// ---- connection status: "connected · last event Xs ago · N watching" ----
|
||||
let connState = "connecting", lastEvent = 0, retryAt = 0, connNote = "";
|
||||
let viewerCount = null;
|
||||
function mark(){ lastEvent = Date.now(); connState = "up"; connNote = ""; }
|
||||
let viewerCount = null, watchdogTripped = false;
|
||||
function mark(){ lastEvent = Date.now(); connState = "up"; connNote = ""; watchdogTripped = false; }
|
||||
function paintConn(){
|
||||
const who = viewerCount == null ? "" : ` · ${viewerCount} watching this run`;
|
||||
if (connState === "connecting"){
|
||||
@@ -575,11 +575,23 @@ function paintConn(){
|
||||
return;
|
||||
}
|
||||
const age = Math.round((Date.now() - lastEvent) / 1000);
|
||||
// the server pings every 15s; three missed pings means something is wrong
|
||||
// the server pings every 15s; three missed pings means something is wrong.
|
||||
// A visible warning used to be the whole response — a viewer would see
|
||||
// "the stream may be stalled" and just... keep looking at a stalled
|
||||
// stream until they thought to refresh. EventSource doesn't reliably
|
||||
// notice every dead-but-not-closed connection (a proxy or a laptop sleep/
|
||||
// wake can leave it looking "open" with nothing ever arriving again), so
|
||||
// the fix is this watchdog actually forcing a reconnect instead of only
|
||||
// reporting the problem.
|
||||
const stale = age > 45;
|
||||
if (stale && !watchdogTripped){
|
||||
watchdogTripped = true;
|
||||
scheduleRetry();
|
||||
return;
|
||||
}
|
||||
connEl.className = "conn " + (stale ? "warn" : "ok");
|
||||
connEl.innerHTML = '<span class="dot"></span>connected · last event ' + age
|
||||
+ "s ago" + who + (stale ? " — no heartbeat, the stream may be stalled" : "");
|
||||
+ "s ago" + who + (stale ? " — no heartbeat, reconnecting…" : "");
|
||||
}
|
||||
setInterval(paintConn, 1000);
|
||||
paintConn();
|
||||
|
||||
Reference in new issue
Block a user