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: Quick Enrich fallback question no longer repeats after being answered

Adam Eivyfdfdc6b66f08
diff --git a/.changelog/v0.11.x.md b/.changelog/v0.11.x.md
index 763cd41045..7e9125d4df 100644
--- a/.changelog/v0.11.x.md
+++ b/.changelog/v0.11.x.md
@@ -105,6 +105,8 @@ This release focuses on security improvements, bug fixes for the AI runner syste
### Quick Enrich Repeats Already-Answered Questions
- **AI fallback no longer recycles answered questions**: When all predefined and scale questions for a category are exhausted and AI question generation fails, the system now serves a generic follow-up ("What else should your digital twin know about your [category]?") instead of repeating the first predefined question
+- **Fallback only asked once**: The generic fallback question is now only served once per category; after being answered, the category signals completion instead of repeating
+- **Category exhaustion UI**: EnrichTab now shows a "all questions answered" completion view when a category has no more questions, instead of silently falling back to category selection
- **Deduplicated near-identical questions**: `values` and `non_negotiables` categories previously had nearly identical first questions; `values` now asks a distinct question about top three guiding values
### Quick Enrich Skip Returns Same Question
diff --git a/client/src/components/digital-twin/tabs/EnrichTab.jsx b/client/src/components/digital-twin/tabs/EnrichTab.jsx
index 78fe959003..96aa60c62a 100644
--- a/client/src/components/digital-twin/tabs/EnrichTab.jsx
+++ b/client/src/components/digital-twin/tabs/EnrichTab.jsx
@@ -249,6 +249,37 @@ export default function EnrichTab({ onRefresh }) {
);
}
+ // All questions exhausted for this category
+ if (activeCategory && !currentQuestion && !loadingQuestion) {
+ const categoryConfig = ENRICHMENT_CATEGORIES[activeCategory];
+ const Icon = categoryConfig?.icon || Sparkles;
+ return (
+ <div className="max-w-2xl mx-auto px-1">
+ <div className="mb-6">
+ <button
+ onClick={exitCategory}
+ className="flex items-center gap-2 text-gray-400 hover:text-white mb-4 py-2 min-h-[44px]"
+ >
+ <ArrowLeft size={18} />
+ Back to categories
+ </button>
+ <div className="flex items-center gap-3">
+ <div className={`p-2.5 rounded-lg bg-${categoryConfig?.color || 'blue'}-500/20`}>
+ <Icon className={`w-5 h-5 text-${categoryConfig?.color || 'blue'}-400`} />
+ </div>
+ <h2 className="text-xl font-semibold text-white">{categoryConfig?.label}</h2>
+ </div>
+ </div>
+ <div className="p-4 bg-green-500/10 border border-green-500/30 rounded-lg">
+ <div className="flex items-center gap-3">
+ <Check className="w-5 h-5 text-green-400" />
+ <span className="text-green-400">All questions for this category have been answered. Great job!</span>
+ </div>
+ </div>
+ </div>
+ );
+ }
+
// Q&A-based enrichment session
if (activeCategory && currentQuestion) {
const categoryConfig = ENRICHMENT_CATEGORIES[activeCategory];
diff --git a/server/services/digital-twin.js b/server/services/digital-twin.js
index c4847581a7..fdd5af2f56 100644
--- a/server/services/digital-twin.js
+++ b/server/services/digital-twin.js
@@ -933,6 +933,10 @@ export async function generateEnrichmentQuestion(category, providerOverride, mod
};
}
+ // Check if fallback was already served (all structured questions exhausted + at least one AI/fallback answered)
+ const structuredTotal = config.questions.length + categoryScaleQuestions.length;
+ const fallbackAlreadyAnswered = questionsAnswered > structuredTotal;
+
// Generate follow-up question using AI
const existingSoul = await getSoulForPrompt({ maxTokens: 2000 });
@@ -945,6 +949,8 @@ export async function generateEnrichmentQuestion(category, providerOverride, mod
}).catch(() => null);
if (!prompt) {
+ // Only serve the generic fallback once — if already answered, signal category is done
+ if (fallbackAlreadyAnswered) return null;
return {
questionId: generateId(),
category,
@@ -965,7 +971,8 @@ export async function generateEnrichmentQuestion(category, providerOverride, mod
const model = modelOverride || provider.defaultModel;
- let question = `What else should your digital twin know about your ${config.label.toLowerCase()}?`; // Fallback
+ const fallbackText = `What else should your digital twin know about your ${config.label.toLowerCase()}?`;
+ let question = null;
if (provider.type === 'api') {
const headers = { 'Content-Type': 'application/json' };
@@ -984,10 +991,16 @@ export async function generateEnrichmentQuestion(category, providerOverride, mod
if (response.ok) {
const data = await response.json();
- question = data.choices?.[0]?.message?.content?.trim() || question;
+ question = data.choices?.[0]?.message?.content?.trim() || null;
}
}
+ // If AI didn't produce a question, use generic fallback (but only once)
+ if (!question) {
+ if (fallbackAlreadyAnswered) return null;
+ question = fallbackText;
+ }
+
return {
questionId: generateId(),
category,