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: brain retry classification not working

Adam Eivy9ed3a1a68de6
diff --git a/server/services/brain.js b/server/services/brain.js
index 5e393e15da..2158aabb3e 100644
--- a/server/services/brain.js
+++ b/server/services/brain.js
@@ -47,6 +47,7 @@ async function callAI(promptStageName, variables, providerOverride, modelOverrid
const model = modelOverride || provider.defaultModel;
if (provider.type === 'cli') {
+
return new Promise((resolve, reject) => {
const args = [...(provider.args || []), prompt];
let output = '';
@@ -541,8 +542,8 @@ export async function retryClassification(inboxLogId, providerOverride, modelOve
const aiResponse = await callAI(
'brain-classifier',
{ capturedText: inboxLog.capturedText, now: new Date().toISOString() },
- providerOverride,
- modelOverride
+ provider,
+ model
).catch(err => {
aiError = err;
return null;
@@ -597,11 +598,21 @@ export async function retryClassification(inboxLogId, providerOverride, modelOve
}
// Classification succeeded with high confidence - auto-file
- const result = await fileThought(inboxLogId, classification.destination, classification.extracted);
+ const filedRecord = await fileToDestination(classification.destination, classification.extracted, classification.title);
+
+ await storage.updateInboxLog(inboxLogId, {
+ classification,
+ status: 'filed',
+ filed: {
+ destination: classification.destination,
+ recordId: filedRecord.id,
+ filedAt: new Date().toISOString()
+ }
+ });
console.log(`🧠 Retry successful for ${inboxLogId} -> ${classification.destination}`);
return {
- inboxLog: result.inboxLog,
+ inboxLog: await storage.getInboxLogById(inboxLogId),
message: `Successfully classified as ${classification.destination}`
};
}