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

fix(voice): dictation persists across reconnects, create-intent auto-starts dictation

Adam Eivyef5f7070f9cf
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 5e3c4f9dba..8021152bd0 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -38,6 +38,10 @@
## Fixed
+- **Daily Log "let's make a daily log" opened the page but didn't start dictation, leaving the user stuck routing each utterance through the LLM** — the assistant then narrated `Appending to daily log: "..."` without actually calling `daily_log_append`, so nothing got written. Two changes: (1) `daily_log_open` tool description now says `startDictation` defaults to true for any create/write-intent phrasing ("make"/"start"/"new"/"create"/"dictate"/"record"/"talk into"/"log something"), with `startDictation=false` reserved for explicit view-only verbs ("show me"/"open"/"go to" without any write verb). (2) System prompt enumerates the create-intent phrases that should map to `daily_log_open(startDictation=true)` and explicitly tells the model to STAY QUIET after the call so the dictation system handles every following utterance without an LLM in the loop. Live-tested on qwen3-4b: 4/4 create-intent phrasings now route to dictation; 1/1 view-intent phrasing routes to navigation only.
+
+- **Daily Log dictation silently flipped off mid-session after a brief network hiccup** — Socket.IO auto-reconnects on transient drops (idle tabs, sleeping laptops, flaky Tailscale), but each new connection spawns a fresh `state.dictation = { enabled: false }` on the server. The client UI still showed "Dictating" because no event told it otherwise, so subsequent utterances were routed to the LLM (Conversation panel) instead of appended to the journal. `voiceClient.js` now caches the last `setDictation` request and re-emits it on every socket `connect` event so the server's per-socket state always matches what the UI thinks it requested. Idempotent — re-emitting `enabled: true` for the same date is a no-op when state already matches.
+
- **Daily Log "Dictate" button enabled server-side dictation but the mic stayed off** — clicking *Dictate* set the server into dictation mode (banner shown, "Dictating to Daily Log" pill visible) but the user's microphone was never started, so utterances weren't captured and the entry stayed empty. The toggle only emitted `voice:dictation:set`; nothing told the VoiceWidget to also start listening. Now the widget's `voice:dictation` listener auto-calls `handleStart()` when dictation enables (Web Speech / hands-free / push-to-talk path is chosen by the same logic the mic button uses) and `handleStop()` when it disables. Routed through refs so the listener always picks up the latest engine settings without rebinding the socket subscription on every prop change.
- **Voice agent narrated navigation requests instead of calling the navigation tool** — small models (qwen3-4b) frequently echo back "open my daily log" as their *spoken reply* instead of issuing the `daily_log_open` tool call. The system prompt only listed capture verbs (save/add/remember/note); it didn't cover navigation verbs (open/go to/take me to) or fuzzy daily-log phrasings ("let's make a daily log", "I want to make a log entry"). System prompt now enumerates trigger phrases for navigation, dictation, capture, time, goals, and pm2 tools, and explicitly instructs the model to never echo or paraphrase the action as its reply without first calling the tool. Live-tested against qwen3-4b — three of five tested phrasings that previously echoed now correctly hoist to `daily_log_open` (and the rest land within one retry).
diff --git a/client/src/services/voiceClient.js b/client/src/services/voiceClient.js
index a1d16815c5..192d587fa3 100644
--- a/client/src/services/voiceClient.js
+++ b/client/src/services/voiceClient.js
@@ -226,10 +226,28 @@ export const sendText = (text, source = 'text') => {
socket.emit('voice:text', { text: trimmed, source });
};
+// Last requested dictation state — used to re-sync the server on socket
+// reconnect. Without this, a brief network blip silently flips the server's
+// per-connection dictation state back to false while the UI still shows
+// "Dictating" — every utterance after the reconnect would be routed to the
+// LLM (Conversation panel) instead of appended to the Daily Log.
+let lastDictationRequest = { enabled: false, date: null };
+
export const setDictation = (enabled, date) => {
- socket.emit('voice:dictation:set', { enabled: !!enabled, date: date || null });
+ lastDictationRequest = { enabled: !!enabled, date: date || null };
+ socket.emit('voice:dictation:set', lastDictationRequest);
};
+// On every (re)connect, push the latest dictation request back to the server
+// so its fresh per-socket state matches the UI. The 'connect' event fires for
+// both the initial connection (no-op since enabled=false by default) and
+// every reconnect — both are safe to handle the same way.
+socket.on('connect', () => {
+ if (lastDictationRequest.enabled) {
+ socket.emit('voice:dictation:set', lastDictationRequest);
+ }
+});
+
export const interrupt = () => {
socket.emit('voice:interrupt');
stopPlayback();
diff --git a/server/services/voice/pipeline.js b/server/services/voice/pipeline.js
index 03c6ddc811..64663210b1 100644
--- a/server/services/voice/pipeline.js
+++ b/server/services/voice/pipeline.js
@@ -36,8 +36,9 @@ const buildSystemPrompt = (cfg) => {
'You MUST call the matching tool whenever the user requests an action — ' +
'never describe the action in words instead of calling the tool. ' +
'Trigger phrases that REQUIRE a tool call: ' +
- '"open"/"go to"/"take me to"/"show me"/"navigate to" → matching navigation tool (e.g., daily_log_open). ' +
- 'Anything mentioning "daily log" without a clear intent of just discussing it (e.g., "let\'s make a daily log", "I want to make a log entry", "let me log something today", "new daily log") → daily_log_open (set startDictation=true if they said "dictate" / "talk into" / "record"). ' +
+ '"open"/"go to"/"take me to"/"show me"/"navigate to" → matching navigation tool (e.g., daily_log_open with startDictation=false). ' +
+ 'INTENT TO CREATE / WRITE in the daily log — phrases like "let\'s make a daily log", "let\'s make a new daily log", "start a daily log", "I want to make a log entry", "let me log something today", "new daily log", "let me add to my log" → call daily_log_open with startDictation=true. After this single tool call, STOP TALKING and let the user dictate freely — the dictation system handles every following utterance automatically without you. Do NOT say "I\'ll append it" or "what would you like to add" — the user already knows. Just confirm in one short sentence ("Daily log open, dictating now.") and stay quiet. ' +
+ 'When the user is asking you to write something specific into the log right now (e.g., "add to my log: I went to the gym", "note in today\'s log that X") → call daily_log_append with the exact text — never just say "Appending …" without actually issuing the tool call. ' +
'"save"/"capture"/"add"/"remember"/"note"/"file"/"log it" → matching capture tool (e.g., brain_capture, meatspace_log_*, daily_log_append, goal_log_note). ' +
'"start dictation"/"dictate"/"record my log" → daily_log_start_dictation. ' +
'"what time"/"what day"/"what date" → time_now. ' +
diff --git a/server/services/voice/tools.js b/server/services/voice/tools.js
index 48ffc718a5..20ebbb55e9 100644
--- a/server/services/voice/tools.js
+++ b/server/services/voice/tools.js
@@ -504,13 +504,18 @@ const TOOLS = [
{
name: 'daily_log_open',
description:
- 'Open the Daily Log page in the UI and optionally start voice dictation mode. Use when the user says "open my daily log", "take me to my daily log", "go to daily log", "I want to dictate my daily log", "start my daily log". Set startDictation=true when the user wants to speak entries (explicit dictation verbs: "dictate", "record", "start logging"). The tool navigates the browser to the Daily Log page; the confirmation spoken back to the user should be one short sentence.',
+ 'Open the Daily Log page in the UI and optionally start voice dictation mode. ' +
+ 'Use when the user says "open my daily log", "take me to my daily log", "go to daily log", "let\'s make a daily log", "let\'s make a new daily log", "I want to make a log entry", "start my daily log", "new daily log", "let me add to my log". ' +
+ 'Set startDictation=true (DEFAULT for create-intent phrasings) when the user wants to write content right now — i.e., they said any of: "make"/"start"/"new"/"create"/"dictate"/"record"/"talk into"/"log something". ' +
+ 'Set startDictation=false ONLY when the user explicitly just wants to LOOK at the page without writing — i.e., they said "show me", "open"/"go to" without any create/write verb. ' +
+ 'When in doubt, prefer startDictation=true — voice users almost always want to write, and they can say "stop dictation" to exit. ' +
+ 'After calling, confirm briefly in one short sentence and stay quiet so the dictation system can capture freely.',
parameters: {
type: 'object',
properties: {
startDictation: {
type: 'boolean',
- description: 'Immediately enter dictation mode where subsequent speech is appended to the log verbatim instead of sent to you as conversation.',
+ description: 'Immediately enter dictation mode — subsequent speech is appended to the log verbatim instead of sent to you as conversation. DEFAULT TRUE for create/write intent ("make"/"start"/"new"/"dictate"); only false when the user explicitly just wants to view the page.',
},
},
},