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 auto-starts mic, navigation tools fire reliably, Daily Log subnav

Adam Eivy39caecb7c0f0
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 9d73f67b5c..5e3c4f9dba 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -38,6 +38,12 @@
## Fixed
+- **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).
+
+- **Daily Log missing from Brain subnav** — `/brain/daily-log` had no sidebar link under the Brain section, so users had to type the URL or use voice navigation to find it. Added between Config and Digest in alphabetical order with a `BookOpen` icon.
+
- **Voice agent painfully slow when `model: 'auto'` picked a reasoning or oversized model** — `auto` was selecting `mistralai/ministral-3-14b-reasoning` (or any reasoning-tagged tool-capable model with the smallest `B` suffix), which spends 10–30s on internal `<think>` tokens before saying a word. Combined with the 70B Llama loaded in LM Studio eating the user's VRAM and no fast model installed, the first reply could take minutes. Fixes:
- `resolveModel` now sorts by `(non-reasoning first, then size)` instead of size alone, with a new `isReasoningModel` detector that flags `reasoning`/`r1`/`qwq`/`thinking`/`o1`/`deepseek-r1` patterns.
- When a reasoning model is the only tool-capable option, `streamChat` injects the disable directives that LM Studio actually honors per family — `/no_think` appended to the last system message (Qwen3), `chat_template_kwargs: { thinking: false, enable_thinking: false }` (Granite/vLLM), and `reasoning_effort: 'minimal'` (generic OpenAI shape). Unknown fields are ignored by other servers.
diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsx
index a893c75cb4..179d747fe3 100644
--- a/client/src/components/Layout.jsx
+++ b/client/src/components/Layout.jsx
@@ -100,6 +100,7 @@ const navItems = [
icon: Brain,
children: [
{ to: '/brain/config', label: 'Config', icon: Settings },
+ { to: '/brain/daily-log', label: 'Daily Log', icon: BookOpen },
{ to: '/brain/digest', label: 'Digest', icon: Calendar },
{ to: '/brain/graph', label: 'Graph', icon: Network },
{ to: '/brain/inbox', label: 'Inbox', icon: MessageSquare },
diff --git a/client/src/components/voice/VoiceWidget.jsx b/client/src/components/voice/VoiceWidget.jsx
index 965b24673f..4fb4655737 100644
--- a/client/src/components/voice/VoiceWidget.jsx
+++ b/client/src/components/voice/VoiceWidget.jsx
@@ -50,6 +50,11 @@ export default function VoiceWidget() {
const [interimTranscript, setInterimTranscript] = useState('');
const [expanded, setExpanded] = useState(false);
const [dictationActive, setDictationActive] = useState(false);
+ // Refs held by the voice:dictation listener so it can call the latest
+ // handleStart/handleStop closures without re-binding socket listeners on
+ // every prop change. Populated in the effect that defines the handlers.
+ const handleStartRef = useRef(null);
+ const handleStopRef = useRef(null);
const [handsFree, setHandsFree] = useState(() => {
if (typeof window === 'undefined') return true;
const stored = window.localStorage.getItem(HANDS_FREE_KEY);
@@ -149,7 +154,21 @@ export default function VoiceWidget() {
if (d?.path && typeof d.path === 'string') navigate(d.path);
}),
onVoiceEvent('voice:dictation', (d) => {
- setDictationActive((prev) => (prev === !!d?.enabled ? prev : !!d?.enabled));
+ const next = !!d?.enabled;
+ setDictationActive((prev) => (prev === next ? prev : next));
+ // Auto-start the mic when dictation begins — without this, clicking
+ // "Dictate" on the Daily Log enabled server-side dictation but the
+ // user's mic stayed off, so nothing was ever transcribed. Mirror the
+ // stop on the way out so leaving dictation cleans up the recorder.
+ // Read handleStart/handleStop through refs so we always pick up the
+ // latest closure (engine settings can change at runtime).
+ if (next) {
+ // Defer to next tick so the local stage / dictation state has
+ // settled before handleStart reads it.
+ setTimeout(() => { handleStartRef.current?.(); }, 0);
+ } else if (isWebSpeechCapturing() || isCapturing() || isContinuous()) {
+ handleStopRef.current?.();
+ }
}),
onVoiceEvent('voice:dailyLog:appended', (d) => {
if (d?.text) {
@@ -243,6 +262,12 @@ export default function VoiceWidget() {
warnIfQuiet(r.peak);
}, [handsFree, useWebSpeech]);
+ // Keep the refs the dictation listener uses pointed at the latest closures.
+ // Rebinding the listener itself would tear down/rebuild the socket
+ // subscription on every prop change, which is wasteful.
+ useEffect(() => { handleStartRef.current = handleStart; }, [handleStart]);
+ useEffect(() => { handleStopRef.current = handleStop; }, [handleStop]);
+
const handleClear = () => {
resetConversation();
setHistory([]);
diff --git a/server/services/voice/pipeline.js b/server/services/voice/pipeline.js
index 00bbd0ecff..03c6ddc811 100644
--- a/server/services/voice/pipeline.js
+++ b/server/services/voice/pipeline.js
@@ -26,8 +26,28 @@ const buildSystemPrompt = (cfg) => {
if (Array.isArray(p.traits) && p.traits.length) lines.push(`Personality: ${p.traits.join(', ')}.`);
if (cfg.llm.tools?.enabled) {
// Critical: with tools on, the model must ACTUALLY call them, not just
- // speak as if it did. Confirm only *after* a tool call succeeds.
- lines.push('You have tools for acting on the user\'s behalf (for example, saving to the brain inbox). When the user asks you to save, capture, add, remember, note, or file something, you MUST call the matching tool — do not just reply in words. After the tool runs, confirm briefly in one short sentence using the exact words the user said. If you reference the brain inbox, call it "brain inbox" (not "green inbox" or any other near-homophone).');
+ // speak as if it did. Small models (Qwen3-4B etc.) frequently *narrate*
+ // the action — they say "Opening your daily log" without ever issuing
+ // the tool_call. Be explicit about navigation/dictation verbs in
+ // addition to the original capture/save verbs, and tell the model not
+ // to echo or paraphrase the user's request as its own reply.
+ lines.push(
+ 'You have tools for acting on the user\'s behalf. ' +
+ '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"). ' +
+ '"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. ' +
+ '"what are my goals"/"my goals" → goal_list. ' +
+ '"is anything crashed"/"pm2 status"/"are services up" → pm2_status. ' +
+ 'NEVER reply with just the user\'s request echoed back (e.g., user says "open my daily log" — do NOT reply "open my daily log"; CALL daily_log_open). ' +
+ 'NEVER paraphrase the action as your reply ("Sure, opening your daily log now") without first calling the actual tool. ' +
+ 'After the tool runs, confirm briefly in one short sentence. ' +
+ 'If you reference the brain inbox, call it "brain inbox" (not "green inbox").'
+ );
} else {
// Prevent hallucinated actions when tools are disabled.
lines.push('You cannot take actions right now — no tools are enabled. If the user asks you to save, add, or remember something, acknowledge the request and honestly say you can\'t file it yourself yet. Do not claim to have done anything.');