From e4fc62fb794682ffb2badd41553061a2f71d27ef Mon Sep 17 00:00:00 2001 From: faber Date: Mon, 13 Jul 2026 13:53:27 -0400 Subject: [PATCH] fix: skip harm classifier under No-Log, fix flush concurrency race - classifyHarm() skipped when noLogMode is true (saves OpenRouter credits + up to 4s latency) - flushTelemetry() no-log early return no longer resets _telemetry.flushing (prevents concurrent flushes when an in-flight request is still pending) Co-Authored-By: Claude Opus 4.6 --- index.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 602a6a7..ff068b1 100644 --- a/index.html +++ b/index.html @@ -4306,7 +4306,7 @@ } async function flushTelemetry() { - if (state.noLogMode) { _telemetry.buffer.length = 0; _telemetry.flushing = false; return; } + if (state.noLogMode) { _telemetry.buffer.length = 0; return; } if (_telemetry.flushing || _telemetry.buffer.length === 0) return; _telemetry.flushing = true; @@ -14285,9 +14285,11 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; visionContext = '[Image attached — vision analysis unavailable without OpenRouter key]'; } - // Fire harm classification in parallel (never blocks UI) + // Fire harm classification in parallel (telemetry-only — skip when No-Log) _lastHarmResult = null; - const harmPromise = classifyHarm(content).then(r => { _lastHarmResult = r; }).catch(() => {}); + if (!state.noLogMode) { + classifyHarm(content).then(r => { _lastHarmResult = r; }).catch(() => {}); + } // Capture structural context for telemetry (no content, no PII) _lastTelemetryCtx = {