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

feat: live AI operation status toasts + markdown taste summaries

Adam Eivy4f2ef927106b
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 8c1e755d19..d7716c6976 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -1,7 +1,13 @@
# Next Release
+## Added
+
+- **Live AI operation status — toasts + server logs for every model call.** The user had no idea when a feature like Digital Twin → Taste → "Generate Summary" was actually doing work versus hung; the button just animated and silently waited up to a minute while LM Studio loaded a model on demand. New `server/services/aiStatusEvents.js` exports an `EventEmitter` + `startAIOp({ op, label, providerId, providerName, model })` helper that emits phase-tagged events (`start`, `model:loading`, `model:loaded`, `complete`, `error`) with provider/model/op metadata. `server/services/socket.js` bridges the emitter onto a new `ai:status` Socket.IO channel broadcast to all clients. `server/lib/aiProvider.js` — `callProviderAISimple()` now starts a status op for every API call (logs always; toasts when the caller passes `op`/`opLabel`, plus model-loading/error always), and the LM Studio auto-load path emits `model:loading` ("Loading openai/gpt-oss-20b into LM Studio…") + `model:loaded` ("openai/gpt-oss-20b loaded (4.2s)") so the user sees what's happening instead of a frozen button. `server/services/taste-questionnaire.js` passes labeled ops for the three taste AI calls (section summary, overall summary, deeper personalized question) so toasts read "Generating Movies & Film taste summary…" rather than a generic provider name. New `client/src/hooks/useAIStatusNotifications.js` subscribes to `ai:status`, renders one mutating toast per op id (`toast.loading` → `toast.success`/`toast.error` with the same id so phases update the same toast), and is mounted globally in `client/src/components/Layout.jsx`. Silent (uninstrumented) ops only toast when something user-visible happens (model load, error, or call exceeds 2.5s) so background calls don't spam the UI; explicit user-triggered ops toast immediately. Server logs are single-line emoji-prefixed with op slug, phase, message, provider, model, and elapsed time per CLAUDE.md style. Files: `server/services/aiStatusEvents.js` (new), `server/lib/aiProvider.js`, `server/services/socket.js`, `server/services/taste-questionnaire.js`, `client/src/hooks/useAIStatusNotifications.js` (new), `client/src/components/Layout.jsx`.
+
## Fixed
+- **Taste summaries render as markdown and appear inline immediately after generation.** The Digital Twin → Taste tab had two regressions in the summary flow: (1) after clicking "Generate Summary" on the section-complete view, the button returned to its enabled state with no visible change — the summary was saved but not rendered until the user navigated away and back into the section's Review view, and (2) every place the summary did show (review-mode AI Summary card, expandable summary on the dashboard grid, "Unified Taste Profile" overall summary) used a `whitespace-pre-wrap` `<div>` so the LLM-generated markdown displayed as raw `### Movies & Film Profile`, `**Core Preferences:**`, `- Item 1` etc. instead of styled headings, bold text, and bullets. Now: the section-complete view shows the freshly-generated summary inline in a violet-bordered card the moment `loadProfile()` returns, and all three summary surfaces use the existing `MarkdownOutput` component (which already powers CoS, autobiography, etc.) so headings/bold/italics/bullets/blockquotes render properly. File: `client/src/components/digital-twin/tabs/TasteTab.jsx`.
+
- **Voice agent no longer feedback-loops on laptop speakers.** When the user ran the voice widget without headphones, TTS played through the laptop speakers, the built-in mic picked it up, STT transcribed the bot's own voice as a "user" turn, the bot replied to itself, and the loop repeated until the user manually stopped it. The existing substring-based echo gate in `voiceClient.js` was too brittle — STT mistranscribes TTS just enough that the heard text wasn't a clean substring of any spoken sentence, so the gate let the echo through. Replaced with a length-gate + trigram-overlap algorithm: utterances under 4 tokens always pass (so short barge-ins like "wait" / "stop" still interrupt the bot even if those words appear in TTS), and longer utterances are flagged as echo when they share ≥ 2 trigrams (3-word windows) with a recently-spoken sentence OR are a clean substring. Same algorithm runs server-side in a new `server/services/voice/echo.js` (per-socket `state.recentTts` ring) so continuous-mode whisper transcripts are also gated, not just Web Speech. Also added device-route detection: when the active mic shares a `groupId` with an audiooutput device AND the label looks headset-y (AirPods, Jabra, etc.), the gate is bypassed entirely (no acoustic echo path on real headphones); a `devicechange` listener re-evaluates on plug/unplug. Default-tight on uncertainty — false-headset would re-open the loop, false-built-in just makes barge-in slightly less twitchy. Files: `server/services/voice/echo.js` (new), `server/services/voice/echo.test.js` (new, 16 tests), `server/services/voice/pipeline.js`, `server/sockets/voice.js`, `client/src/services/voiceClient.js`.
- **Voice agent now navigates to the daily log via `ui_navigate`.** Three related issues caused "take me to the daily log" to fail or behave unexpectedly. (1) The `dailylog` intent regex used `\bdaily ?log\b`, which doesn't match STT typos like "daily login" / "daily logs" — so `daily_log_open` was filtered out of the offered toolset, the LLM only had `ui_navigate`, but `ui_navigate`'s description told it NOT to use that tool for daily log, leaving the model to fabricate a refusal ("Daily log isn't a valid page"). Loosened to `daily ?logi?n?s?` to absorb the drift. (2) Removed the contradictory "EXCEPT Daily Log (use daily_log_open)" carve-out from `ui_navigate`'s description and from the system prompt; the nav resolver already maps "daily log" / "journal" → `/brain/daily-log` correctly. The new rule: plain "go to / open / take me to my daily log" → `ui_navigate`; only pick `daily_log_open` when the user clearly wants to write/dictate ("start", "new", "entry", "make", "dictate"). (3) Extended `detectNarrationWithoutCall` to also catch the second narrate-without-call shape — the LLM emitting a literal tool name in its prose (e.g. `ui_navigate page="daily_log"`) without actually invoking it. The regex is now built dynamically from `getAllToolNames()` so it can't drift behind new tools. Files: `server/services/voice/tools.js`, `server/services/voice/pipeline.js`.
- **Reverting a peer to plain IP (after enabling Tailnet DNS) is now sticky.** When a user cleared a peer's `host` on the Instances page to switch the federation hop back to `http://<ip>`, the next inbound `peers/announce` from that peer would silently re-adopt the DNS name — the only safeguard was "is `existing.host` empty?", which couldn't distinguish "user explicitly cleared" from "never set yet." Added a `hostManual` flag on each peer record: latched to `true` whenever the user sets or clears the host via `PUT /api/instances/peers/:id`, and respected by `handleAnnounce` (auto-adoption is gated on `!existing.host && !existing.hostManual`). Fresh peers and peers that were auto-learned still receive automatic host updates from announces; only explicit user intervention pins the choice. Also added a one-click `use IP only` inline action on each peer's host editor and a discoverable banner at the top of the Instances page that summarizes Tailnet DNS state, surfaces the local instance's MagicDNS name in the SelfCard, and walks through the three-step setup (MagicDNS admin toggle → `npm run setup:cert` → click `use <host>` per peer). Files: `server/services/instances.js`, `server/services/instances.test.js`, `client/src/pages/Instances.jsx`.
diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsx
index ed4193c5b6..b027e1f815 100644
--- a/client/src/components/Layout.jsx
+++ b/client/src/components/Layout.jsx
@@ -83,6 +83,7 @@ import { useErrorNotifications } from '../hooks/useErrorNotifications';
import { useNotifications } from '../hooks/useNotifications';
import { useAgentFeedbackToast } from '../hooks/useAgentFeedbackToast';
import { useUpdateChecker } from '../hooks/useUpdateChecker';
+import { useAIStatusNotifications } from '../hooks/useAIStatusNotifications';
import NotificationDropdown from './NotificationDropdown';
import ThemeSwitcher from './ThemeSwitcher';
import CmdKSearch from './CmdKSearch';
@@ -300,6 +301,9 @@ export default function Layout() {
// Subscribe to agent completion feedback toasts
useAgentFeedbackToast();
+ // Live AI operation status (model loads, "calling LM Studio…", etc.)
+ useAIStatusNotifications();
+
// Check for PortOS updates and show toast when available
useUpdateChecker();
diff --git a/client/src/components/digital-twin/tabs/TasteTab.jsx b/client/src/components/digital-twin/tabs/TasteTab.jsx
index 0cd3d3bae4..a37241720e 100644
--- a/client/src/components/digital-twin/tabs/TasteTab.jsx
+++ b/client/src/components/digital-twin/tabs/TasteTab.jsx
@@ -25,6 +25,7 @@ import {
} from 'lucide-react';
import * as api from '../../../services/api';
import toast from '../../ui/Toast';
+import MarkdownOutput from '../../cos/MarkdownOutput';
const SECTION_ICONS = {
movies: Film,
@@ -318,7 +319,7 @@ export default function TasteTab({ onRefresh }) {
<Sparkles size={14} />
AI Summary
</h3>
- <div className="text-gray-300 text-sm whitespace-pre-wrap mb-3">{section.summary}</div>
+ <div className="text-sm mb-3"><MarkdownOutput content={section.summary} /></div>
{/* Behavioral Feedback */}
<div className="pt-3 border-t border-port-border">
@@ -400,6 +401,15 @@ export default function TasteTab({ onRefresh }) {
<span className="text-green-400">All questions for this section are complete.</span>
</div>
</div>
+ {section?.summary && (
+ <div className="bg-port-card rounded-lg border border-violet-500/30 p-4 mb-4">
+ <h3 className="text-sm font-medium text-violet-400 mb-2 flex items-center gap-2">
+ <Sparkles size={14} />
+ AI Summary
+ </h3>
+ <div className="text-sm"><MarkdownOutput content={section.summary} /></div>
+ </div>
+ )}
{!selectedProvider && (
<div className="p-4 bg-port-warning/10 border border-port-warning/30 rounded-lg mb-4 text-sm text-port-warning">
No API-based provider configured — Go Deeper and Generate Summary need one.{' '}
@@ -682,8 +692,8 @@ export default function TasteTab({ onRefresh }) {
{expandedSummary === section.id ? <ChevronUp size={12} /> : <ChevronDown size={12} />}
</button>
{expandedSummary === section.id && (
- <div className="mt-2 p-3 bg-port-bg rounded-lg text-xs text-gray-300 whitespace-pre-wrap max-h-48 overflow-auto">
- {section.summary}
+ <div className="mt-2 p-3 bg-port-bg rounded-lg max-h-72 overflow-auto">
+ <MarkdownOutput content={section.summary} />
</div>
)}
</div>
@@ -700,7 +710,7 @@ export default function TasteTab({ onRefresh }) {
<Sparkles className="w-5 h-5 text-violet-400" />
Unified Taste Profile
</h3>
- <div className="text-gray-300 text-sm whitespace-pre-wrap">{profile.profileSummary}</div>
+ <div className="text-sm"><MarkdownOutput content={profile.profileSummary} /></div>
</div>
)}
diff --git a/client/src/hooks/useAIStatusNotifications.js b/client/src/hooks/useAIStatusNotifications.js
new file mode 100644
index 0000000000..fa0fa8612c
--- /dev/null
+++ b/client/src/hooks/useAIStatusNotifications.js
@@ -0,0 +1,101 @@
+import { useEffect, useRef } from 'react';
+import toast from '../components/ui/Toast';
+import socket from '../services/socket';
+
+/**
+ * Subscribe to server-side AI operation status events and render them as
+ * live-updating toasts so the user can see what AI providers/models are
+ * being called, when a model is being loaded into memory, and when each
+ * call finishes.
+ *
+ * Phases (from server/services/aiStatusEvents.js):
+ * start — request kicked off
+ * model:loading — provider auto-loading a model (slow, always show)
+ * model:loaded — model is in memory and ready
+ * complete — call finished
+ * error — call failed
+ *
+ * UX rules:
+ * - Each op id maps to one toast; phases mutate the same toast.
+ * - "Silent" ops (callers that didn't pass `op`/`opLabel`) only render
+ * toasts when something user-visible happens: model loading, model loaded,
+ * errors, or calls that take longer than a couple seconds.
+ * - Non-silent ops render from the start so the user sees feedback for
+ * explicit actions (Generate Summary, etc.) even on fast calls.
+ */
+export function useAIStatusNotifications() {
+ // Per-op state: { silent, opened, slowTimer? }
+ const opsRef = useRef(new Map());
+
+ useEffect(() => {
+ const SLOW_CALL_MS = 2500;
+
+ const phaseIcon = {
+ start: '🤖',
+ 'model:loading': '📦',
+ 'model:loaded': '✅',
+ complete: '✓',
+ error: '✕'
+ };
+
+ const showLoading = (event) => {
+ const state = opsRef.current.get(event.id) || { silent: false };
+ state.opened = true;
+ opsRef.current.set(event.id, state);
+ toast.loading(event.message, { id: event.id, icon: phaseIcon[event.phase] || '🤖' });
+ };
+
+ const handleStatus = (event) => {
+ const state = opsRef.current.get(event.id) || { silent: !!event.silent, opened: false };
+ opsRef.current.set(event.id, state);
+
+ if (event.phase === 'start') {
+ if (!state.silent) showLoading(event);
+ // For silent ops, defer toast until something user-visible happens or
+ // until the call exceeds SLOW_CALL_MS.
+ else if (!state.opened) {
+ state.slowTimer = setTimeout(() => {
+ const cur = opsRef.current.get(event.id);
+ if (cur && !cur.opened) {
+ showLoading({ id: event.id, message: event.message, phase: 'start' });
+ }
+ }, SLOW_CALL_MS);
+ }
+ return;
+ }
+
+ if (event.phase === 'model:loading' || event.phase === 'model:loaded') {
+ // Always surface model load events regardless of silent flag — these
+ // are the ones the user is most likely to be waiting on.
+ showLoading(event);
+ return;
+ }
+
+ if (event.phase === 'complete') {
+ if (state.slowTimer) clearTimeout(state.slowTimer);
+ if (state.opened) {
+ // Update the existing toast to a brief success that auto-dismisses.
+ toast.success(event.message, { id: event.id, duration: 2500 });
+ }
+ opsRef.current.delete(event.id);
+ return;
+ }
+
+ if (event.phase === 'error') {
+ if (state.slowTimer) clearTimeout(state.slowTimer);
+ // Always show errors, even for silent ops — failures matter.
+ toast.error(event.message || 'AI call failed', { id: event.id, duration: 6000, icon: '✕' });
+ opsRef.current.delete(event.id);
+ }
+ };
+
+ socket.on('ai:status', handleStatus);
+ return () => {
+ socket.off('ai:status', handleStatus);
+ for (const s of opsRef.current.values()) {
+ if (s.slowTimer) clearTimeout(s.slowTimer);
+ }
+ opsRef.current.clear();
+ };
+ }, []);
+}
diff --git a/server/lib/aiProvider.js b/server/lib/aiProvider.js
index b59d4c21a1..6f5883c9fa 100644
--- a/server/lib/aiProvider.js
+++ b/server/lib/aiProvider.js
@@ -4,6 +4,7 @@
*/
import { getAllProviders } from '../services/providers.js';
+import { startAIOp } from '../services/aiStatusEvents.js';
const isAPI = (p) => p && p.type === 'api' && p.enabled !== false;
@@ -58,7 +59,7 @@ const lmStudioBaseFromEndpoint = (endpoint) =>
* is provider-config-driven so any caller of callProviderAISimple gets the
* same auto-recovery on first-use cold starts.
*/
-async function ensureLMStudioModelLoaded(provider) {
+async function ensureLMStudioModelLoaded(provider, statusOp) {
const baseUrl = lmStudioBaseFromEndpoint(provider.endpoint);
if (!baseUrl) return null;
@@ -90,7 +91,9 @@ async function ensureLMStudioModelLoaded(provider) {
const target = preferences.map(findInList).find(Boolean) || llms[0];
console.log(`📦 LM Studio reported no models loaded — auto-loading: ${target.id}`);
+ statusOp?.update('model:loading', `Loading ${target.id} into LM Studio…`, { model: target.id });
+ const loadStart = Date.now();
const loadCtl = new AbortController();
const loadTimer = setTimeout(() => loadCtl.abort(), 120000);
const loadResp = await fetch(`${baseUrl}/api/v1/models/load`, {
@@ -103,10 +106,13 @@ async function ensureLMStudioModelLoaded(provider) {
if (!loadResp.ok) {
const errText = loadResp._err || await loadResp.text?.().catch(() => 'unknown error') || 'unknown error';
console.error(`❌ Failed to auto-load LM Studio model ${target.id}: ${errText}`);
+ statusOp?.update('error', `Failed to load ${target.id}: ${errText}`, { model: target.id });
return null;
}
- console.log(`✅ LM Studio model loaded: ${target.id}`);
+ const loadMs = Date.now() - loadStart;
+ console.log(`✅ LM Studio model loaded: ${target.id} (${loadMs}ms)`);
+ statusOp?.update('model:loaded', `${target.id} loaded (${(loadMs / 1000).toFixed(1)}s)`, { model: target.id });
return target.id;
}
@@ -149,24 +155,56 @@ async function postChatCompletion(provider, model, prompt, { temperature, max_to
* actually-loaded model id rather than re-sending the original `model`,
* since LM Studio's model resolver is name-fuzzy and always returns the
* loaded one in chat-completion responses anyway.
+ *
+ * Pass `op` + `opLabel` to surface live status toasts in the UI via the
+ * `ai:status` Socket.IO channel. The op slug groups all phase events under
+ * one toast id so "loading model → calling → done" updates the same toast.
*/
-export async function callProviderAISimple(provider, model, prompt, { temperature = 0.3, max_tokens = 1000 } = {}) {
+export async function callProviderAISimple(provider, model, prompt, options = {}) {
+ const { temperature = 0.3, max_tokens = 1000, op, opLabel } = options;
if (provider.type !== 'api') {
return { error: 'This operation requires an API-based provider' };
}
const opts = { temperature, max_tokens, timeout: provider.timeout || 300000 };
+ // Always emit status events (server logs + UI toasts) for AI calls. Callers
+ // can pass `op` to give the toast a meaningful label; otherwise it's labeled
+ // generically by provider+model so the user still sees model loads etc.
+ const effectiveOp = op || `ai-call:${provider.id}`;
+ const effectiveLabel = opLabel || `Calling ${provider.name || provider.id}…`;
+ const statusOp = startAIOp({
+ op: effectiveOp,
+ label: effectiveLabel,
+ providerId: provider.id,
+ providerName: provider.name,
+ model,
+ silent: !op
+ });
+
+ const doneLabel = effectiveLabel.replace(/…$/, '');
+ const startMs = Date.now();
+ const elapsedSec = () => ((Date.now() - startMs) / 1000).toFixed(1);
+
const first = await postChatCompletion(provider, model, prompt, opts);
- if (!first.error) return { text: first.text };
+ if (!first.error) {
+ statusOp.complete(`${doneLabel} done (${elapsedSec()}s)`);
+ return { text: first.text };
+ }
if (first.status === 400 && LM_STUDIO_NO_MODEL_RE.test(first.body || '')) {
- const loaded = await ensureLMStudioModelLoaded(provider);
+ const loaded = await ensureLMStudioModelLoaded(provider, statusOp);
if (loaded) {
+ statusOp.update('start', `Calling ${provider.name || provider.id} (${loaded})…`, { model: loaded });
const retry = await postChatCompletion(provider, loaded, prompt, opts);
- if (!retry.error) return { text: retry.text };
+ if (!retry.error) {
+ statusOp.complete(`${doneLabel} done (${elapsedSec()}s)`, { model: loaded });
+ return { text: retry.text };
+ }
+ statusOp.error(retry.error, { model: loaded });
return { error: retry.error };
}
}
+ statusOp.error(first.error);
return { error: first.error };
}
diff --git a/server/services/aiStatusEvents.js b/server/services/aiStatusEvents.js
new file mode 100644
index 0000000000..5b76f6775c
--- /dev/null
+++ b/server/services/aiStatusEvents.js
@@ -0,0 +1,76 @@
+/**
+ * AI operation status events.
+ *
+ * Any AI call (LLM chat, model load, embedding, etc.) emits phase-tagged
+ * status events here. socket.js bridges them onto the `ai:status` Socket.IO
+ * channel so client UIs can show live toasts ("Loading gpt-oss-20b…",
+ * "Calling LM Studio…", "Done").
+ *
+ * Phases:
+ * start — request kicked off
+ * model:loading — provider reported no model loaded; auto-loading
+ * model:loaded — model is in memory and ready
+ * complete — call finished successfully
+ * error — call failed (with reason)
+ *
+ * Single-user system: events broadcast to all connected clients.
+ */
+import { EventEmitter } from 'events';
+import { randomUUID } from 'crypto';
+
+export const aiStatusEvents = new EventEmitter();
+aiStatusEvents.setMaxListeners(50);
+
+const ICONS = {
+ start: '🤖',
+ 'model:loading': '📦',
+ 'model:loaded': '✅',
+ complete: '🎉',
+ error: '❌'
+};
+
+/**
+ * Begin tracking an AI operation. Returns a handle with phase helpers.
+ *
+ * @param {object} init
+ * @param {string} init.op — short slug, e.g. 'taste-summary'
+ * @param {string} init.label — human description, e.g. 'Generating taste summary'
+ * @param {string} [init.providerId]
+ * @param {string} [init.providerName]
+ * @param {string} [init.model]
+ */
+export function startAIOp(init) {
+ const id = randomUUID();
+ const base = {
+ id,
+ op: init.op,
+ label: init.label,
+ providerId: init.providerId,
+ providerName: init.providerName,
+ model: init.model,
+ silent: !!init.silent
+ };
+
+ emit('start', base, init.label || `Calling ${init.providerName || init.providerId || 'AI'}…`);
+
+ return {
+ id,
+ update(phase, message, extra = {}) {
+ emit(phase, { ...base, ...extra }, message);
+ },
+ complete(message = 'Done', extra = {}) {
+ emit('complete', { ...base, ...extra }, message);
+ },
+ error(message, extra = {}) {
+ emit('error', { ...base, ...extra }, message);
+ }
+ };
+}
+
+function emit(phase, payload, message) {
+ const event = { ...payload, phase, message, ts: Date.now() };
+ aiStatusEvents.emit('status', event);
+ const provider = payload.providerName || payload.providerId || '';
+ const model = payload.model ? ` (${payload.model})` : '';
+ console.log(`${ICONS[phase] || '🤖'} AI[${payload.op}] ${phase}: ${message}${provider ? ` — ${provider}${model}` : ''}`);
+}
diff --git a/server/services/socket.js b/server/services/socket.js
index bc1c637d1c..fc08a1fdb7 100644
--- a/server/services/socket.js
+++ b/server/services/socket.js
@@ -20,6 +20,7 @@ import { reviewEvents } from './review.js';
import { loopEvents } from './loops.js';
import { imageGenEvents } from './imageGenEvents.js';
import { videoGenEvents } from './videoGen/events.js';
+import { aiStatusEvents } from './aiStatusEvents.js';
import * as shellService from './shell.js';
import {
validateSocketData,
@@ -544,6 +545,18 @@ export function initSocket(io) {
// Set up image generation event forwarding
setupMediaGenEventForwarding();
+
+ // Set up AI status event forwarding (broadcast to all clients)
+ setupAIStatusEventForwarding();
+}
+
+let aiStatusForwardingSetup = false;
+function setupAIStatusEventForwarding() {
+ if (aiStatusForwardingSetup) return;
+ aiStatusForwardingSetup = true;
+ aiStatusEvents.on('status', (data) => {
+ if (ioInstance) ioInstance.emit('ai:status', data);
+ });
}
function cleanupStream(socketId) {
diff --git a/server/services/taste-questionnaire.js b/server/services/taste-questionnaire.js
index 18dccb94df..dc504436ee 100644
--- a/server/services/taste-questionnaire.js
+++ b/server/services/taste-questionnaire.js
@@ -668,7 +668,12 @@ Respond with a concise profile in this exact structure:
**In Their Words:**
- [1-2 direct quotes that capture their taste]`;
- const result = await callProviderAISimple(provider, modelId, prompt, { temperature: 0.3, max_tokens: 1000 });
+ const result = await callProviderAISimple(provider, modelId, prompt, {
+ temperature: 0.3,
+ max_tokens: 1000,
+ op: `taste-summary:${sectionId}`,
+ opLabel: `Generating ${config.label} taste summary`
+ });
if (result.error) throw new Error(`AI analysis failed: ${result.error}`);
@@ -736,7 +741,12 @@ ${allTranscripts}
**Summary Tags:**
[5-8 descriptive tags like: "brutalist minimalist", "atmospheric storyteller", "texture-obsessed", etc.]`;
- const result = await callProviderAISimple(provider, modelId, prompt, { temperature: 0.3, max_tokens: 1500 });
+ const result = await callProviderAISimple(provider, modelId, prompt, {
+ temperature: 0.3,
+ max_tokens: 1500,
+ op: 'taste-summary:overall',
+ opLabel: 'Generating unified taste profile'
+ });
if (result.error) throw new Error(`AI analysis failed: ${result.error}`);
@@ -900,7 +910,12 @@ ${transcript || '(No responses yet for this section)'}
## Instructions
Generate exactly ONE question. Do not include any preamble, numbering, or explanation. Just the question text itself. Keep it under 150 words. Make it feel like a question from someone who genuinely knows and is curious about this person.`;
- const result = await callProviderAISimple(provider, modelId, prompt, { temperature: 0.8, max_tokens: 200 });
+ const result = await callProviderAISimple(provider, modelId, prompt, {
+ temperature: 0.8,
+ max_tokens: 200,
+ op: `taste-deep-question:${sectionId}`,
+ opLabel: `Crafting a deeper ${config.label} question`
+ });
if (result.error || !result.text?.trim()) {
console.log(`🎨 Personalized question generation failed for ${sectionId}: ${result.error || 'empty response'}`);