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

address review: avoid double-toast, log prune failure, test UNKNOWN_VOICE mapping

Adam Eivyac1db5e60bcb
diff --git a/client/src/components/settings/DatabaseTab.jsx b/client/src/components/settings/DatabaseTab.jsx
index c11ae421ba..743a8d57c7 100644
--- a/client/src/components/settings/DatabaseTab.jsx
+++ b/client/src/components/settings/DatabaseTab.jsx
@@ -224,7 +224,7 @@ export function DatabaseTab() {
if (successMsg) toast.success(typeof successMsg === 'function' ? successMsg(result) : successMsg);
loadStatus();
})
- .catch(err => toast.error(err.message || 'Action failed'))
+ .catch(() => { /* request() already surfaces API errors as a toast */ })
.finally(() => setActionInProgress(null));
}, [loadStatus]);
diff --git a/server/routes/voice.test.js b/server/routes/voice.test.js
index cfe8bd0192..f6cd97bb49 100644
--- a/server/routes/voice.test.js
+++ b/server/routes/voice.test.js
@@ -189,5 +189,24 @@ describe('Voice Routes', () => {
expect(res.headers['content-type']).toMatch(/audio\/wav/);
expect(res.headers['x-tts-latency-ms']).toBe('123');
});
+
+ it('maps err.code === "UNKNOWN_VOICE" from synthesize() to a 400 response', async () => {
+ const err = Object.assign(new Error('voice id not in catalog'), { code: 'UNKNOWN_VOICE' });
+ tts.synthesize.mockRejectedValue(err);
+ const res = await request(buildApp())
+ .post('/api/voice/test')
+ .send({ text: 'hello', voice: 'nonexistent', engine: 'piper' });
+ expect(res.status).toBe(400);
+ expect(res.body.error).toBe('voice id not in catalog');
+ });
+
+ it('still maps the legacy "unknown piper voice:" message to 400 (back-compat)', async () => {
+ tts.synthesize.mockRejectedValue(new Error('unknown piper voice: nonexistent'));
+ const res = await request(buildApp())
+ .post('/api/voice/test')
+ .send({ text: 'hello', voice: 'nonexistent', engine: 'piper' });
+ expect(res.status).toBe(400);
+ expect(res.body.error).toMatch(/unknown piper voice/);
+ });
});
});
diff --git a/server/services/cos.js b/server/services/cos.js
index 3546546233..4f20a21f04 100644
--- a/server/services/cos.js
+++ b/server/services/cos.js
@@ -166,7 +166,9 @@ export async function start() {
}
// Prune agent archives older than 90 days
- await pruneOldAgentArchives(AGENT_ARCHIVE_RETENTION_DAYS).catch(() => {});
+ await pruneOldAgentArchives(AGENT_ARCHIVE_RETENTION_DAYS).catch(err =>
+ console.warn(`⚠️ pruneOldAgentArchives failed: ${err?.message || err}`)
+ );
// Health check + orphan cleanup (15 min)
scheduleEvent({