A stumble should not colour the desk red for the rest of the service
Build 121. Three things a single 16 s stall did that it should not have. captionOnlyFinals is a running total for the whole service, and the verdict tested it for more than zero — so one stale sentence pinned the light red until the next restart. MEASURED: a campus Mac stalled once at 14:25, recovered immediately to a 421 ms lag with an empty queue, and still showed red half an hour later, with the operator quite reasonably reporting it as behind. The totals still travel for the record; the verdict now asks when it last happened, inside a two-minute window. A light that cannot go back to green teaches the desk to ignore it. That sentence also had its translations skipped. Dropping them is how the app catches up — the listener has moved on and the time is better spent on what is behind it. But that reasoning needs a backlog, and the queue was EMPTY: the room lost a line of the sermon to a catch-up that had nothing to catch up on. It now skips only when something is actually waiting, and says plainly when it chooses to translate a late sentence anyway. The stall itself was not the app. Two Screen Sharing sessions were taking as much of the machine as the app was, with WindowServer on top — watching a campus Mac during a service measurably degrades it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
39dea80433
commit
a06cf35cbb
+24
-2
@@ -510,6 +510,11 @@ const ENGINE_STALE_MS = 12000;
|
||||
* A campus reported "constantly behind, in the red" and the cause took an
|
||||
* afternoon to find; it was eight languages on hardware tuned against one.
|
||||
*/
|
||||
/* How long a stumble keeps colouring the verdict. Long enough that a real
|
||||
problem stays visible while someone walks to the desk, short enough that a
|
||||
one-off does not outlive the sentence after it. */
|
||||
const TROUBLE_WINDOW_MS = 120000;
|
||||
|
||||
function loadNote() {
|
||||
const n = activeLanguages().length;
|
||||
if (n < 2) return '';
|
||||
@@ -523,10 +528,27 @@ function healthVerdict(connected, stale) {
|
||||
if (stale) return { level: 'red', detail: 'The translation app has stopped responding.' };
|
||||
if (!state.live) return { level: 'green', detail: 'Ready.' };
|
||||
if (!es.modelsReady) return { level: 'amber', detail: 'Models are still loading.' };
|
||||
if ((es.lagMs || 0) > 12000 || (es.captionOnlyFinals || 0) > 0)
|
||||
/*
|
||||
* RECENTLY, not ever.
|
||||
*
|
||||
* captionOnlyFinals is a running total for the whole service, and testing it
|
||||
* for "more than zero" meant a single stale sentence pinned the desk's light
|
||||
* red until the next restart. MEASURED: a campus Mac took one 16 s stall at
|
||||
* 14:25 — caused by two Screen Sharing sessions competing for the machine —
|
||||
* recovered immediately to a 421 ms lag with an empty queue, and still showed
|
||||
* red half an hour later. An operator who looks up and sees red wants to know
|
||||
* what is wrong NOW; a light that cannot go back to green teaches them to
|
||||
* ignore it.
|
||||
*
|
||||
* So the totals still travel, for the record and for the operator page, but
|
||||
* the verdict asks when it last happened.
|
||||
*/
|
||||
const recentCaptionOnly = es.captionOnlyAt && (Date.now() - es.captionOnlyAt) < TROUBLE_WINDOW_MS;
|
||||
if ((es.lagMs || 0) > 12000 || recentCaptionOnly)
|
||||
return { level: 'red',
|
||||
detail: 'Falling badly behind — some sentences are captions only.' + loadNote() };
|
||||
if ((es.lagMs || 0) > 6000 || (es.queue || 0) >= 2 || (es.degradedFinals || 0) > 0)
|
||||
const recentDegraded = es.degradedAt && (Date.now() - es.degradedAt) < TROUBLE_WINDOW_MS;
|
||||
if ((es.lagMs || 0) > 6000 || (es.queue || 0) >= 2 || recentDegraded)
|
||||
return { level: 'amber',
|
||||
detail: 'Running behind — idle languages may be trimmed to catch up.' + loadNote() };
|
||||
if (es.cloud && es.cloud.parked)
|
||||
|
||||
Reference in New Issue
Block a user