Skip to content

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

address review (codex r3): stop proactive playback on detach; document mixed-version limit

[._.]/ Adam Eivy2f9ac789946d
diff --git a/client/src/services/voiceClient.js b/client/src/services/voiceClient.js
index 53fdbf1ace..2c1435ca73 100644
--- a/client/src/services/voiceClient.js
+++ b/client/src/services/voiceClient.js
@@ -412,6 +412,14 @@ socket.on('voice:output:detached', () => {
if (!isVoiceOutputPrimary) return;
isVoiceOutputPrimary = false;
notifyVoiceOutputPrimary();
+ // Another tab just took over proactive output. Drain any proactive audio
+ // still playing/queued here so the handoff is clean — otherwise this tab
+ // keeps speaking a briefing while the new primary starts the next one and
+ // both talk at once, breaking the single-recipient contract. stopPlayback
+ // only sets the sticky reject flag for per-turn `voice:tts:audio` (the
+ // proactive `voice:speak` handler is intentionally ungated), so a future
+ // proactive line still plays if this tab later reclaims output.
+ stopPlayback();
});
// A disconnect ends this socket's ownership — the server released it and, on
// reconnect, this tab gets a fresh socket with no claim (it only re-announces
diff --git a/server/services/voice/voiceOutput.js b/server/services/voice/voiceOutput.js
index 14fc1d05a7..dd0e56d1dd 100644
--- a/server/services/voice/voiceOutput.js
+++ b/server/services/voice/voiceOutput.js
@@ -133,6 +133,15 @@ export const getVoiceOutputSocket = () => {
// harmlessly reaches peer-relay sockets (they ignore `voice:speak`). Any
// transient multi-tab duplication only recurs among pre-upgrade tabs during an
// upgrade window and self-heals on reload.
+//
+// Known limitation (accepted): if a pre-upgrade tab coexists with a *current*
+// tab during the upgrade window, the current tab announces and this direct-send
+// branch wins, so the old tab is excluded until it reloads — proactive audio
+// still plays (on the current tab), just possibly not the one the user is
+// looking at. Fully fixing this would require the old client to speak the new
+// announce/claim protocol, which by definition it cannot. The stale-build toast
+// prompts a reload, which resolves it. Not worth carrying dual-protocol routing
+// for a single-user app's brief upgrade window.
export const emitVoiceOutput = (io, event, payload) => {
const target = getVoiceOutputSocket();
if (target) {