Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: complete benchmark playback before recording startup evidence (#8857)
[._.]/ Adam Eivyb42ae54a4c95
diff --git a/client/src/services/voiceProfileBenchmark.js b/client/src/services/voiceProfileBenchmark.jsindex 656c48c8ad..e6a2293fc7 100644--- a/client/src/services/voiceProfileBenchmark.js+++ b/client/src/services/voiceProfileBenchmark.js@@ -14,23 +14,26 @@ export async function prepareProfilePlayback(profileId, payload = {}, options) {const audio = new Audio(`data:audio/wav;base64,${benchmark.audioBase64}`);const playbackStartupMs = await new Promise((resolve, reject) => {let settled = false;+ let firstPlaybackMs = null;const finish = (error) => {if (settled) return;settled = true;- const elapsed = Math.ceil(performance.now() - playbackStartedAt);clearTimeout(timeout);audio.removeEventListener('playing', onPlaying);audio.removeEventListener('error', onError);+ audio.removeEventListener('ended', onEnded);audio.pause();audio.removeAttribute('src');- if (error) reject(error);- else resolve(elapsed);+ if (error || firstPlaybackMs === null) reject(error || new Error('The benchmark ended without starting playback'));+ else resolve(firstPlaybackMs);};- const onPlaying = () => finish();+ const onPlaying = () => { firstPlaybackMs ??= Math.ceil(performance.now() - playbackStartedAt); };+ const onEnded = () => finish();const onError = () => finish(new Error('The benchmark audio could not play'));const timeout = setTimeout(() => finish(new Error('Benchmark playback timed out')), 30000);audio.addEventListener('playing', onPlaying);audio.addEventListener('error', onError);+ audio.addEventListener('ended', onEnded);// Browser play() reports playback denial through its promise.audio.play().catch(finish);});diff --git a/client/src/services/voiceProfileBenchmark.test.js b/client/src/services/voiceProfileBenchmark.test.jsindex 408835600b..c67cfd35e5 100644--- a/client/src/services/voiceProfileBenchmark.test.js+++ b/client/src/services/voiceProfileBenchmark.test.js@@ -27,6 +27,9 @@ describe('profile browser playback qualification', () => {expect(completeVoiceProfileInteractiveBenchmark).not.toHaveBeenCalled();clock.mockReturnValue(10250);audio.dispatchEvent(new Event('playing'));+ expect(completeVoiceProfileInteractiveBenchmark).not.toHaveBeenCalled();+ clock.mockReturnValue(13000);+ audio.dispatchEvent(new Event('ended'));await expect(pending).resolves.toEqual({ profile: { id: 'profile-1' } });expect(completeVoiceProfileInteractiveBenchmark).toHaveBeenCalledWith('profile-1', {benchmarkId: 'probe-1', renderRequestLatencyMs: 200, playbackStartupMs: 250,diff --git a/docs/features/voice.md b/docs/features/voice.mdindex 0e5ae4ff1f..e5a2d621a5 100644--- a/docs/features/voice.md+++ b/docs/features/voice.md@@ -71,7 +71,9 @@ or first-chunk streaming latency. Renderingalone never enables the route. A one-use receipt expires after two minutes, bindsthe measurement to the rendered profile revision, and saves its boundary, modelrevision and route decision together. Restarting the server or changing the-profile requires a fresh benchmark. Playback rejection or timeout cannot qualify.+profile requires a fresh benchmark. The probe must reach `ended` after `playing`+before submitting its startup measurement. Playback rejection or timeout cannot+qualify.The browser reports its own playback event; this is a trusted operator-reportedmeasurement, not an attestation of another machine's audio output. The receiptbinds the report to a current probe but cannot prove that a remote client played